Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%
- %% Swaps the Red and Blue channels of an A7 III raw image
- %%
- function swapRedBlueChannels()
- cfaPatternStr = "RGGB";
- %% read raw data generated by LibRaw's unprocessed_raw.exe
- imgDataIn = imread("in.ARW.pgm");
- imgDataIn = resize(imgDataIn, 4024, 6024); % A73 visible dimensions
- %% split the raw data into its separate RGGB channels
- [r, g1, g2, b] = rawBayerToChannels(cfaPatternStr, imgDataIn);
- %% for fun, swap the R and B channels
- imgDataOut = channelsToRawBayer(cfaPatternStr, b, g1, g2, r);
- %% write a PGM with the new data
- imwrite(imgDataOut, "out.pgm");
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement