Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Defects in Colored pixels

Using NI Vision, I am trying to isolate and count and black and bright spots in the colored pixels

Problem 1)

 

I am current locating the pixels using shape dectection and using a mask smaller than the pixel size.  However, I would like to use the entire shape found(colored pixel) to mask the colored pixel.  Is it possible to mask the colored pixels based on the coordinates of the shape detection?

 

Problem 2)

 

If I mask the entire colored pixel the black/bright spots are difficult to find when thresolding the image because the center of the colored pixels are so much brighter than corners. If colored pixels are not uniform is there still a way to detect the defects?  Do I need to try extracting a different plane then threshold the image?

 

Any comments or suggestions would be greatly appreciated,

E

Download All
0 Kudos
Message 1 of 5
(3,438 Views)

Hi E,

 

1) I saw you posted a Vision Assistant script. Are you using Vision Assistant in conjunction with LabVIEW? If so, the easiest option for you is going to be to detect those pixel rectangles using Vision Assistant, and then you can use those rectangles to create ROIs with IMAQ VIs in LabVIEW. At that point, you can either do your processing in LabVIEW with those ROIs, or use them to create smaller images from your original image which you can then feed into a second Vision Assistant VI, which could accomplish what you want. I've attached an example of creating ROIs from those squares.

 

2) You could try extracting different planes. such as the HSV luminance plane. Also try applying different lookup tables, to see if that has any effect.

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 2 of 5
(3,411 Views)

Thanks for the reply Dan, it definitely guided me in the correct direction.  Sorry for the late response but I finally got some time to work on this project.  I decided to just do everything in a Labview project rather than go between the vision assistant and labview.  I decided to crop the rectangles into their own individual images, order them, and then do the processing. 

 

I think my next step is to calibrate the images to determine the pixel area.  Any Advice on this subject? How difficult would it be to have option to let the user load an image with a known length, draw a line between the known distance, and enter the known distance to calibrate the loaded images.

0 Kudos
Message 3 of 5
(3,350 Views)

Hi Plexonite,

 

I think a good starting point would be to reference the Clamp Example.vi, you can find it from in LabVIEW click Help>>Find Examples…>>Toolkits and Modules>>Vision>>Functions>>Clamp Example.vi. That example lets you draw a region of interest on an image and it outputs a length in pixels. With that pixel value you can use logic and math to calibrate your loaded images with whatever value you enter.

 

Tim

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,334 Views)

For those interested I added the User calibration. 

0 Kudos
Message 5 of 5
(3,299 Views)