{"id":50646429,"url":"https://github.com/SMARTLAGOON/SMLG_CPR","last_synced_at":"2026-06-24T09:01:14.754Z","repository":{"id":87294808,"uuid":"536543428","full_name":"SMARTLAGOON/SMLG_CPR","owner":"SMARTLAGOON","description":"This repository presents the Colour Pattern Regression (CPR) algorithm QGIS3 plugin. The code determines the relationship between aerial images and raster maps according to the decomposition into RGB spaces of the aerial images and the calculation of a linear regression with the raster map using three coefficients - one for each RGB space.","archived":false,"fork":false,"pushed_at":"2025-03-03T11:03:32.000Z","size":4293,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T01:07:14.583Z","etag":null,"topics":["environmental-monitoring","gdal-python","interpolation-methods","python","qgis3-plugin","remotesensing","spatial-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SMARTLAGOON.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-14T11:20:06.000Z","updated_at":"2025-03-03T11:03:36.000Z","dependencies_parsed_at":"2025-03-03T12:32:56.386Z","dependency_job_id":null,"html_url":"https://github.com/SMARTLAGOON/SMLG_CPR","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"318c53b15d106f47c1df015e98961f8fb1a4229d"},"previous_names":["smartlagoon/smlg_cpr"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/SMARTLAGOON/SMLG_CPR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMARTLAGOON%2FSMLG_CPR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMARTLAGOON%2FSMLG_CPR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMARTLAGOON%2FSMLG_CPR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMARTLAGOON%2FSMLG_CPR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMARTLAGOON","download_url":"https://codeload.github.com/SMARTLAGOON/SMLG_CPR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMARTLAGOON%2FSMLG_CPR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34724743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["environmental-monitoring","gdal-python","interpolation-methods","python","qgis3-plugin","remotesensing","spatial-analysis"],"created_at":"2026-06-07T13:00:29.605Z","updated_at":"2026-06-24T09:01:14.748Z","avatar_url":"https://github.com/SMARTLAGOON.png","language":"Python","funding_links":[],"categories":["Medio Ambiente y Mar Menor"],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/536543428.svg)](https://doi.org/10.5281/zenodo.14959849)\n\n# CPR Algorithm \u003cimg src=\"src/readme/logo.png\" align=\"right\" width=\"200\" /\u003e\n\n### Description\n\nThe Colour Pattern Regression\n(CPR) algorithm complement for QGIS is presented for determining and\nquantifying the relationship between aerial images and raster maps. Aerial\nimages can be readily decomposed into their standard RGB spaces that assign\nnumerical values to their colours. According to them, a linear regression can\nbe established to correlate raster values with the colour patterns, and if the\nmodel performance is considered satisfactory, the final result will provide a\nraster interpolation with finest resolution according to colour nuances within\nthe aerial image. The CPR Algorithm allow both, the calculation of the\nregression coefficient and the evaluation of the goodness of fit of the model.\nThe use of the CPR-QGIS plugin could enable the study of the relationships of\naerial images and earth surface products – e.g. soil moisture content,\nlandcover, vegetation and forests, soils, urban heat islands – or marine\nproducts – e.g. chlorophyll, total suspended solids. The tool is open source\nand will be readily adapted with additional features and improved general\nperformance ratings thresholds for the physical problems to be solved.The Colour Pattern Regression (CPR) algorithm complement for QGIS is\npresented for determining and quantifying the relationship between aerial\nimages and raster maps. Aerial images can be readily decomposed into their\nstandard RGB spaces that assign numerical values to their colours. According\nto them, a linear regression can be established to correlate raster values\nwith the colour patterns, and if the model performance is considered satisfactory,\nthe final result will provide a raster interpolation with finest resolution\naccording to colour nuances within the aerial image. The CPR Algorithm\nallow both, the calculation of the regression coefficient and the evaluation\nof the goodness of fit of the model. The use of the CPR-QGIS complement\ncould enable the study of the relationships of aerial images and earth surface\nproducts – e.g. soil moisture content, landcover, vegetation and forests,\nsoils, urban heat islands – or marine products – e.g. chlorophyll, total suspended\nsolids. The tool is open source and will be readily adapted with\nadditional features and improved general performance ratings thresholds for\nthe physical problems to be solved.\n\n## Installation\n\n* Download the last version available\n  \"last_version.zip\".\n* Open QGIS v3.x.\n* Select Plugins\\Manage and Install Plugins\n* Select the option Install from ZIP.\n* Browse the route to the “last_version.zip” file\n  and press the install button.\n\n## How does it work\n\n### Model Inputs\n\n* Area of interest (shp): Defines the outer\n  interpolation polygon with a shape file.\n* Area for calibration (shp): Defines a sub-polygon with a\n  shape file for calculation of the initial values.\n* Aerial image input: A three-banded (RGB) raster\n  map with the aerial image of the study area.\n* Raster data input: A raster map with the\n  numerical values that can be correlated with colours.\n* Results folder: Defines the calculations route.\n\n### Model Calculations\n\n* Variability RGB: Defines the variability around\n  the initial RGB values for the high-resolution loop calculation.\n* Initial values loop variability: Number of\n  iterations that will be carried out for the calculation of the initial RGB\n  values in the calibration area.\n* High resolution loop variability: Number of\n  iterations that will be carried out for the calculation of the final RGB\n  values in the interest area.\n* Performance statistics thresholds: Defines the\n  thresholds for *Very good*, *Good*, *Satisfactory* and *Unsatisfactory*\n  performance for the statistics NNSE, KGE and PBIAS.\n\n### Model outputs\n\n* RGB Coefficient: Present the calculated RGB parameters\n  of the linear regression.\n* Statistics performance (%Area): Presents the\n  percentage of area from every model performance type defined in the\n  Calculations section for the statistics NNSE, KGE and PBIAS.\n\n## Case study\n\nThe information provided\nincludes the necessary information to reproduce an example of the correlation\nbetween the aerial image from Sentinel 2 and a raster map of Total Suspended\nMatter (TSM) from Sentinel 3.\n\nIn this case, Mar Menor lagoon\narea was selected as part of the H2020 SMARTLAGOON project (GA 101017861).\n\n## Add your files to CPR\n\n- [ ] [Create](https://docs.github.com/en/repositories/working-with-files/managing-files/creating-new-files) or upload files\n- [ ] [Add files using the command line](https://docs.github.com/en/repositories/working-with-files/managing-files/adding-a-file-to-a-repository) or push an existing Git repository with the following command:\n\n```\ncd existing_repo\ngit remote add origin https://github.com/vielca/CPR\ngit branch -M main\ngit push -uf origin main\n```\n\n## Authors\n\n- [@Pablo Blanco-Gómez](https://orcid.org/0000-0001-9465-2912)\n- [@Constancio Amurrio-García](https://www.vielca.com/)\n- [@Jose Luis Jimenez Garcia](https://orcid.org/0000-0001-6619-9057)\n- [@Jose M. Cecilia](https://orcid.org/0000-0001-5648-214X)\n\n### Acknowledgments\n\nThis work has been supported by the European Union’s Horizon 2020 research\nand innovation programme under grant agreement No 101017861 and by the Ramon y\nCajal Grant RYC2018-025580-I, funded by MCIN/AEI/ 10.13039/501100011033 and\n“ERDF A way of making Europe” and FSE invest in your future.\n\nMoreover, authors acknowledge Vicente M. Candela Canales for supporting the\nR\u0026D investment and programs within the Vielca companies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSMARTLAGOON%2FSMLG_CPR","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSMARTLAGOON%2FSMLG_CPR","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSMARTLAGOON%2FSMLG_CPR/lists"}