dilevin / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
1 stars 7 forks source link

Some clarification for the Bayer simulation #49

Open pjsmith97 opened 4 years ago

pjsmith97 commented 4 years ago

I don't quite understand the description given for the simulated bayer image task, especially when I compare it to the code.

"Simulate an image acquired from the Bayer mosaic by taking a 3-channel rgb image and creating a single channel grayscale image composed of interleaved red/green/blue channels. The output image should be the same size as the input but only one channel."

I don't understand what they're trying to describe with "interleaved red/green/blue channels". And in the code, the bayer vector is only width by height, not width by height by 3 like the rgb image. So right now it's only sounding like another grayscale image. I know it isn't going by the image given, but I'm not understanding what's happening with the pixels.

songfeil commented 4 years ago

This means you need to extract colors from three channels and then create one bayer channel using the bayer pattern. Say if we use BGGR pattern, then for the every four pixels, the top left pixel we keep the blue channel, the bottom right pixel keeps the red channel, the others keep the green channel, and we discard the other informations. So you're suppose to choose some values from the original images and make into one channel.

pjsmith97 commented 4 years ago

Okay I think I understand. Thank you for the clarification.