当前位置:网站首页>Bug fix: Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
Bug fix: Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255]
2022-07-29 21:39:00 【Width in the journey~】
Today is another happy experience of correcting mistakes:
In the actual project of k-means for image compression, I encountered such a problem of pyplot displaying image error: Clipping input data to the valid range for imshow with RGB data ([0..1] forfloats or [0..255] for i
The reason for the error
1. The matplotlib.pyplot.imshow() function automatically normalizes its values when processing grayscale images
2. When dealing with color images, it does not, but converts floating point values to [0, 1] and integer values to the range [0, 255]
Because we use color photos, we need to normalize the dataset:
A=(A-mean(A))span>/std(A)But this still gives this warning, and the resulting image is seriously non-compliant.Because our method above is to convert floating point numbers to [-1, 1]
The correct solution
A=A/255.This bug eliminates!
边栏推荐
猜你喜欢

The younger brother asked: Is the work of a programmer a day’s work of code?

The demand for VR live broadcast marketing is increasing, and the data module is paving the way for us

博世集团启动量子数字孪生计划

siRNA-S-S-PEG-LMWP|M-MSN-siRNA介孔二氧化硅修饰RNA(齐岳RNA功能化修饰)

优惠券系统设计思想

五个供应商销售谈判策略的识别以及应对它们的方法

4. SAP ABAP OData 服务 Data Provider Class 的 GET_ENTITYSET 方法实现指南

There is a fee for the picture bed software. Forget it, I wrote an open source free one.

南华早报 | 助力亚洲最具公信力报章实现AD域自动化管理

JSP Servlet JDBC MySQL CRUD Sample Tutorial
随机推荐
MSNs-SS-siRNA二氧化硅-二硫键-核酸RNA|HA-SS-siRNA,hyaluronic acid透明质酸修饰RNA(RNA修饰剂)
Come in now!!!Take you to know the basic data types of C language
SAP ABAP OData 服务 Data Provider Class 的 GET_ENTITYSET 方法实现指南试读版
藻酸盐/PEI/DNA复合载体|脂质-鱼精蛋白-DNA复合物|合成方法
微信小程序 31 分包机制
conda虚拟环境 | install 与 list 问题
南华早报 | 助力亚洲最具公信力报章实现AD域自动化管理
微信小程序 30 自定义模板和获取用户登录凭证
五个供应商销售谈判策略的识别以及应对它们的方法
1. Promise usage in JS, 2. The concept and usage of closures, 3. The difference between the four methods and areas of object creation, 4. How to declare a class
促进二十一世纪创客教育的新发展
Common power symbols meaning sharing
【数据库】mysql日期格式转换
Baidu internship students late night fun: originally giant is this kind of life
C# WPF给综合实战项目加个帮助文档
Break the rules!MongoDB introduces SQL?
【593. 有效的正方形】
如何优雅的自定义 ThreadPoolExecutor 线程池
人社部公布“数据库运行管理员”成新职业,OceanBase参与制定职业标准
【Nacos】nacos1.x 单机、内置数据库模式修改密码