__2017-12-16 如一模式识别研究

如一模式识别研究

智能算法>>金字塔图像分割

转自:http://www.cnblogs.com/gnuhpc/archive/2012/11/25/2787606.html

#include

#include "cv.h"

#include "highgui.h"

#include

void f( IplImage* src, IplImage* dst )

{

CvMemStorage* storage = cvCreateMemStorage(0);

CvSeq* comp = NULL;

cvPyrSegmentation( src, dst, storage, &comp, 4, 200, 50 );

cvReleaseMemStorage( &storage );

}

int main(int argc, char** argv)

{

// Load the image from the given file name.

char *filename="lena.jpg";

IplImage *dst,*src = /blog.armyourlife.info/cvLoadImage(filename,1);

if(!src)

{

printf("Couldn't seem to Open %s, sorry/n",filename);

return -1;

}

dst = cvCreateImage( cvGetSize(src), src->depth, src->nChannels);

f( src, dst);

// Create a named window with a the name of the file.

cvNamedWindow( filename, 1 );

// Show the image in the named window

cvShowImage( filename, dst );

// Press any key to exit.

cvWaitKey(0);

// Clean up and don’t be piggies

cvDestroyWindow( filename );

cvReleaseImage( &src );

cvReleaseImage( &dst );

return 0;

}

作者:gnuhpc

出处:http://www.cnblogs.com/gnuhpc/

评论留言区

:
  

作者: 游客 ; *
评论内容: *
带*号为必填项目

如一模式识别更新提示

matlab在图像处理方面的应用有更新

如一模式识别 友情链接

关于本站作者     chinaw3c     mozilla