dilevin / computer-graphics-raster-images

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

Confusion about the process of bayer mosaic #54

Open junior-stack opened 11 months ago

junior-stack commented 11 months ago

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 of i = 0.2126r + 0.7152g+0.0722b to calculate one bayer value bayer[i]? I am really confused with the description

nicholas3d2 commented 11 months 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!

dilevin commented 11 months ago

this is correct ^^^