Analyze 10-bit RAW with Photoshop + Matlab

1. Photoshop processing of RAW

Run Photoshop and open the RAW image. Fill in the basic image information in the pop-up options window:

Width, length: Sensor length and width;

Number of channels: 1 ;

Bit depth (Depth) : 16Bits ;

Byte order: IBM PC .

Note: If the file suffix is ​​RAW10 , directly change it to RAW .

 

 

 

 

 

 

 

 

 

 

After clicking OK, it should normally look like a completely black image, don't panic.

Execute filter - other - custom:

Fill in 64 for the center of the filter, and 0 for the rest . ( reason: 2^10 * 64 = 2^16)

After clicking OK, you get the correct 16-bit Bayer RAW image. 

Save the image:

It is recommended to save in TIF/TIFF format for many reasons: support for multiple color modes (LAB, CMYK), 48bit, multiple compression (LZW, ZIP, JPEG, etc.), in short, TIF has many advantages, it is worth writing a special article, Wait until you are free.

Save Options: Do not add ICC Profile , uncheck ICC Profile.

TIFF options:

It is recommended not to compress , or choose LZW (lossless), choose ZIP carefully, other image software may not be able to parse.

Pixel order: Interleaved .

Byte order: IBM PC .

 

 

 

 

 

 

 

 

 

 

 

 

2. Matlab Demosaic

Demosaic is interpolation, which interpolates the single-channel data of the Bayer Pattern into a color image with three RGB channels. The code in Matlab is as follows:

imBayer = imread('FilePath\FileName.tif');
imRGB = demosaic(imBayer,'grbg');
imwrite(imRGB,'FilePath\FileName.tif');
figure,imshow(imRGB);

Notice! In the above code, replace FilePath and FileName with your own!

At this point, the analysis is all completed, and the 12-bit RAW processing is roughly the same. Take a look at how the image changes:

Read the RAW image directly, it is all black at a glance

 

 

 

 

 

 

What it looks like after executing the x64 filter

 

 

 

 

 

Figure after Demosaic

 

 

 

 

 

Original hand-beating, please indicate the source for reprinting! CopyRight@ColorBeans

The END

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324458620&siteId=291194637