当前位置:网站首页>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
边栏推荐
- Gary marcus: learning a language is more difficult than you think
- 活动回顾|7月6日安远AI x 机器之心系列讲座第2期|麻省理工教授Max Tegmark分享「人类与AI的共生演化 」
- Are you ready to break away from the "involution circle"?
- LeetCode - 677 键值映射(设计)*
- 2019 Zhejiang race c-wrong arrangement, greedy
- 2019 Shaanxi Provincial race K-variant Dijstra
- Cf566a greed + dictionary tree
- 30行自己写并发工具类(Semaphore, CyclicBarrier, CountDownLatch)
- 带你创建你的第一个C#程序(建议收藏)
- 2019陕西省省赛K-变种Dijstra
猜你喜欢

Leetcode - 677 key value mapping (Design)*

Redis分布式锁,没它真不行

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

《图书馆管理系统——“借书还书”模块》项目研发阶段性总结

JVM - classloader and parental delegation model

带你创建你的第一个C#程序(建议收藏)

解决vender-base.66c6fc1c0b393478adf7.js:6 TypeError: Cannot read property ‘validate‘ of undefined问题

盒子躲避鼠标

LeetCode - 303 区域和检索 - 数组不可变 (设计 前缀和数组)

Brain racking CPU context switching
随机推荐
Gary marcus: learning a language is more difficult than you think
The difference between VaR, let and Const
PAT甲级题目目录
C#精挑整理知识要点12 异常处理(建议收藏)
2021hncpc-e-difference, thinking
Geogle colab notes 1-- run the.Py file on the cloud hard disk of Geogle
PAT甲级1153 Decode Registration Card of PAT (25 分)
2021江苏省赛A. Array-线段树,维护值域,欧拉降幂
Understanding of this object
Idea - click the file code to automatically synchronize with the directory
LeetCode - 303 区域和检索 - 数组不可变 (设计 前缀和数组)
Pytorch学习笔记--常用函数总结2
Phased summary of the research and development of the "library management system -" borrowing and returning "module
<栈模拟递归>
2022-07-25日报:微软提出CodeT:代码生成新SOTA,20个点的性能提升
var、let、const之间的区别
Games101 review: Transformation
< stack simulation recursion >
哪里有搭建flink cdc抽mysql数的demo?
2021 Shanghai match-h-two point answer