Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2016-08-29 04:30:04 -0600

Nbb gravatar image

OpenCV superpixels - How to reorganize data into a 2D array ?

I am working on a school project on image segmentation and object recognition and am trying out conditional / markov random fields on superpixels. getLabels() returns a Mat where pixels belonging to the same superpixels are assigned the same integer for eg. from 0 to 1000. So I now have a 1D vector where each vector contains the mean coordinate of each superpixel.

However, since the structure of CRFs/MRFs in image processing are in a "2D" layout, Id like to reorganize the superpixels into a 2D array where neighbouring contents signify adjacent superpixels but am having a lot of problems doing so even if I have the mean of the xy coordinates of each superpixel.

I was hoping someone would have a suggestion on how I can achieve this.

OpenCV superpixels - How to reorganize data into a 2D array ?

EDIT: No one has any idea ????

I am working on a school project on image segmentation and object recognition and am trying out conditional / markov random fields on superpixels. getLabels() returns a Mat where pixels belonging to the same superpixels are assigned the same integer for eg. from 0 to 1000. So I now have a 1D vector where each vector contains the mean coordinate of each superpixel.

However, since the structure of CRFs/MRFs in image processing are in a "2D" layout, Id like to reorganize the superpixels into a 2D array where neighbouring contents signify adjacent superpixels but am having a lot of problems doing so even if I have the mean of the xy coordinates of each superpixel.

I was hoping someone would have a suggestion on how I can achieve this.