当前位置:网站首页>What is the saturate operation in opencv
What is the saturate operation in opencv
2022-06-13 04:54:00 【Haohong image algorithm】
OpenCV Medium saturate operation ( Saturation operation ) What the hell is going on ?
Just try with two practical examples .
We use it CV_8U Type to try ,CV_8U For the range of 0~255
First example :
//OpenCV edition :3.0.0
//VS edition :2013
// Blogger WeChat /QQ 2487872782
// If you have any questions, you can contact the blogger
// If you need image processing development, please also contact the blogger
// Image processing technology exchange QQ Group 271891601
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
int main()
{
cv::Mat A1(2, 3, CV_8UC1, cv::Scalar(254));
cout << "A1 The data in is :\n" << A1 << endl << endl;
cv::Mat B1(2, 3, CV_8UC1, cv::Scalar(2));
cout << "B1 The data in is :\n" << B1 << endl << endl;
cv::Mat C1;
cv::add(A1, B1, C1);
cout << "C1 The data in is :\n" << C1 << endl << endl;
return(0);
}
The operation results are as follows :
According to the truth , The result should be 256, But because the type of output matrix is also CV_8U, and CV_8U For the range of 0~255, So the value is set to 255.
Second example :
//OpenCV edition :3.0.0
//VS edition :2013
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
int main()
{
cv::Mat A1(2, 3, CV_8UC1, cv::Scalar(254));
cout << "A1 The data in is :\n" << A1 << endl << endl;
cv::Mat B1(2, 3, CV_8UC1, cv::Scalar(2));
cout << "B1 The data in is :\n" << B1 << endl << endl;
cv::Mat C1;
cv::subtract(B1, A1, C1);
cout << "C1 The data in is :\n" << C1 << endl << endl;
return(0);
}
The operation results are as follows :
According to the truth , The result should be -252, But because the type of output matrix is also CV_8U, and CV_8U For the range of 0~255, So the value is set to 0.
Through these two examples , You should understand OpenCV Medium saturate operation ( Saturation operation ) What the hell is going on .
边栏推荐
- QT realizes message sending and file transmission between client and server
- Implementation of article list function on PHP 18 home page
- 你的一对一会议效率低下,你可以这么做!
- Section 5 - Operator details
- Autumn wind, dust, youth
- NodeJS 解析 GET 请求 url 字符串
- 约瑟夫问题
- Kaggle 时间序列教程
- 2022 oxidation process operation certificate examination question bank and simulation examination
- [try to hack] upload labs (temporarily write to 12)
猜你喜欢
![[try to hack] upload labs (temporarily write to 12)](/img/df/dbb78121f7428e25ffb73cfc43ce1b.png)
[try to hack] upload labs (temporarily write to 12)

CMB written test graphical reasoning

Section 3 - functions

Section 4 - arrays

Logical point

Analysis on the usage, response and global delivery of provide/inject

The games that you've tasted

josephus problem

About mission planning and improving execution

How to lay copper in AD (aluminum designer)
随机推荐
Kaggle time series tutorial
Section 5 - Operator details
rainbow
Tita:新锐集团采用一对一面谈推动绩效变革成功
Gradient descent, learning rate
PowerShell:因为在此系统上禁止运行脚本,解决方法
UNO
135. distribute candy
Internet people a few years ago vs Internet people today
How to lay copper in AD (aluminum designer)
About mission planning and improving execution
Colab tutorial (super detailed version) and colab pro/pro+ evaluation
Implementation of homepage header function in PHP development blog system
Red Treasure Book Reading Notes (continuously updated)
Stepping on a horse (one stroke)
Advantages of win8.1 and win10
PostgreSQL Guide: Insider exploration (Chapter 7 heap tuples and index only scanning) - Notes
Implementation of article list function on PHP 18 home page
How to implement a custom jdbc driver in only four steps?
2022年氧化工艺操作证考试题库及模拟考试