dilevin / computer-graphics-raster-images

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

Is there anyway to make sure our output is correct other than visually comparing it with the sample output. #26

Open cuilantao opened 4 years ago

songfeil commented 4 years ago

I don't know any other way. Maybe construct some simpler test images will help?

cuilantao commented 4 years ago

I tried to compare the sample png file with the ppm file using openCV library, but it doesn't seem to work

invoqwer commented 4 years ago

I'm personally using imagemagick.

Here's an example of the compare command: compare -verbose -metric MAE images/rgb.png build/rgb.ppm null: 2>&1 Here, I use the MAE (mean absolute error) to measure the difference between the source image and my output image.

output

You'll see a pairwise comparison (pixel by pixel) of distortion per channel. If it's zero for each channel, you're probably good. If it's some non-zero value, there's some amount of discrepancy, possibly significant. There are lots other metrics you can use to compare image similarity besides MAE.