O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hands-On Computer Vision with Julia

Book Description

Explore the various packages in Julia that support image processing and build neural networks for video processing and object tracking.

About This Book
  • Build a full-fledged image processing application using JuliaImages
  • Perform basic to advanced image and video stream processing with Julia's APIs
  • Understand and optimize various features of OpenCV with easy examples
Who This Book Is For

Hands-On Computer Vision with Julia is for Julia developers who are interested in learning how to perform image processing and want to explore the field of computer vision. Basic knowledge of Julia will help you understand the concepts more effectively.

What You Will Learn
  • Analyze image metadata and identify critical data using JuliaImages
  • Apply filters and improve image quality and color schemes
  • Extract 2D features for image comparison using JuliaFeatures
  • Cluster and classify images with KNN/SVM machine learning algorithms
  • Recognize text in an image using the Tesseract library
  • Use OpenCV to recognize specific objects or faces in images and videos
  • Build neural network and classify images with MXNet
In Detail

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.

Style and approach

Readers will be taken through various packages that support image processing in Julia, and will also tap into open-source libraries such as Open CV and Tesseract to find the optimum solution to problems encountered in computer vision.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Computer Vision with Julia
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Getting Started with JuliaImages
    1. Technical requirements
    2. Setting up your Julia
      1. Installing packages
    3. Reading images
      1. Reading a single image from disk
      2. Reading a single image from a URL
      3. Reading images in a folder
    4. Saving images
    5. Using test images
    6. Previewing images
    7. Cropping, scaling, and resizing
      1. Cropping an image
      2. Resizing an image
      3. Scaling an image
        1. Scaling by percentage
        2. Scaling to a specific dimension
        3. Scaling by two-fold
    8. Rotating images
    9. Summary
    10. Questions
  7. Image Enhancement
    1. Technical requirements
    2. Images as arrays
      1. Accessing pixels
      2. Converting images into arrays of numbers
      3. Converting arrays of numbers into colors
      4. Changing color saturation
      5. Converting an image to grayscale
      6. Creating a custom color filter
    3. Applying image filters
      1. Padding images
        1. Padding with a constant value
        2. Padding by duplicating content from an image
      2. Blurring images
      3. Sharpening images
    4. Summary
    5. Questions
  8. Image Adjustment
    1. Technical requirements
    2. Image binarization
    3. Fundamental operations
      1. Image erosion
        1. Object separation using erosion
        2. Image preparation for text recognition
      2. Image dilation
        1. Merging almost-connected objects
        2. Highlighting details
    4. Derived operations
      1. Image opening
      2. Image closing
      3. Top-hat and bottom-hat operation
        1. Adjusting image contrast
    5. Summary
    6. Questions
  9. Image Segmentation
    1. Technical requirements
    2. Supervised methods
      1. Seeded region growing
        1. Identifying a simple object
        2. Identifying a complex object
    3. Unsupervised methods
      1. The graph-based approach
      2. The fast scanning approach
      3. Helper functions
    4. Summary
    5. Questions
    6. Further reading
  10. Image Representation
    1. Technical requirements
    2. Understanding features and descriptors
      1. FAST corner detection
      2. Corner detection using the imcorner function
      3. Comparing performance
    3. BRIEF – efficient duplicate detection method
      1. Identifying image duplicates
        1. Creating a panorama from many images
    4. ORB, rotation invariant image matching
    5. BRISK – scale invariant image matching
    6. FREAK – fastest scale and rotation invariant matching
      1. Running face recognition
    7. Summary
    8. Questions
  11. Introduction to Neural Networks
    1. Technical requirements
    2. Introduction
      1. The need for neural networks
      2. The need for MXNet
    3. First steps with the MNIST dataset
      1. Getting the data
      2. Preparing the data
      3. Defining a neural network
      4. Fitting the network
      5. Improving the network
      6. Predicting new images
      7. Putting it all together
    4. Multiclass classification with the CIFAR-10 dataset
      1. Getting and previewing the dataset
      2. Preparing the data
      3. Starting with the linear classifier
      4. Reusing the MNIST architecture
      5. Improving the network 
      6. Accuracy – why at almost 70
      7. Putting it all together
    5. Classifying cats versus dogs
      1. Getting and previewing the dataset
      2. Creating an image data iterator
      3. Training the model
      4. Putting it all together
    6. Reusing your models
      1. Saving the model
      2. Loading the model
    7. Summary
    8. Questions
    9. Further reading
  12. Using Pre-Trained Neural Networks
    1. Technical requirements
    2. Introduction to pre-trained networks
      1. Transfer learning
      2. MXNet Model Zoo
    3. Predicting image classes using Inception V3
      1. Setting up the Inception V3 environment
      2. Loading the network
      3. Preparing the datasets
      4. Running predictions
      5. Expected performance
      6. Putting it all together
    4. Predicting an image class using MobileNet V2
      1. Setting up the environment
      2. Loading the network
      3. Preparing the datasets
      4. Running the predictions
      5. Expected performance
      6. Putting it all together
    5. Extracting features generated by Inception V3
      1. Preparing the network
      2. Removing the last Softmax and FullyConnected layers
      3. Predicting features of an image
      4. Saving the network to disk
    6. Extracting features generated by MobileNet V2
      1. Preparing the network
      2. Removing the last Softmax and FullyConnected layers
      3. Predicting features of an image
      4. Saving the network to disc
      5. Putting it all together
    7. Transfer learning with Inception V3 
      1. Getting the data
      2. Preparing the dataset
      3. Extracting features
      4. Creating a new network
      5. Training and validating the results
    8. Summary
    9. Questions
    10. Further reading
  13. OpenCV
    1. Technical requirements
    2. Troubleshooting installation of Open CV
      1. Troubleshooting installation on macOS
    3. First steps with OpenCV
      1. Updating OpenCV package source code
      2. Defining Open CV location
      3. Testing whether OpenCV works
      4. Working with images
        1. Converting OpenCV Mat to Julia images
        2. Reading images
        3. Saving images
        4. Destroying the object
    4. Image capturing from web camera
    5. Face detection using Open CV
    6. Object detection using MobileNet-SSD
    7. Summary
    8. Questions
  14. Assessments
  15. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think