"Learning OpenCV" notes--matrix and image processing--cvand, Cvands, Cvavg and CVAVGSDV

Source: Internet
Author: User


Operation of matrices and images


(1) Cvand function

Its structure


void Cvand (  //Src1 and SRC2 by Pixel point "bitwise AND operation" Const cvarr* src1,//First Matrix const cvarr* src2,//second matrix cvarr* dst,//result Matrix Const Cvarr * Mask = null;//matrix by the line pixel point and the "switch");

Program Examples
#include <cv.h> #include 

Output Results

(2) cvands functionits structure
void Cvands (//Make SRC1 and value bitwise AND Operation const cvarr* src1,//first matrix cvscalar value,//operation scalar cvarr* dst,//result Matrix Const cvarr* mask = NULL ;//operation switch);

Instance Program
#include <cv.h> #include 

Output Results



(3) cvavg functionits structure
Cvscalar Cvavg (//Calculate SRC's average pixel value const cvarr* src,//target Matrix const cvarr* mark = null//pixel switch);

Example code: I use the image of the machine cat above
#include <cv.h> #include 

Output Results


(4) CVAVGSDV functionits structure
Cvscalar cvavg (//pixel mean and standard deviation const cvarr* arr,//target matrix cvscalar* mean,//average cvscalar* std_dev,//standard deviation const cvarr* mark = null// Pixel switch);

Example of a program: a picture of a machine cat still in use
#include <cv.h> #include 

Output Results


To be continued

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

"Learning OpenCV" notes--matrix and image processing--cvand, Cvands, Cvavg and CVAVGSDV

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.