"Learn OpenCV" considerations--matrix and image processing--cvadd, Cvadds and cvaddweighted

Source: Internet
Author: User

Matrix and image Manipulation


(1) CV Add function

Its structure


void Cvadd (//Image Plus and const cvarr* src1,//first original matrix const cvarr* src2,//second original matrix cvarr* DST,       //Storage Matrix const cvarr* mask = NULL:  //control points);

is simply to add two images plus. The mask variable controls the element point of the sums. Equivalent to "the function of the switch";

Program examples


#include <cv.h> #include 

Output Result:




(2) Cvadds function

Its structure


void Cvadds (//image plus const cvarr* src1,//first original matrix cvscalar value,    //sums constant cvarr* DST,       //Storage Matrix const cvarr* Mask = null:< c7/>//control point);

The function is to add a value to the image as the other and Cvadd, where value is a cvscalar amount so his four variables correspond to the RGB space.

Program examples


#include <cv.h> #include 

Output Result:




(3) cvaddweighted function

Its structure


void cvaddweighted (  //image Fusion Const cvarr* src1,//first original matrix. Double alpha,//The weight value of the first matrix element is const cvarr* src2,//the second original matrix. Double beta,//the weighted value of the second matrix element double gamma,//The constant entry that is added. cvarr* DST//output matrix);

This function is a formula plus and the formula is: DST = src1*alpha + Src2*beta + gamma. So two weights and try to be greater than 0 less than one.

Instance Program


#include <cv.h> #include 


Output Results



To be Continued




Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

"Learn OpenCV" considerations--matrix and image processing--cvadd, Cvadds and cvaddweighted

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.