Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How do I get Python OpenCV BRISQUE score to match OpenCVSharp BRISQUE score

$
0
0

My goal is to get the BRISQUE score from OpenCVSharp to match the BRISQUE score from Python OpenCV BRISQUE for the same image. The problem is the two platforms take different and incompatible format inputs for the model and range files, and I haven't been able to figure out how to convert one to the other. OR where the Python data originated, so I can obtain it in the format compatible with OpenCVSharp (yml). Can anyone point me in the right direction?

More details:

In Python, the OpenCV library takes a "model" and "norm" file, supplied with the OpenCV package and named "svm.txt" and "normalize.pickle" respectively. These are specified in opencv-env2\Lib\site-packages\brisque\brisque.py. The files are stored in *opencv-env2\Lib\site-packages\brisque\models*.

For OpenCVSharp I'm using the model and range files, in yml format, found here. These are specified in the C# call to QualityBRISQUE.Compute()

The Python and OpenCVSharp model files are clear text, and while the format between them is very different, they both appear to contain the same type of data, and the numerical values are clearly different. So I need to somehow convert the Python version to match the yml format used by OpenCVSharp.

For the range file required by OpenCVSharp; I'm guessing the normalize.pickle file must be the corresponding file on the Python side, but it's some sort of binary format, vs. the text format yml range file used by OpenCVSharp, so I have no idea what to do with that one.

I'm new to OpenCV, and any information or nudge in the right direction would be greatly appreciated!


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>