Pixel grid binning - find max point in bin
Hello, I have hunted all over for this, and before I go off and code soemthing that may already exist, I thought I would ask here first.
I am trying to do some pixel binning in real world coordinates (a disparity map converted using reprojectto3d) by attempting to find the average Y value between two values (X and Z) to find the average and max height in that bin. I've coded something up by hand, but its hard coded and not very easy to change the bin sizes.
TL:DR. I'm wondering if opencv has this functionality build in somewhere that will give me a matrix back of the max and / or the average Y values, effectively reducing the pixel count in the image.
Thanks for your time!
Check minMaxLoc and normalize
Hmm, I think a histogram might be more suitable, counting all the Y values in the 'bin' and then averaging all the values in the bin after that. Unless I've misunderstood the histogram function?
:).................