error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'?
-
-
dear all i am doing image processing, when i would like to convert RGB to grayscale, Y = 0.3*R + 0.59*G + 0.11*B, the error occurred below: error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'? anyone help me? thanks
Li Zhiyuan
The message is descriptive enough: you're trying to assign an integer to a pointer. Please post
Y, R, G, B
declarations for further help. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
dear all i am doing image processing, when i would like to convert RGB to grayscale, Y = 0.3*R + 0.59*G + 0.11*B, the error occurred below: error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'? anyone help me? thanks
Li Zhiyuan
You are trying to convert from a pointer to integer to an integer. And the conversion is not possible. The error message was quite clear enough, don't you think ?
Cédric Moonen Software developer
Charting control [v1.3 - Updated] -
dear all i am doing image processing, when i would like to convert RGB to grayscale, Y = 0.3*R + 0.59*G + 0.11*B, the error occurred below: error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'? anyone help me? thanks
Li Zhiyuan
li zhiyuan wrote:
Y = 0.3*R + 0.59*G + 0.11*B, the error occurred below: error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'?
change to, *Y = 0.3*R + 0.59*G + 0.11*B; :) :-D
-
li zhiyuan wrote:
Y = 0.3*R + 0.59*G + 0.11*B, the error occurred below: error C2440: '=' : cannot convert from 'unsigned int' to 'unsigned int *'?
change to, *Y = 0.3*R + 0.59*G + 0.11*B; :) :-D
-
thanks friend how to convert RGB image to grayscale and let RGB value become one value, for example, [(r,g,b),(r,g,b)]to [a,b], thanks a lot, however i tried, but can't, sorry in this area i am so weak.
Li Zhiyuan
you tried something and end up with error, if you can post your code, i will try to direct.