当前位置:网站首页>Opencv macro definition
Opencv macro definition
2022-07-29 00:08:00 【Rolandxxx】
Preprocessing instruction : With # The first lines are preprocessing instructions , Used to instruct the compiler to do some preprocessing , Preprocessing implements text substitution instead of value substitution , Preprocessing instructions are not statements , So don't add a semicolon at the end of the line .
#define Define... For macros , There are two uses :
1) Define a number
#define Pi 3.14 // Note that macros are Pi Switch to 3.14 Rather than taking 3.14 Switch to Pi
2) Define an expression
Here are OpenCV The macro :
#define CV_8U 0 It means CV_8U The compiler will replace it with 0, What is it ? for instance , Because this can be used as a judgment , So when type yes CV_8U, It can be used if(type==0) sentence , because CV_8U Replaced with 0, So at this time, the conditions are met to enter if sentence
// Matrix data type :
// – CV_<bit_depth>(S|U|F)C<number_of_channels>
//S = Sign integers U = Unsigned integer F = floating-point
// among , The channel indicates how many numbers can be stored at each point , Be similar to RGB Each pixel in the color map has three values , That is, three channel . The depth in the picture indicates how many bits each value is stored , It is a question of accuracy , The general picture is 8bit( position ) Of , Then the depth is 8.
//CV_8U Is the data type representation 8 Bit unsigned integer (0..255)
#define CV_8U 0
#define CV_8S 1
#define CV_16U 2
#define CV_16S 3
#define CV_32S 4
#define CV_32F 5
#define CV_64F 6
#define CV_16F 7
#define CV_8UC1 CV_MAKETYPE(CV_8U,1)
#define CV_8UC2 CV_MAKETYPE(CV_8U,2)
#define CV_8UC3 CV_MAKETYPE(CV_8U,3)
#define CV_8UC4 CV_MAKETYPE(CV_8U,4)
#define CV_8UC(n) CV_MAKETYPE(CV_8U,(n))
#define CV_8SC1 CV_MAKETYPE(CV_8S,1)
#define CV_8SC2 CV_MAKETYPE(CV_8S,2)
#define CV_8SC3 CV_MAKETYPE(CV_8S,3)
#define CV_8SC4 CV_MAKETYPE(CV_8S,4)
#define CV_8SC(n) CV_MAKETYPE(CV_8S,(n))
#define CV_16UC1 CV_MAKETYPE(CV_16U,1)
#define CV_16UC2 CV_MAKETYPE(CV_16U,2)
#define CV_16UC3 CV_MAKETYPE(CV_16U,3)
#define CV_16UC4 CV_MAKETYPE(CV_16U,4)
#define CV_16UC(n) CV_MAKETYPE(CV_16U,(n))
#define CV_16SC1 CV_MAKETYPE(CV_16S,1)
#define CV_16SC2 CV_MAKETYPE(CV_16S,2)
#define CV_16SC3 CV_MAKETYPE(CV_16S,3)
#define CV_16SC4 CV_MAKETYPE(CV_16S,4)
#define CV_16SC(n) CV_MAKETYPE(CV_16S,(n))
#define CV_32SC1 CV_MAKETYPE(CV_32S,1)
#define CV_32SC2 CV_MAKETYPE(CV_32S,2)
#define CV_32SC3 CV_MAKETYPE(CV_32S,3)
#define CV_32SC4 CV_MAKETYPE(CV_32S,4)
#define CV_32SC(n) CV_MAKETYPE(CV_32S,(n))
#define CV_32FC1 CV_MAKETYPE(CV_32F,1)
#define CV_32FC2 CV_MAKETYPE(CV_32F,2)
#define CV_32FC3 CV_MAKETYPE(CV_32F,3)
#define CV_32FC4 CV_MAKETYPE(CV_32F,4)
#define CV_32FC(n) CV_MAKETYPE(CV_32F,(n))
#define CV_64FC1 CV_MAKETYPE(CV_64F,1)
#define CV_64FC2 CV_MAKETYPE(CV_64F,2)
#define CV_64FC3 CV_MAKETYPE(CV_64F,3)
#define CV_64FC4 CV_MAKETYPE(CV_64F,4)
#define CV_64FC(n) CV_MAKETYPE(CV_64F,(n))
#define CV_16FC1 CV_MAKETYPE(CV_16F,1)
#define CV_16FC2 CV_MAKETYPE(CV_16F,2)
#define CV_16FC3 CV_MAKETYPE(CV_16F,3)
#define CV_16FC4 CV_MAKETYPE(CV_16F,4)
#define CV_16FC(n) CV_MAKETYPE(CV_16F,(n))
边栏推荐
- Uricase - Characteristics of uricase in Worthington pig liver:
- pip镜像下载
- What is a driver signature and how does the driver get a digital signature?
- ISO 13400(DoIP)标准解读
- Summary of wrong questions of software designers
- CANoe应用案例之DoIP通信
- VS2005 accesses the setting method "recommended collection" of vss2005 through sourceoffsite
- Virtual lab basic experiment tutorial -8. Fourier transform (1)
- 【C】喝汽水,找单身狗问题
- Detailed principle explanation and verification results of digital clock based on FPGA
猜你喜欢

ISO 13400(DoIP)标准解读
![[MySQL series] MySQL database foundation](/img/50/cc75b2cdf6e52714c1d492fa1ae2c4.png)
[MySQL series] MySQL database foundation

基于 FPGA 实现数字时钟详细原理讲解及验证结果

Use pytoch to quickly train the network model

curl (7) Failed connect to localhost8080; Connection refused

Detailed explanation of 9 common reasons for MySQL index failure

【TA-霜狼_may-《百人计划》】美术2.2 模型基础

EN 1873屋面用装配附件.塑料单个屋面灯—CE认证

Real time data warehouse: Netease strictly selects the practice of real-time data warehouse based on Flink

pycharm配置运行环境
随机推荐
ISO 13400(DoIP)标准解读
EN 1873屋面用装配附件.塑料单个屋面灯—CE认证
基于 FPGA 实现数字时钟详细原理讲解及验证结果
RHCE first day
2022-07-28:以下go语言代码输出什么?A:AA;B:AB;C:BA;D:BB。 package main import ( “fmt“ ) func
1-5 类式组件
【TA-霜狼_may-《百人计划》】图形3.6 纹理压缩——包体瘦身术
Install MySQL using Yum for Linux
实时数仓:美团点评Flink的实时数仓应用分享
PowerCLi 批量添加esxi到vCenter
Genomic DNA isolation Worthington ribonuclease A
1-4 类的复习
Powercl batch creates and manages virtual switches
SQL left connection, internal connection writing method "recommended collection"
EN 12101-8:2011 smoke dampers for smoke and heat control systems - CE certification
Build SSM project with JSP as view parser
Leetcode60. 排列序列
websocket心跳机制(保活机制)
【C】 Replace spaces and realize binary parity bit exchange of integers by macros
迅为IMX6开发板QT系统创建AP热点基于RTL8723-交叉编译iptables