Using Widthstep method to increase the pixel----of a range and imageroi contrast

Source: Internet
Author: User

//to add a range of pixels by using a Widthstep method//Sandy//Time: 2015-10-5#include <cv.h>#includeintMainintargcChar**argv) {    //Loading Picturesiplimage*interest_img; Interest_img=cvloadimage ("e:\\picture\\d.jpg",1); //define a rectangle as an area of interestCvrect Rect=cvrect ( -, Max, -, -); //Create Iplimage image header, make image size, depth and number of channelsIplimage *sub_img=Cvcreateimageheader (Cvsize (rect.width,rect.height),//scale of image = Rectangle scaleInterest_img->depth, interest_img-nchannels); Sub_img->origin =interest_img->origin;//define the location of the origin of the image coordinatesSub_img->widthstep =interest_img->Widthstep; //ImageData Pointer to interest sub-areaSub_img->imagedata =interest_img->imagedata +Rect.y*interest_img->widthstep +Rect.x*interest_img->nchannels; //Blue Channel addedCvadds (Sub_img,cvscalar ( -), sub_img);//"Storing a single-channel image in pixels: cvscalar (255)" adds the first SUB_IMG element to the Cvscalar (100) to the second sub_img. //ShowCvnamedwindow ("Roi_add",1); Cvshowimage ("Roi_add", sub_img); //ReleaseCvreleaseimageheader (&sub_img);        Cvwaitkey (); return 0;}

Using Widthstep method to increase the pixel----of a range and imageroi contrast

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.