0

I have a 2D image, each pixel can have one of the 4 values: 1 (red), 2 (gray blue), 3 (yellow) and 4 (orange).

enter image description here

I want to detect the contour of this image and associated pixels like this:

enter image description here

I actually use C# and have very limited access to popular library like openCV, etc. Could you provide me some hints to solve this problem?

Thanks,

TP Nguyen
  • 51
  • 6
  • 1
    It's not clear what you call *contour* (what result is expected? numbers? array of points? polygone?). It looks like you want to estimate continous area of same color, see [flood fill](https://en.wikipedia.org/wiki/Flood_fill). – Sinatr Sep 25 '20 at 09:41
  • Hi Sinatr, I want, for the above example, to obtain a list of points (or pixels number) within each region (red, yellow, gray blue, orange) and the coordinate which allows to define the contour polygon. – TP Nguyen Sep 25 '20 at 12:07
  • Contours/regions are some work to get, but just a list of the pixels of each colour? That seems pretty trivial to me. As for region detect, there's [a question I answered on that subject here on SO](https://stackoverflow.com/a/50282882/395685), so you may want to check that out. – Nyerguds Nov 05 '20 at 17:40

0 Answers0