Excuse me, how to read a 16-bit image grey value of a point? In the range 0 to 65535
CodePudding user response:
Don't draw RGB is?
CodePudding user response:
Gray color image is in after converted to black and white image pixel values () is a kind of generalized formulation, conversion method depends on the field of application, generally by the weighted method of conversion, R, G, B than the average of 3:6:1, Any color is red, green, blue three primary colors, if the original spot color for RGB (R, G, B), so, we can through the following method, convert it to grayscale: 1. The floating-point algorithm: Gray=R + G + B * 0.59 * 0.11 * 0.3 2. The method of integer: Gray=59 (R + G * * 30 + B * 11)/100 3. Shift method: Gray=(R * 77 * 151 + + G * B 28) & gt;> 8; Method: 4. Average Gray=(R + G + B)/3; 5. Only take green: Gray=G; Through the above any kind of method for Gray, the original RGB (R, G, and B) the R, G, B are replaced with Gray, forming a new color RGB (Gray, Gray, Gray), and use it to replace the original RGB (R, G, B) is the Gray image,
CodePudding user response:
I use c # GetPixel () to obtain the grey value of the range is 0 ~ 255, how to obtain a 16-bit gray value? In the range 0 to 65535,
CodePudding user response:
Is not a color image gray, the existing is 16 grayscale image,
CodePudding user response:
That is to say your picture is PixelFormat. The Format16bppGrayScale format Can lock image data by BitmapData, gray data read out directly, because each pixel 16 bit (2 bytes) UINT16 Can also use the file stream mode jump too directly read (52 bytes)