Creating sets of similar elements in a 2D array

后端 未结 4 1276
渐次进展
渐次进展 2020-12-28 23:51

I am trying to solve a problem that is based on a 2D array. This array contains different kinds of elements (from a total of 3 possible kinds). Lets assume the kind as X, Y,

4条回答
  •  情话喂你
    2020-12-29 00:42

    You may want to check out region growing algorithms, which are used for image segmentation. These algorithms start from a seed pixel and grow a contiguous region where all the pixels in the region have some property.

    In your case adjacent 'pixels' are in the same image segment if they have the same label (ie, kind of element X, Y or Z)

提交回复
热议问题