# Blind/Referenceless Image Spatial Quality Evaluator (BRISQUE)
BRISQUE is a no-reference image quality score.
A good place to know how BRISQUE works : [LearnOpenCV](https://learnopencv.com/image-quality-assessment-brisque/)
## Installation
```bash
# You will need to specify which version of OpenCV you intend to use with BRISQUE:
# * opencv-python
# * opencv-python-headless
# * opencv-contrib-python
# * opencv-contrib-python-headless
# You can do this with `pip install brisque[<YOUR CHOSEN VERSION HERE>]`, e.g.
pip install [opencv-python-headless]
```
## Usage
1. Trying to perform Image Quality Assessment on **local images**
```python
from brisque.brisque import BRISQUE
obj = BRISQUE(url=False)
obj.score("<Ndarray of the Image>")
```
2. Trying to perform Image Quality Assessment on **web images**
```python
from brisque.brisque import BRISQUE
obj = BRISQUE(url=True)
obj.score("<URL for the Image>")
```
### Example
#### Local Image
- Input
```python
from brisque.brisque import BRISQUE
import numpy as np
from PIL import Image
img_path = "brisque/tests/sample-image.jpg"
img = Image.open(img_path)
ndarray = np.asarray(img)
obj = BRISQUE(url=False)
obj.score(img=ndarray)
```
- Output
```
34.84883848208594
```
#### URL
- Input
```python
from brisque.brisque import BRISQUE
URL = "https://www.mathworks.com/help/examples/images/win64/CalculateBRISQUEScoreUsingCustomFeatureModelExample_01.png"
obj = BRISQUE(url=True)
obj.score(URL)
```
- Output
```
71.73427549219988
```
Raw data
{
"_id": null,
"home_page": "https://github.com/rehanguha/brisque",
"name": "brisque-opencv",
"maintainer": null,
"docs_url": null,
"requires_python": ">=2.7",
"maintainer_email": null,
"keywords": "quality, svm, image, maths",
"author": "Rehan Guha",
"author_email": "rehanguha29@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/87/f0/32877e79035931f0a69d92bec3a73e617f25fd40bdf4ab2b237f7d2e3069/brisque_opencv-0.0.17.tar.gz",
"platform": null,
"description": "# Blind/Referenceless Image Spatial Quality Evaluator (BRISQUE)\n\nBRISQUE is a no-reference image quality score.\n\nA good place to know how BRISQUE works : [LearnOpenCV](https://learnopencv.com/image-quality-assessment-brisque/)\n\n\n## Installation\n\n```bash\n# You will need to specify which version of OpenCV you intend to use with BRISQUE:\n# * opencv-python\n# * opencv-python-headless\n# * opencv-contrib-python\n# * opencv-contrib-python-headless\n# You can do this with `pip install brisque[<YOUR CHOSEN VERSION HERE>]`, e.g.\npip install [opencv-python-headless]\n```\n\n## Usage\n\n1. Trying to perform Image Quality Assessment on **local images**\n```python\nfrom brisque.brisque import BRISQUE\n\nobj = BRISQUE(url=False)\nobj.score(\"<Ndarray of the Image>\")\n```\n\n2. Trying to perform Image Quality Assessment on **web images**\n```python\nfrom brisque.brisque import BRISQUE\n\nobj = BRISQUE(url=True)\nobj.score(\"<URL for the Image>\")\n```\n\n### Example\n\n#### Local Image\n\n- Input\n```python\nfrom brisque.brisque import BRISQUE\nimport numpy as np\nfrom PIL import Image\n\nimg_path = \"brisque/tests/sample-image.jpg\"\nimg = Image.open(img_path)\nndarray = np.asarray(img)\n\nobj = BRISQUE(url=False)\nobj.score(img=ndarray)\n```\n- Output\n```\n34.84883848208594\n```\n\n#### URL\n\n- Input\n```python\nfrom brisque.brisque import BRISQUE\n\nURL = \"https://www.mathworks.com/help/examples/images/win64/CalculateBRISQUEScoreUsingCustomFeatureModelExample_01.png\"\n\nobj = BRISQUE(url=True)\nobj.score(URL)\n```\n- Output\n```\n71.73427549219988\n```\n",
"bugtrack_url": null,
"license": "mit",
"summary": "Image Quality",
"version": "0.0.17",
"project_urls": {
"Homepage": "https://github.com/rehanguha/brisque"
},
"split_keywords": [
"quality",
" svm",
" image",
" maths"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3b53ee13a3086ab4e2e8766bf5016a4e5ece902f085ca06569d476d5c512cbb7",
"md5": "89fc26e96dec225a5905b378479118c7",
"sha256": "cc18154f34df06d223773a116ab0d7cd838ebbba5d6d90994c710ef6e9f0fe72"
},
"downloads": -1,
"filename": "brisque_opencv-0.0.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "89fc26e96dec225a5905b378479118c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=2.7",
"size": 140492,
"upload_time": "2024-07-26T14:37:44",
"upload_time_iso_8601": "2024-07-26T14:37:44.456544Z",
"url": "https://files.pythonhosted.org/packages/3b/53/ee13a3086ab4e2e8766bf5016a4e5ece902f085ca06569d476d5c512cbb7/brisque_opencv-0.0.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "87f032877e79035931f0a69d92bec3a73e617f25fd40bdf4ab2b237f7d2e3069",
"md5": "e02efc8707e6bc8339143fe218b5ee8b",
"sha256": "2fc69f9b46179edaffe4c8f611ff7e38b1f12619570309e24b46d606afbce4e0"
},
"downloads": -1,
"filename": "brisque_opencv-0.0.17.tar.gz",
"has_sig": false,
"md5_digest": "e02efc8707e6bc8339143fe218b5ee8b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 141370,
"upload_time": "2024-07-26T14:37:46",
"upload_time_iso_8601": "2024-07-26T14:37:46.039396Z",
"url": "https://files.pythonhosted.org/packages/87/f0/32877e79035931f0a69d92bec3a73e617f25fd40bdf4ab2b237f7d2e3069/brisque_opencv-0.0.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-26 14:37:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rehanguha",
"github_project": "brisque",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "contourpy",
"specs": [
[
"==",
"1.2.1"
]
]
},
{
"name": "cycler",
"specs": [
[
"==",
"0.12.1"
]
]
},
{
"name": "exceptiongroup",
"specs": [
[
"==",
"1.2.1"
]
]
},
{
"name": "fonttools",
"specs": [
[
"==",
"4.51.0"
]
]
},
{
"name": "imageio",
"specs": [
[
"==",
"2.34.1"
]
]
},
{
"name": "importlib_resources",
"specs": [
[
"==",
"6.4.0"
]
]
},
{
"name": "iniconfig",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "kiwisolver",
"specs": [
[
"==",
"1.4.5"
]
]
},
{
"name": "lazy_loader",
"specs": [
[
"==",
"0.4"
]
]
},
{
"name": "libsvm-official",
"specs": [
[
"==",
"3.32.0"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.8.4"
]
]
},
{
"name": "networkx",
"specs": [
[
"==",
"3.2.1"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"1.26.4"
]
]
},
{
"name": "opencv-python",
"specs": [
[
"==",
"4.9.0.80"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.0"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"10.3.0"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "pyparsing",
"specs": [
[
"==",
"3.1.2"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"8.2.0"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "PyWavelets",
"specs": [
[
"==",
"1.6.0"
]
]
},
{
"name": "scikit-image",
"specs": [
[
"==",
"0.22.0"
]
]
},
{
"name": "scipy",
"specs": [
[
"==",
"1.13.0"
]
]
},
{
"name": "setuptools-scm",
"specs": [
[
"==",
"8.0.4"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "tifffile",
"specs": [
[
"==",
"2024.4.24"
]
]
},
{
"name": "tomli",
"specs": [
[
"==",
"2.0.1"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.11.0"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.18.1"
]
]
}
],
"lcname": "brisque-opencv"
}