Book Image

Hands-On Computer Vision with Julia

By : Dmitrijs Cudihins
Book Image

Hands-On Computer Vision with Julia

By: Dmitrijs Cudihins

Overview of this book

Hands-On Computer Vision with Julia is a thorough guide for developers who want to get started with building computer vision applications using Julia. Julia is well suited to image processing because it’s easy to use and lets you write easy-to-compile and efficient machine code. . This book begins by introducing you to Julia's image processing libraries such as Images.jl and ImageCore.jl. You’ll get to grips with analyzing and transforming images using JuliaImages; some of the techniques discussed include enhancing and adjusting images. As you make your way through the chapters, you’ll learn how to classify images, cluster them, and apply neural networks to solve computer vision problems. In the concluding chapters, you will explore OpenCV applications to perform real-time computer vision analysis, for example, face detection and object tracking. You will also understand Julia's interaction with Tesseract to perform optical character recognition and build an application that brings together all the techniques we introduced previously to consolidate the concepts learned. By end of the book, you will have understood how to utilize various Julia packages and a few open source libraries such as Tesseract and OpenCV to solve computer vision problems with ease.
Table of Contents (11 chapters)
9
Assessments

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.