1.边界扩展
1.1读写图片
cvloadimage------------>cvsaveimage
cv::imread------------------->cv::imwrite
#include<iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
#define Height 15
#define Width 15
int main()
{
// cvloadimage---->cvsaveimage
// imread--------->imwrite
IplImage* orgIm = cvLoadImage("F:/Image/aaa.bmp",0);
IplImage* dstIm = cvCreateImage(cvSize(orgIm->width+Width-1, orgIm->height+Height-1) , IPL_DEPTH_8U, 1);
cvCopyMakeBorder(orgIm,dstIm,cvPoint( Width/2, Height/2 ),IPL_BORDER_REPLICATE);
//cvCopyMakeBorder( orgIm, dstIm, cvPoint( Width/2, Height/2 ), IPL_BORDER_REFLECT );
//cvCopyMakeBorder( orgIm, dstIm, cvPoint( Width/2, Height/2 ), IPL_BORDER_REFLECT_101 );
//cvCopyMakeBorder( orgIm, dstIm, cvPoint( Width/2, Height/2 ), IPL_BORDER_WRAP );
//cvCopyMakeBorder( orgIm, dstIm, cvPoint( Width/2, Height/2 ), IPL_BORDER_CONSTANT );
cvSaveImage("F:/Image/result.bmp",dstIm);
return 0;