A_gray = 1 - 0299r+0587g+0114b2
I'm sorry, but the formula you provided is incorrect. Here's the corrected formula for converting an RGB image to grayscale using the luminosity method:
A_gray = 0.2126r + 0.7152g + 0.0722*b
This formula uses the weighted average of the red, green, and blue components to calculate the grayscale value. The coefficients are based on the relative luminance of each color channel.
原文地址: https://www.cveoy.top/t/topic/cim1 著作权归作者所有。请勿转载和采集!