Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Vision sum pixels

Quick question-- is there a way to sum up all the pixel counts in an image using imaq functions, or should I just use  imageToarray and sum array elements?


Message Edited by Candice on 05-29-2008 02:33 PM
0 Kudos
Message 1 of 6
(5,018 Views)

Hi, Candice,

As far as I know, there is no direct way to calculate sum, so you can use Image To Array->Sum Array Elements.
May be it will be be faster to calculate Histogram first, and then calculate sum from histogram elements.
The fastest way is your own DLL, where you will calculate sum.

best regards,
Andrey.

0 Kudos
Message 2 of 6
(5,000 Views)
Hi Candice,

You're right; using IMAQ ImageToArray and Add Array Elements is the simplest way to do this in LabVIEW.
Chris Bolin
LabVIEW Partner Program, CLA
0 Kudos
Message 3 of 6
(4,996 Views)

Another route would be to use IMAQ Quantify to measure the average pixel intensity, then multiply by the number of pixels to get the sum.  This may not be as accurate, but it depends on your application.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 6
(4,979 Views)
Actually that would work just fine b/c I made a mask and then multiplied the original image by the mask, giving me an image consisting of the region of interest and 0's everywhere else.
0 Kudos
Message 5 of 6
(4,971 Views)

hi candice;

I'm working about image processing but have some problems about arrays. as you see at the attachment; I can determine contaminated areas and want to calculate whole contaminated area as namerical. But I couldn't... could you help me about my problem?

I have attached my program and a sample...

thanks! 

Download All
0 Kudos
Message 6 of 6
(4,364 Views)