当前位置:网站首页>Opencv converts 16 bit image data to 8 bits and 8 to 16
Opencv converts 16 bit image data to 8 bits and 8 to 16
2022-07-07 08:43:00 【Xiaozhu】
1、16 Bit image data is converted to 8 position
function Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP);
/** @overload @param rows Number of rows in a 2D array. @param cols Number of columns in a 2D array. @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. @param data Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it. @param step Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize(). See Mat::elemSize. */
Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP);
rows The number of rows in a two-dimensional array
cols The number of columns in a two-dimensional array
type The type of array
data Pointer to user data
step The number of bytes occupied by each row of the matrix . This value must contain the data supplemented by each row . If you don't provide this parameter , Just assume that there is no supplement , The actual step size is equal to cols*elemSize()
Mat tmp;
Mat mat(dwCount, dwProfileDataCount, CV_16UC1, (void*)pHeightProfileArray, image_info.width*2);
mat.convertTo(tmp, CV_8UC1, 255.0 / 65535, 0.5);
2、8 Bit image data is converted to 16 position
Mat mat(1000, 3200, CV_8UC1, (void*)image->getMatPtr()->data, 3200);
Mat tep;
mat.convertTo(tep, CV_16UC1, 255.0);
边栏推荐
- Compilation and linking of programs
- JEditableTable的使用技巧
- 路由信息协议——RIP
- How to integrate app linking services in harmonyos applications
- Mock.js用法详解
- Data type - floating point (C language)
- iptables 之 state模块(ftp服务练习)
- Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
- Data type - integer (C language)
- 指针进阶,字符串函数
猜你喜欢

Practice of implementing cloud native Devops based on rainbow library app

Novice entry SCM must understand those things

let const

Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?

如何在HarmonyOS应用中集成App Linking服务

Data type - integer (C language)

Iptables' state module (FTP service exercise)

All about PDF crack, a complete solution to meet all your PDF needs
![[Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources](/img/e3/3703bdace2d0ca47c1a585562dc15e.jpg)
[Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources

21 general principles of wiring in circuit board design_ Provided by Chengdu circuit board design
随机推荐
AVL平衡二叉搜索树
Implement your own dataset using bisenet
MES system is a necessary choice for enterprise production
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
Rsync remote synchronization
GOLand idea intellij 无法输入汉字
Golang 编译约束/条件编译 ( // +build <tags> )
如何在HarmonyOS应用中集成App Linking服务
Gson转换实体类为json时报declares multiple JSON fields named
Compilation and linking of programs
The field value in Splunk subquery fuzzy matching CSV is*
Arm GIC (IV) GIC V3 register class analysis notes.
数据分析方法论与前人经验总结2【笔记干货】
Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月6日-新手快速上手-可无缝升级tp6版本
[Chongqing Guangdong education] accounting reference materials of Nanjing University of Information Engineering
Count sort (diagram)
[machine learning] watermelon book data set_ data sharing
go写一个在一定时间内运行的程序
Input and output of floating point data (C language)
leetcode134. gas station