iamaaditya / image-compression-cnn

Semantic JPEG image compression using deep convolutional neural network (CNN)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to calculate PSNR of salient regions

eefresher opened this issue · comments

hello!,sorry to disturb you !
I download your code ,but it cant not calculate PSNR of salient regions. which is very import metric.
And this metric demonstrates that this compression method is indeed able to
preserve visual quality in targeted region.
Would you please tell me how to do that ? I would be grateful to you. It does trouble me a lot.

I have set a threshould to divide the picture into two parts(ROI and background), then create two pictures: 1)ROI the same as semantic compressed pic, while background region replaced by pixels of the standard JPEG pic
2)background the same as semantic compressed pic, while ROI region replaced by pixels of the standard JPEG pic
pic1 is compared with the standard JPEG pic to measure the quality of ROI region
pic2 is compared with the standard JPEG pic to mearure the quality of background
since we pay more attention to ROI region compared with background, we can give a higher weight for the PSNR value of ROI region while measuring the quality of the whole picture.
This does work for me, and I hope it will help you too.

my email address is: 3292128060@qq.com.

I am very grateful for your patience reply. The experimental method you designed is very good. Thank you for your thoughts. wish you a happy life.