dilevin / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
2 stars 10 forks source link

Question about Desaturate #83

Closed yangh122 closed 2 months ago

yangh122 commented 2 months ago

Hi, I am wondering if the images under the image folder are the correct output.

When I compared my output with the desaturated image under the image folder, I noticed slight differences, particularly in the right ear region.

Then I took the pixel at coordinates (293,91) from the original image, and its RGB value was [60, 3, 7]. However, the same pixel in the desaturated image from the image folder has the value [16, 16, 16], which does not match the value I calculated using the formula.

image image

Danx1129 commented 2 months ago

I also have the same question. Screenshot 2024-09-15 at 2 20 35 AM The image on the left is provided /image/desaturated.png, while the image on the right is created by my code. As you can see, the region above the nose is greener for the provided image. However, I also tried using an online tool to desaturate the provided /image/rgb.png by 25% and received a result closer to my image compared to provided image (the region above the nose is NOT green). desat 25%

Zhecheng-Wang commented 2 months ago

Hi, we noticed that some PNG files seem corrupted or compressed. We now provide reference PPM files here. Note that you don't have to match the PPM file line by line, only matching the RGB value is fine.

yangh122 commented 2 months ago

Should we expect to have the exact same values, or is there an acceptable margin of error?

Zhecheng-Wang commented 2 months ago

The grading script allows some margin of error for most of the tasks. But some are checked for exact values (namely write_to_ppm, reflection, rotate).

yangh122 commented 2 months ago

Feel like the reference PPM file has a little bit error. For example, in the bayer.ppm data part, the line[0], position[54],[56] and line[1] position[55] value is 212 212 212. For line[0] position[55], since we are using GBRG pattern, it represents a B value. So its demosaickedG value should be (212+212+212)/3 = 212. But in demosaicked.ppm for line[0] position[166] value is 210.

Zhecheng-Wang commented 2 months ago

I haven't checked the pixel value of those pixels, but if those pixels are indeed the neighbouring pixels, I agree it should be 212. That being said, the tests are really lenient on numerical differences IMO. And I will manually check all solutions that are marked as different by tests.