当前位置:网站首页>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
边栏推荐
- MySQL optimization summary II
- 2021 Shanghai match-b-ranked DP
- MySQL—用户和权限管控
- User defined annotation verification API parameter phone number
- Leetcode - 359 log rate limiter (Design)
- CVPR 2022 | in depth study of batch normalized estimation offset in network
- Pytorch学习笔记--常用函数总结2
- BSC智能链合约模式系统开发详情
- C#精挑整理知识要点11 委托和事件(建议收藏)
- 2016CCPC网络选拔赛C-换根dp好题
猜你喜欢

Pytoch learning notes advanced_ CNN (using perception_module) implements MNIST dataset classification - (comments and results)

Leetcode - 359 log rate limiter (Design)

Leetcode - 379 telephone directory management system (Design)

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

Leetcode - 677 key value mapping (Design)*

Games101 review: linear algebra

Redis分布式锁,没它真不行

Understanding the difference between wait() and sleep()

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

Pytoch learning notes -- seresnet50 construction
随机推荐
Take you to learn more about JS basic grammar (recommended Collection)
How to disable hosting when Flink SQL in flink-1.13.6 runs in yarn session mode
2022-07-25日报:微软提出CodeT:代码生成新SOTA,20个点的性能提升
Games101 review: Transformation
PAT甲级1151 LCA in a Binary Tree (30 分)
GAMES101复习:变换
共2600页!又一份神级的面试手册面世~
Cf566a greed + dictionary tree
C # fine sorting knowledge points 10 generic (recommended Collection)
No tracked branch configured for branch xxx or the branch doesn‘t exist. To make your branch trac
Flex 布局
Brain racking CPU context switching
Deadlock gossip
哪里有搭建flink cdc抽mysql数的demo?
HDU3873-有依赖的最短路(拓扑排序)
Pytoch learning notes -- Summary of common functions 2
Games101 review: linear algebra
Use cpolar to build a business website (how to buy a domain name)
Where is there a demo to set up the flex CDC to draw the number of MySQL?
Pytorch学习笔记--常用函数总结3