cruxopen / openISP

Image Signal Processor
MIT License
1.09k stars 397 forks source link

why to do AWB before CFA #1

Closed gonevain closed 4 years ago

gonevain commented 4 years ago

I'm wondering that why most of courses suggest us to do AWB before CFA. In RAW space, the image is a grayscale image because RGB channels are derived from CFA algorithm. Could you please tell me how to understand this step correctly?

bezoldbrucke commented 4 years ago

For most advanced demoisaic algorithms, they try to interpolate the missing colors without introducing artifacts such as false color, zipper and moire. Without AWB, the raw is usually very green, making it difficult to do any chroma suppression. but if u r using bilinear or some simple demosaic methods, it really doesn't matter whether doing AWB before or after the demosaic.

cruxopen commented 4 years ago

I'm wondering that why most of courses suggest us to do AWB before CFA. In RAW space, the image is a grayscale image because RGB channels are derived from CFA algorithm. Could you please tell me how to understand this step correctly?

AWB could be done on either RGB domain or Bayer domain, but most of AWB done on Bayer domain. For RAW image, it is not a grayscale image even it has only one channel for each pixels. Every pixel has its own color presentation R or G or B. Doing AWB before CFA is to avoid introducing structural noise. CFA indeed modifies the original R/G/B values by linear or nonlinear interpolation, which creates an unresolved issue for AWB.

XiaoyuShi97 commented 3 years ago

@cruxopen Hi, could you make it more clear what you mean by introducing structural noise?

cruxopen commented 3 years ago

@cruxopen Hi, could you make it more clear what you mean by introducing structural noise?

I'm not sure how other people called the noise. For my understanding, structural noise exists in the nature and caused by the functional component (electronic or optical) in the imaging system. It is also called low rank noise (Refer to: https://apps.dtic.mil/dtic/tr/fulltext/u2/a231396.pdf). CFA is a functional module to recover the color space from Bayer to RGB, which inevitably performs linear or non linear operation on the original color space. This process regarded as one kind of adding noise to original image. Usually we don't that much care about this noise.