Cropping an image

Let's go back to the image with the two cats we previewed recently. Here, we will create a new picture, which will only contain the cat on the right:

Our first step will be to identify an area of interest. We will do this by loading the image to Julia and checking its width and height:

  using Images, ImageView  source_image = load("sample-images/cats-3061372_640.jpg");  size(source_image)

The size function will output (360, 640), which stands for 360px in height (y-axis) and 640px in width (x-axis). Both coordinates start from the top-left corner.

I have run a number of experiments and identified an area we are interested ...

Get Hands-On Computer Vision with Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.