当前位置:网站首页>Reasons for data format conversion when matlab reads the displayed image
Reasons for data format conversion when matlab reads the displayed image
2022-07-25 15:45:00 【Machitangtang】
matlab The data read into the image is uint8, and matlab The median value is generally double type (64 position ) operation .
double The data of has a decimal point , and uint8 yes 0-255 The integer of , If you use it directly uint8 Calculation , Rounding error will occur in the calculation process , This error is relatively large in the image data .
uint8 The operation of is just to put a double Remove the part after the decimal point of the type ;
Reference resources :https://www.pianshen.com/article/1006326703/
1、MATLAB When reading an image, the image data should be converted into double

imread() Store the grayscale image in a 8 Bit matrix or color map is stored 8 position RGB Matrix
because MATLAB The data read into the image is uint8 Format , however MATLAB Generally used in double type (64) Bit sum operation , So we should turn the image into double type .
2、MATLAB When displaying images, use uint8 Format

imshow() When displaying an image , Need to use uint8 Format , That is to say double Format to uint8
3、 summary

MATLAB To save storage space , So reading the image at the beginning is uint8 The format of , namely 8 Bit storage .
But in MATLAB To participate in the operation is to double type , So at this time, you need to convert the image data format double.
When the picture is displayed , If direct imshow(double data format ), Then it will only be a white picture , because
This is because imshow() When displaying images double Type is to think in 0~1 Within the scope of , Greater than 1 It is always displayed in white , and imshow Show uint8 Type is 0~255 Range . Therefore, the data should be converted into uint8
Reference link :
https://blog.csdn.net/qq_26093511/article/details/53785298
边栏推荐
- 「数字安全」警惕 NFT的七大骗局
- 2021 Jiangsu race a Array line segment tree, maintain value range, Euler power reduction
- Window system black window redis error 20creating server TCP listening socket *: 6379: listen: unknown error19-07-28
- BSC智能链合约模式系统开发详情
- Componentization and modularization
- JVM knowledge brain map sharing
- 哪里有搭建flink cdc抽mysql数的demo?
- LeetCode - 362 敲击计数器(设计)
- Phased summary of the research and development of the "library management system -" borrowing and returning "module
- MySQL—常用SQL语句整理总结
猜你喜欢

Leetcode - 359 log rate limiter (Design)
SQL cultivation manual from scratch - practical part

LeetCode - 362 敲击计数器(设计)

Pytorch学习笔记-Advanced_CNN(Using Inception_Module)实现Mnist数据集分类-(注释及结果)

LeetCode - 641 设计循环双端队列(设计)*

Leetcode - 677 key value mapping (Design)*

MySQL - user and permission control

LeetCode - 232 用栈实现队列 (设计 双栈实现队列)

Pytoch learning notes -- seresnet50 construction

Geogle Colab笔记1--运行Geogle云端硬盘上的.py文件
随机推荐
Cf365-e - Mishka and divisors, number theory +dp
LeetCode - 359 日志速率限制器 (设计)
Node learning
Qtime定义(手工废物利用简单好看)
2019 Zhejiang race c-wrong arrangement, greedy
Pat grade a 1151 LCA in a binary tree (30 points)
盒子躲避鼠标
2016CCPC网络选拔赛C-换根dp好题
LeetCode - 677 键值映射(设计)*
How to realize page inclusion
Gary Marcus: 学习语言比你想象的更难
Binary complement
matlab randint,Matlab的randint函数用法「建议收藏」
不愧是阿里内部“千亿级并发系统架构设计笔记”面面俱到,太全了
哪里有搭建flink cdc抽mysql数的demo?
LeetCode - 232 用栈实现队列 (设计 双栈实现队列)
Leetcode - 303 area and retrieval - array immutable (design prefix and array)
Understanding of this object
十字链表的存储结构
Wechat applet