Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

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

$
0
0
I am working on a school project on image segmentation and object recognition and am trying out conditional / markov random fields on superpixels. [getLabels()](http://docs.opencv.org/trunk/d3/da9/classcv_1_1ximgproc_1_1SuperpixelSLIC.html#aca4e1b5813a6c16635700c85b9f13c23) 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.

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>