Open junior-stack opened 1 year ago
Hey, the way I understand it for a given pixel with an R, G, B value you only store one of those 3 into bayer[i] depending on the position of the pixel. So for the top left pixel you save the G value into bayer[top left pixel offset], then top right you save the B value into bayer[top right pixel offset], etc. Make sure you understand how to get the value of a colour given the location from the rgb vector. Hope this helps!
this is correct ^^^
After reading through the description of mosaic images, the wiki link and some past github issue post, I still don't understand what I need to do in the
simulate_bayer_mosaic
. According to the past post, for every four pixels, I need to extract the blue value from the top left pixel, the red value from the bottom right pixel and the green value from the rest of the pixels. Since it mentions "a single channel grayscale image", do I substitute those values from the 4 pixels and use the formula ofi = 0.2126r + 0.7152g+0.0722b
to calculate one bayer valuebayer[i]
? I am really confused with the description