OpenCv cvresize ()

Source: Internet
Author: User

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 ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.