06-23-2010 10:25 AM
Dear colleagues
I have an application where a horizontal straight line (slightly tilted) is to be found in a camera image. The line is somewhat blurred, but still quite sharp, and it covers the whole width of the image. As I haven't found any Machine Vision (8.2) functions in LabVIEW (8.2.1), I'm hoping that someone has already solved this problem before and is kind enough to share the solution.
06-24-2010 01:26 AM
Post your image. Did you try thresholding and particle analysis.
Without seeing the actual image we can only guess.
06-27-2010 03:12 AM
Dear muks
I've posted a kind of worst case line; it does not cover the full width of the image and the intensity shows variations along the line. Can you explain how you would use threasholding and particle analysis.
06-28-2010 01:55 AM
First please dont renmae bmp to png. It takes just a second to open the image in paint and save it as png. The image is still trying load here.
06-28-2010 01:58 AM
Wierd. When i try to download the file, I get a file not found message in firefox.
06-28-2010 02:09 AM - edited 06-28-2010 02:10 AM
06-28-2010 02:18 AM
gerdW,
I am still not able to open the attachment posted by the op. I am able to download your attachment though...
06-28-2010 02:22 AM
Lefi,
I get 3 particles when i try thresholding (Background correction). And particle analysis. See the attached vi.
06-28-2010 03:01 AM
Dear muks
Thank you for showing me your solution. This reminds me that I haven't explained why I want to find the line. In the next step, I want to rotate the line to get it horizontal and then calculate the vertical width of the line. Maybe it is possible to calculate the width without rotating the image, but I haven't found any solution.
Anyway, when looking around among the IMAQ functions, I found "IMAQ Detect Lines.vi", but I just got error -1074396080, "IMAQ Detect Shapes
Invalid image type." The Reference Help doesn't give me much help (which I think is a common problem in LabVIEW), but I suspected that this function can't take I16 images (the help doesn't tell which image format that can be used), so after casting the image to U8, the function works fine. With the returned line coordinates and rotation, it is easy to rotate the line to horizontal and calculate the vertical profile.
06-28-2010 03:20 AM
Yes U8 grey scale iamge should work just fine.