Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个灰度图像,我想逐行读取并处理(以找到中值)我通过加载文件创建了一个 QImage。然后我使用 scanline(x) 读取该行。但是我得到了一些错误的值(希望值应该是 0-256)。Scanline() 得到我认为的 RGBA 值。如何使用此方法进行灰度。或任何其他解决方案,请
谢谢
你是什么意思错误的价值观?如果你得到 RGBA(45, 45, 45, 255),那是灰色的。如果您想要一个 0-255 的值,那么只需读取红色组件(例如)。