两种image pyramids
- Gaussian pyramid: Used to downsample image.下采样。
Laplacian pyramid: Used to reconstruct an upsampled image from an image lower in the pyramid
- pyrUp(tmp, dst, Size(tmp.cols*2,tmp.rows*2);
- pyrDown(tmp, dst, Size(tmp.cols/2, tmp.rows/2);
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main()
{
Mat src= imread("image.jpg");
Mat tmp,dst;
tmp=src;
pyrUp(tmp,dst,Size(tmp.cols*2,tmp.rows*2));
namedWindow("original image",WINDOW_AUTOSIZE);
namedWindow("pyrUp",WINDOW_AUTOSIZE);
namedWindow("pyrDown",WINDOW_AUTOSIZE);
imshow("original image",src);
imshow("pyrUp",dst);
pyrDown(tmp,dst,Size(tmp.cols/2,tmp.rows/2));
imshow("pyrDown",dst);
waitKey(0);
}