Learning pyramid segmentation algorithm: A cvmemstorage * storage = cvcreatememstorage (0) needs to be created)
# Include "CV. H "# include" highgui. H "int main () {iplimage * src = cvloadimage (" D:/1.jpg", 1 ); // The image size must be divisible by 2 ^ level iplimage * resize = cvcreateimage (cvsize (512,512), 512,512); iplimage * DST = cvcreateimage (cvsize ); cvresize (SRC, resize); cvmemstorage * storage = cvcreatememstorage (0); cvseq * comp = NULL; cvpyrsegmentation (resize, DST, storage, & Comp, 6,200, 50 ); cvreleasememstorage (& storage); cvnamedwindow ("show", 1); // show the image in the named window cvshowimage ("show", DST ); // press any key to exit. cvwaitkey (0); // clean up and don't be piggies cvdestroywindow ("show"); cvreleaseimage (& SRC); cvreleaseimage (& DST); Return 0 ;}
Http://blog.csdn.net/gnuhpc/article/details/4284463this is also a good example