rehanguha / brisque

Blind/Referenceless Image Spatial QUality Evaluator (BRISQUE)
https://pypi.org/project/brisque/
Apache License 2.0
55 stars 8 forks source link

[Feature] Add Support for Single Channel Images #11

Open swtb3 opened 1 year ago

swtb3 commented 1 year ago

Is your feature request related to a problem? Please describe.

Often when performing operations on images our solution will greyscale an image on importing it. In my own project I have a set of images I want to run several image metrics on. So i have already turned the images from multi-channel to single-channel. However now when I call score(image) I get an error saying the image cannot be grayscaled.

Describe the solution you'd like

The 'Score' method should check the channels of an image and grayscale it only if the channels > 1. else it should proceed without attempting to grayscale the already single channel image.

Describe alternatives you've considered

Adding fake channels to my grayscale so it appears to be multichannel

rehanguha commented 1 year ago

Hi, This is a great idea but there will be flaw in terms of the scoring. The scoring is made on multi-channel images and not with single channel images. So, the best solution is to train a model with single channel images and generate new scores.