当前位置:网站首页>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!
边栏推荐
- 分析少年派2中的Crypto
- 赶紧进来!!!带你认识C语言基本数据类型
- mysql 获取字段注释 和获取表字段
- Samba server configuration (when a server is required)
- 如何进入董事会:给CIO的十条建议
- MySQL Data Query - Union Query
- 用 Array.every & Array.some 匹配全部/部分内容 es6
- 模型推理模板
- [ACTF2020 Freshman Competition]Exec 1
- WeChat Mini Program 30 Customizing Templates and Obtaining User Login Credentials
猜你喜欢

LOG4J 学习

刘畊宏男孩女孩看过来!运动数据分析挖掘!(附全套代码和数据集)

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

PEG-siRNA-PCL|siRNA-PEG-LHRH|MPEG-siRNA 甲氧基聚乙二醇修饰核酸

ALBERT:A Lite BERT for Self-supervised Learning of Language Representations

RedisJson 横空出世!

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

Analysis of Crypto in Pi 2

Cooler Navigation helps you shop easily in shopping malls without confusion

MySQL数据查询 - 简单查询
随机推荐
七个易犯的 IT 管理错误—以及如何避免
4. Implementation Guide for GET_ENTITYSET Method of SAP ABAP OData Service Data Provider Class
用对象字面量或Map替代Switch/if语句
全景教程丨VR全景拍摄如何拍摄日出和日落的场景?
OneNote 教程,如何在 OneNote 中做笔记?
940. 不同的子序列 II
Samba server configuration (when a server is required)
磁性层状双金属氢氧化物和酶-DNA复合物|聚乙烯亚胺-DNA复合物(PEI/DNA)|作用机理
PEG-siRNA-PCL|siRNA-PEG-LHRH|MPEG-siRNA 甲氧基聚乙二醇修饰核酸
About the choice of x86, x64, x86_64, ARM 64, ARM 32 when installing software
240. 搜索二维矩阵 II
MySQL - 设计游戏用户信息表
赶紧进来!!!带你认识C语言基本数据类型
conda虚拟环境 | install 与 list 问题
模型推理模板
The younger brother asked: Is the work of a programmer a day’s work of code?
Durable rules (persistent rules engine) learning notes
What are the software development modes (software engineering development mode)
Sasser virus source code (ransomware source code)
Where is Naive Bayes "naive"?