Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

counting pixel values in an array

Solved!
Go to solution

Hello

 

I converted my image in a 2D array then I use subset array function to return the subarray of my 1023 columns. 

Now I would Rich Textlike to scan my image vertically by column in order to add pixel values in each column and return the result for each column. Then I 'd like to extract the indexof the minimum value which is what i am looking for.

 

I you have any idea please let me know.

find enclosed my vi

 

Thanks

0 Kudos
Message 1 of 3
(3,243 Views)
Solution
Accepted by topic author luckyloic

It sounds like you are doing things the hard way.  Instead, I would suggest using IMAQ LinearAverages instead with the optional rectangle input.  This will give you the average of each column, which is just the total divided by the number of pixels.  You can then use Array Min to find the index of the smallest value.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(3,236 Views)

Hello Bruce

 

Thank you your solution works well ! Indeed your way is easier ... 🙂

 

Luckyloic

0 Kudos
Message 3 of 3
(3,233 Views)