Pixels Stats inside Polygons

asked 2015-04-01 06:51:52 -0600

hmbawa gravatar image

Hi,

I have a 4 band image and a layer of polygons (.shp). I want to compute min,max,std.div, variance of all pixels inside each polygon in polygon layer for all bands. How can I do it using OpenCV. I am using c++.

Many thanks,

Maz

edit retag flag offensive close merge delete

Comments

2

OpenCV is not able to do this, simply because it cannot process .shp files. This means that you need to find a C++ library that reads in the files and converts them to an array of points. Then you can use those points to define a polygon mask in OpenCV, apply that to all layers of your image, than calculate those min max std and div values.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-01 08:03:28 -0600 )edit