当前位置:网站首页>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
边栏推荐
猜你喜欢

Leetcode - 380 o (1) time to insert, delete and get random elements (design hash table + array)

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

Leetcode - 303 area and retrieval - array immutable (design prefix and array)

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

JVM knowledge brain map sharing

Pytoch learning notes -- Summary of common functions of pytoch 1

MySQL—常用SQL语句整理总结

Games101 review: linear algebra

MySQL—用户和权限管控

LeetCode - 677 键值映射(设计)*
随机推荐
Leetcode - 359 log rate limiter (Design)
LeetCode - 303 区域和检索 - 数组不可变 (设计 前缀和数组)
Qtime definition (manual waste utilization is simple and beautiful)
C#精挑整理知识要点12 异常处理(建议收藏)
JVM—类加载器和双亲委派模型
我想问下变量配置功能是只能在SQL模式下使用吗
Qtime定义(手工废物利用简单好看)
C # carefully sorting out key points of knowledge 11 entrustment and events (recommended Collection)
CF685B-求有根树每颗子树的重心
Leetcode - 232 realize queue with stack (design double stack to realize queue)
Pytorch学习笔记--常用函数总结2
LeetCode - 379 电话目录管理系统(设计)
十字链表的存储结构
MySQL optimization summary II
共2600页!又一份神级的面试手册面世~
Leetcode - 380 o (1) time to insert, delete and get random elements (design hash table + array)
Find out what happened in the process of new
Matlab randInt, matlab randInt function usage "recommended collection"
Pytoch learning notes - Teacher Liu Er RNN advanced chapter - code comments and results
2021HNCPC-E-差分,思维