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

Image capturing from web camera

We are starting our introduction to advanced image processing with capturing the content from a video camera.

Capturing frame from the camera is be done in multiple steps:

  1. Identifying the camera
  2. Capturing the frame
  3. Converting the frame to Julia images
  4. Previewing the result

We will also find the most efficient way of getting the results to Julia images; that is, running the conversion process from C++ on a Julia side or saving and reloading the image.

First, we start by initializing libraries and configuration parameters:

ENV["PKG_CONFIG_PATH"] = "/Users/dc/anaconda/envs/python35/lib/pkgconfig"

using OpenCV
using Images
using Cxx

Next, we proceed with defining the function to convert Open CV images to Julia images:

function opencv_to_image(img_opencv)

converted_image = zeros(Float16, (3, rows(img_opencv),
cols(img_opencv...