LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find intensity of pixels in a region

Hi All,

I have a grayscale image, lets call it I1. Also I have a mask image that will enable me to select a specific region of I1. The mask can be irregular shape too.

I want to create a 1 D array that will give me the intensity value of all the pixels(corresponding to I1) that are covered by the mask only. This can be compared to what imaq Line Profile does, only in this case it should be extended to an irregular region rather than line.

 

Now one way to do this would be to convert the mask image into an array and use a nested loop to check whether the pixel value is 1 or 0. If its 1 then index out the intensity value from the grayscale image and build array. However this will take a lot of time.

Is there any faster way?

 

 

I was also wondering whether its possible to use the imaq histograph to construct the required 1 D array?

This can be done using the Histogram element of the outptut cluster since it has the info about how many times an intensity value has repeated in the image.

But still no idea on how to use this info.

Can anyone suggest an alternative?

 

Regards

Aveo 

 

P.S : I posted this question on labVIEW board by mistake(couldnt find an option to delete post also), shifting it to machine vision now. If you do happen know the solution please post it here.

0 Kudos
Message 1 of 1
(2,545 Views)