LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting white pixels in a roi

Solved!
Go to solution

Hi to all.

 

I Have an inspection image an a template.

The template is inside inspection image.

I use pattern matching to know the template position (ROI) in the inspection image.

 

Know I would like to count the white pixels in that found ROI.

 

How can I do that?

Thanks.

0 Kudos
Message 1 of 6
(3,757 Views)

Get the pixel array from your ROI and Check which ever is white based on your pixel value and count the same

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 6
(3,752 Views)
Solution
Accepted by Alvaro.S
Go to Help->Find Examples->Search for Histogram.
Histogram will give you the array of number of pixels(y) with intensities as x.
Thanks
uday
0 Kudos
Message 3 of 6
(3,747 Views)

Yes, the problem with histogram.vi is that it calculates pixel information for whole image and I need just for a ROI.

0 Kudos
Message 4 of 6
(3,737 Views)

If you checked the example which i pointed it gives the Histogram in the ROI and not the entire image.

Ref: http://www.ni.com/example/30677/en/

Thanks
uday
0 Kudos
Message 5 of 6
(3,732 Views)

Try to share the Code which you tried. so that better guidance can be given based on your view.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 6
(3,717 Views)