标签:png default sts char amp har src 调整 double
一、图像金字塔
二、尺寸调整:resize()函数
1 void resize( InputArray src, OutputArray dst, 2 Size dsize, double fx = 0, double fy = 0, 3 int interpolation = INTER_LINEAR );
1 #include<opencv2/opencv.hpp> 2 #include<iostream> 3 4 using namespace cv; 5 using namespace std; 6 7 int main(int argc, char** argv) { 8 Mat srcImage = imread("C:\\Users\\Nelsoner\\Desktop\\Camera Roll\\05.jpg", 1); 9 10 Mat tmpImage, dstImage1, dstImage2; 11 tmpImage = srcImage; 12 13 imshow("【原图】", srcImage); 14 15 resize(tmpImage, dstImage1, Size(tmpImage.cols / 2, tmpImage.rows / 2), (0, 0), (0, 0), 3); 16 resize(tmpImage, dstImage2, Size(tmpImage.cols * 2, tmpImage.rows * 2), (0, 0), (0, 0), 3); 17 18 imshow("【效果图一】", dstImage1); 19 imshow("【效果图二】", dstImage2); 20 21 waitKey(0); 22 23 return 0; 24 }
三、图像金字塔,向上采样pyrUp()函数
void pyrUp( InputArray src, OutputArray dst, const Size& dstsize = Size(),
int borderType = BORDER_DEFAULT );
1 #include<opencv2/opencv.hpp> 2 #include<iostream> 3 4 using namespace cv; 5 using namespace std; 6 7 int main(int argc, char** argv) { 8 Mat srcImage = imread("C:\\Users\\Nelsoner\\Desktop\\Camera Roll\\05.jpg", 1); 9 10 Mat tmpImage, dstImage; 11 tmpImage = srcImage; 12 13 imshow("【原图】", srcImage); 14 pyrUp(tmpImage, dstImage, Size(tmpImage.cols * 2, tmpImage.rows * 2)); 15 imshow("【效果图】", dstImage); 16 17 waitKey(0); 18 return 0; 19 }
四、图像金字塔,向下采样pyrDown()函数
1 void pyrDown( InputArray src, OutputArray dst, 2 const Size& dstsize = Size(), int borderType = BORDER_DEFAULT );
标签:png default sts char amp har src 调整 double
原文地址:http://www.cnblogs.com/Nelsoner/p/6789609.html