Dormidont Posted May 5, 2006 Report Share Posted May 5, 2006 I have to convert RGB pixel intensity to its grayscale intensit. Is it possible to convert it using LV functions? Quote Link to comment
Rolf Kalbermatter Posted May 9, 2006 Report Share Posted May 9, 2006 I have to convert RGB pixel intensity to its grayscale intensit. Is it possible to convert it using LV functions? The most simple solution is to simply add the R, G, and B parts together and divide it by 3. This has however likely the effect of not exactly giving the result you would expect since the human eye sensitivity is different for the different colors. So you would have to weight the different colors accordingly before adding them. I think you will end up with weighting factors around 0.8 .. 1.3 for the different colors, but I haven't the exact information ready here. Looking on internet about color to grayscale conversion should give you the details easily and you may find that there are actually different weighting factors depending on your intended application. Rolf Kalbermatter Quote Link to comment
Yuri Posted May 9, 2006 Report Share Posted May 9, 2006 I have to convert RGB pixel intensity to its grayscale intensit. Is it possible to convert it using LV functions? try it (вроде работает ) Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 9, 2006 Report Share Posted May 9, 2006 try it (вроде работает ) I do not know how "correct" my method is but I'll share it for the sake of conversation. I deal with the three color components like the like they are vectors in color space. To get a gey scale representation I take the square root of the sum of the three components squared and then divide by the max possible vector length (sqrt [ 3 X 255^2]). the result of that value becomes the new R, G, and B values. Ben Quote Link to comment
Yuri Posted May 10, 2006 Report Share Posted May 10, 2006 I do not know how "correct" my method is but I'll share it for the sake of conversation.I deal with the three color components like the like they are vectors in color space. To get a gey scale representation I take the square root of the sum of the three components squared and then divide by the max possible vector length (sqrt [ 3 X 255^2]). the result of that value becomes the new R, G, and B values. Ben Grey shade GREY it RGB with components (GREY, GREY, GREY). Therefore the algorithm (formula) for three numbers (R, G, B) and GREY is important. Frequently use (processing of digitalimaging) formulas (http://neuroface.narod.ru/files/mahfoudh_autoref.pdf) (1) grey=0.3*R+0.59*G+0.11*B Or (2) grey = (R+G+B)/3 (if R, G, B, GREY = [0,1]) Results are lower. 0-initial picture 1-calculation under the formula (1) 2-calculation under the formula (2) (since I lazy my example uses interpolation from labview above ) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.