当前位置:网站首页>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
边栏推荐
- CVPR 2022 | 网络中批处理归一化估计偏移的深入研究
- Leetcode - 380 o (1) time to insert, delete and get random elements (design hash table + array)
- JVM knowledge brain map sharing
- Singleton mode 3-- singleton mode
- MySQL - user and permission control
- Understanding the difference between wait() and sleep()
- Wechat applet
- GAMES101复习:三维变换
- Pat grade a 1153 decode registration card of PAT (25 points)
- 2021上海市赛-D-卡特兰数变种,dp
猜你喜欢

Are you ready to break away from the "involution circle"?

CircleIndicator组件,使指示器风格更加多样化

Pytoch learning notes - Teacher Liu Er RNN advanced chapter - code comments and results

JVM - classloader and parental delegation model

Beyond Compare 4 实现class文件对比【最新】

LeetCode - 707 设计链表 (设计)

LeetCode - 677 键值映射(设计)*

Games101 review: Transformation

Pytorch学习笔记--常用函数总结3

Leetcode - 677 key value mapping (Design)*
随机推荐
GAMES101复习:三维变换
2021上海市赛-B-排序后dp
2016CCPC网络选拔赛C-换根dp好题
Gary Marcus: 学习语言比你想象的更难
JS URLEncode function
CF365-E - Mishka and Divisors,数论+dp
< stack simulation recursion >
Flex layout
Get the ask code corresponding to the key pressed by the keyboard
2021 Shanghai match-b-ranked DP
盒子躲避鼠标
ZOJ - 4114 Flipping Game-dp,合理状态表示
C # fine sorting knowledge points 10 generic (recommended Collection)
华为2023届提前批预热开始!左 神的程序代码面试指南终派上用场
CF750F1-思维dp
对this对象的理解
PAT甲级1151 LCA in a Binary Tree (30 分)
matlab randint,Matlab的randint函数用法「建议收藏」
LeetCode - 380 O(1) 时间插入、删除和获取随机元素 (设计 哈希表+数组)
C#精挑整理知识要点10 泛型(建议收藏)