Home > Net >  16 gray image grey value
16 gray image grey value

Time:10-19

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)

CodePudding user response:

reference 5 floor xuzuning reply:
means that your image is PixelFormat 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 (52 bytes) directly read


Thank you very much! My picture is very strange, review images attribute bit depth is 16, but I see Format32bppArgb PixelFormat are in c #, do you know what's going on?

CodePudding user response:

Put your photos on the cloud, let me see

If you open the picture with GDI, PixelFormat is change

CodePudding user response:

refer to 7th floor xuzuning response:
put your photos on the cloud, let me see

If you open the picture with GDI, PixelFormat is become


Link: https://pan.baidu.com/s/1qZCWC2o password: 9 eyg

CodePudding user response:

reference 5 floor xuzuning reply:
means that your image is PixelFormat 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 (52 bytes) directly read


Hello, I use vtkvolume16reader read 16 grayscale mismatch, use what you said "skip 52 bytes of the first" method, image dislocation was greatly improved, but there is still a pixel level of dislocation in small increments, not perfect, could you tell me why the head is 52 bytes?

CodePudding user response:

references 9 f SillyBurden response:
Quote: refer to fifth floor xuzuning 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 (52 bytes) directly read


Hello, I use vtkvolume16reader read 16 grayscale mismatch, use what you said "skip 52 bytes of the first" method, image dislocation was greatly improved, but there is still a pixel level of dislocation in small increments, not perfect, could you tell me why the head is 52 bytes?

https://blog.csdn.net/flyfight88/article/details/8504326 have a look at this
  •  Tags:  
  • C#
  • Related