From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision Pixel-by-Pixel Calculation

Solved!
Go to solution

@PietH wrote:

But what about the maximum value?

If I want to calculate a maximum value from the 9 pixels and the 16 surrounding pixels.

Is that possible with vision?


Not with a kernel for sure, and I don't think any other function will do that either.

 

I think you'll have to DIY that, by getting the 2D array (or 2D Array DVR), and looping over it in 2 for loops.

 

The tricky part is to make it efficient. You'd want to avoid getting 9 pixels, and get the max of that array, for each pixel. You'd be doing a lot of calculations twice.

 

Finding a smarter way to do it might not be easy though. Avoiding recalculations means using extra memory, and also making the copies. That might not be more efficient.

 

I'd make it work first. And optimize only if it's too slow.

0 Kudos
Message 11 of 12
(371 Views)

Thanks! I will try it out with 2D Array DVR.

Peter

0 Kudos
Message 12 of 12
(359 Views)