Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Computer Vision with Julia

You're reading from   Hands-On Computer Vision with Julia Build complex applications with advanced Julia packages for image processing, neural networks, and Artificial Intelligence

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781788998796
Length 202 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Dmitrijs Cudihins Dmitrijs Cudihins
Author Profile Icon Dmitrijs Cudihins
Dmitrijs Cudihins
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Started with JuliaImages FREE CHAPTER 2. Image Enhancement 3. Image Adjustment 4. Image Segmentation 5. Image Representation 6. Introduction to Neural Networks 7. Using Pre-Trained Neural Networks 8. OpenCV 9. Assessments
10. Other Books You May Enjoy

Rotating images

Rotation is another must-know technique when working with any type of image. We will start by initializing the required libraries and loading the image from disk. We will also be using the CoordinateTransformations package from the JuliaImages collection to define a rotation transformation:

  using Images, CoordinateTransformations
img = load("sample-images/cats-3061372_640.jpg");
tfm = LinearMap(RotMatrix(-pi/4))
img = warp(img, tfm)
imshow(img)

This results in the img variable being updated with a new image, which is shown as follows:

For ease of use, please refer to the following table:

Degree Formula
-30o -pi/6
-90o -pi/2
180 pi

Please be aware that rotating by degrees other than 90°, -90°, and 180° will result in a black background being added around the original image.

You have been reading a chapter from
Hands-On Computer Vision with Julia
Published in: Jun 2018
Publisher: Packt
ISBN-13: 9781788998796
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime