Machine Vision

Showing results for 
Search instead for 
Did you mean: 

How to convert an image into a line drawing format

Hi, I am relatively new to LabView and would like to know how I can use this program to input an image and convert it into a line drawing format. I read about techniques such as canny edge detection, but am not too sure how to input it into my LabView program. Currently I am using LabView 8.2 and Vision Development 8.0.
I desperately need help about this and would greatly appreciate any help. Thanks!!!
0 Kudos
Message 1 of 6

Hi Jason,

If you want to convert an image to a canny edged image, then yes, you are correct that using the IMAQ CannyEdgeDetection will suffice. This function uses a specialized edge detection method to accurately estimate the location of edges even under conditions of poor signal-to-noise ratios.  I have attached a screenshot of my block diagram which opens a jpg file, extracts a color pane, and performs a canny edge detection.  You can change the filter settings depending on the desired resulting image.  The CannyEdge Detection does return an image; if you would like image data to be returned as an array (data point position coordinates, contrast, polarity, etc.), I would suggest using the IMAQ Edge tool which finds edges along a path defined in the image. Edges are determined based on their contrast, slope, and steepness. There is a great example in LabVIEW which utilizes this function titled Edge Detection Example which can be found in the Example Finder using the task search under Toolkits and Modules >> Vision >> Functions.  I hope this helps.  Please let me know if you would like further clarification or assistance.


Vu D
Applications Engineer

Message 2 of 6
I managed to come up with the block diagram, however the results aren't exactly the best I can achieve. Is there anyway to improve it? Attached is my program and 2 of the images I need to obtain canny edge detection.
Yours Sincerely,
Download All
0 Kudos
Message 3 of 6

Hi Jason,

After taking a look at your images, there seems to be quite a bit of noise running horizontally across the images.  These lines are pretty strong, which I assume is why you are not getting the desired results in your program.  I would recommend trying to filter this noise somehow. If you can take two consecutive images while keeping your camera stationary, do these noisy lines shift?  If so, an option we have would be to average the image information from both frames so that the features will be enhanced while diminishing the noise.  You might also want to take a look at the different filtering options (smoothing, sharpening, etc).  You can easily access these functions using Vision Assistant to quickly see how the various filters alter your image.  Once you are able to suppress the horizontal noise, you can also try changing the various filter parameters of the Canny Edge Detection function.  You might also want to check if you are able to get better results using a different color plane in the “ExtractSingleColorPlane” VI (right now it is set to “Luminance”).  Hopefully this helps.

Vu D

0 Kudos
Message 4 of 6


I wonder if you have a screenshot the block diagram of the Canny Edge Detector developed manually (not using IMAQ)?


0 Kudos
Message 5 of 6

Hi Vudoo

Do You know if it is possible to implement the canny edge detection in VBAI?



LabVIEW 8.6 / 2009 / 2010
Vision Development Module 8.6 / 2009 / 2010
VBAI 3.6 / 2010
0 Kudos
Message 6 of 6