Via Snow after de Sun
Image size Transformation
void cvresize (const cvarr* SRC, cvarr* dst, int
Interpolation=cv_inter_linear);
Src
Enter an image.
Dst
The output image.
Interpolation
Difference method:
Cv_inter_nn-Nearest Neighbor difference value,
cv_inter_linear-bilinear difference value (default use)
Cv_inter_area-resampling using pixel relationships. When the image shrinks, the method
You can avoid the appearance of ripples. When the image is zoomed in, it resembles the Cv_inter_nn method:
cv_inter_cubic-cubic difference value.
The function cvresize changes the image src size to get the same sizes as DST. If set
ROI, the function will support the ROI as usual.
1#include"highgui.h"2#include"cv.h"3#include"cxcore.h"4#include <stdlib.h>5#include <stdio.h>6 intMainintargcChar**argv)7 {8Iplimage *src;9Iplimage *desc;Ten cvsize sz; One DoubleScale =0.5; A - -src = cvloadimage ("lena.jpg"); theSz.width = src->width*Scale ; -Sz.height = src->height*Scale ; -desc = cvcreateimage (sz,src->depth,src->nchannels); - cvresize (Src,desc, cv_inter_area); +Cvnamedwindow ("src", cv_window_autosize); -Cvnamedwindow ("desc", cv_window_autosize); +Cvshowimage ("src", SRC); ACvshowimage ("desc", desc); atCvwaitkey (0); - -Cvreleaseimage (&src); -Cvreleaseimage (&desc); -Cvdestroywindow ("src"); -Cvdestroywindow ("desc"); in - to return 0; +}
Resize
OpenCv cvresize ()