Preprocessing of Image for Canny

In the exercise we, Eliza and I, were tasked to do the following:

  1. Convert an Image to Greyscale.
  2. Create Binary Image using Adaptive Thresholding.
  3. Apply a Canny function to a Binary Image.
  4. And then explain our approach on this, especially since there are many approaches to image processing. There isn’t only one way of doing things, feature multiplicity.

The first and third step were completed in class, while the second and fourth was left to our processing.

test

Original image

 

The original image is a 300 by 300 pixel image. But since we had more difficulty processing an image that small, since we couldn’t interpret properly whether we have achieved the certain effect or not, we resized the image into 650 by 650.

preprocess-properly-transfor

PROCESS OF TRANFORMING ANG ALGORITHM FOR BINARIZING

The image
at the upper right is the resized image while the image at the upper left is its binary output. We put a transformation function inside the binarize function to separate the values from each other, before binarizing the values to be return as the focus point.

PROCESS OF BINARIZATION

description

But before actually binarizing and transforming the image, we first changed the image to greyscale, since the image can be humanly interpreted as an image full of text the best option is to changed the image into greyscale and then blur and sharpen the image enough that noise will no adversely effect the process of binarizing.

After, binarizing we still blurred and shapenned a little the binarized image since the initial output was like this:

edge-map_screenshot_25-09-2016

preprocess

PREPROCESSING

Where the edge detected for each word was not that distinct from the other words. To make it clearer, the image went through another 3 processes to make it clearer for the Canny Detector to detect the edges.

 

FINAL OUTPUT
goodedge-map_screenshot_25-09-2016

Better output



The workload for this exercise was divided in such a way that initial preprocessing code was done during class our in a single computer, and then later separated to do tweaking of adding additional blur and sharpen functions.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s