dcharata / StyLit

An implementation of StyLit for CSCI 2240.
34 stars 7 forks source link

CPU Downscaling #19

Closed dcharatan closed 4 years ago

dcharatan commented 4 years ago

Implemented CPU downscaling. I modified the downscaling and added the following tests:

TestDownscaler: Runs simple tests with a series of 4x4 int-based images. TestDownscalerWithImage: Downscales the test_cit image in the folder of examples and confirms that the average value stays the same after downscaling.

Note: Both tests are templated so that they can be used with any implementation of Downscaler.

vikasTmz commented 4 years ago

The tests compiled and ran successfully on my PC.

I'm sure there's an xkcd joke about the overuse of templates but lets ignore that :p.

I compared the result with scipy's bilinear downscale scipy.misc.imresize(img, size, interp='bilinear', mode=None) and below is their SSIM:

png_test

3_ssim

I think the diff. is small enough to ignore.