multisimil


Namemultisimil JSON
Version 0.0.1.1 PyPI version JSON
download
home_pagehttps://github.com/pratik-tan10/multisimil
SummaryA python package to find similarity between two images at multiple scales.
upload_time2023-04-18 03:11:00
maintainer
docs_urlNone
authorPratik Dhungana
requires_python
license
keywords python multisimil land use validation categorical similarity multi-scale similarity
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Multisimil
This is a Python package to calculate similarity between two classified images at multiple scales.

The main objective of this package is to enable comparision of actual and predicted land use maps at multiple scales so a more relaxed assesment of accuracy can be done which is not possible with pixel to pixel comarision. It allows for the simulated map to miss the exact location of particular land use by a few pixels (specified by the user), and still will be considered a good prediction.

The module can be installed by:
```Python
! pip install multisimil
```
It is important to understand that in case of pixel to pixel comarision, even if when the entire map is shifted by 1 pixel, it will drastically reduce the accuracy. However, with comparing the frequecy of occurance of different land use classes in a neighborhood, a better comparision can be made.

```Python
import multisimil
from osgeo import gdal

image1 = "path/to/image1.tif"
image2 = "path/to/image2.tif"

rband1 = gdal.Open(image1).GetRasterBand(1)
rband2 = gdal.Open(image2).GetRasterBand(1)

array1 = rband1.ReadAsArray()
array2 = rbdand2.ReadAsArray()

nodata1 = rband1.GetNoDataValue()
nodata2 = rband2.GetNoDataValue()

array1[array1 == nodata1] = 0
array2[array2 == nodata2] = 0

# TO use 9*9 neighborhood, set f = 9
similarity = multisimil.calculate_similarity(array1, array2, f = 9)

```

Similarly, we can calculate similarity for multiple neighborhood filter sizes.

```Python
# This will calculate similarity for neighborhood sizes from 1*1 to 91*91
find_multiresolution_similarity(array1, array2, min_size = 1, max_size = 100, steps = 10)
```
More features to come soon.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pratik-tan10/multisimil",
    "name": "multisimil",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,multisimil,land use validation,categorical similarity,multi-scale similarity",
    "author": "Pratik Dhungana",
    "author_email": "pdhungana@crimson.ua.edu",
    "download_url": "https://files.pythonhosted.org/packages/20/61/22b55ce5df493e0bda20739d2fbfa487f2b4b4596fab737b3eafefeb8726/multisimil-0.0.1.1.tar.gz",
    "platform": null,
    "description": "## Multisimil\r\nThis is a Python package to calculate similarity between two classified images at multiple scales.\r\n\r\nThe main objective of this package is to enable comparision of actual and predicted land use maps at multiple scales so a more relaxed assesment of accuracy can be done which is not possible with pixel to pixel comarision. It allows for the simulated map to miss the exact location of particular land use by a few pixels (specified by the user), and still will be considered a good prediction.\r\n\r\nThe module can be installed by:\r\n```Python\r\n! pip install multisimil\r\n```\r\nIt is important to understand that in case of pixel to pixel comarision, even if when the entire map is shifted by 1 pixel, it will drastically reduce the accuracy. However, with comparing the frequecy of occurance of different land use classes in a neighborhood, a better comparision can be made.\r\n\r\n```Python\r\nimport multisimil\r\nfrom osgeo import gdal\r\n\r\nimage1 = \"path/to/image1.tif\"\r\nimage2 = \"path/to/image2.tif\"\r\n\r\nrband1 = gdal.Open(image1).GetRasterBand(1)\r\nrband2 = gdal.Open(image2).GetRasterBand(1)\r\n\r\narray1 = rband1.ReadAsArray()\r\narray2 = rbdand2.ReadAsArray()\r\n\r\nnodata1 = rband1.GetNoDataValue()\r\nnodata2 = rband2.GetNoDataValue()\r\n\r\narray1[array1 == nodata1] = 0\r\narray2[array2 == nodata2] = 0\r\n\r\n# TO use 9*9 neighborhood, set f = 9\r\nsimilarity = multisimil.calculate_similarity(array1, array2, f = 9)\r\n\r\n```\r\n\r\nSimilarly, we can calculate similarity for multiple neighborhood filter sizes.\r\n\r\n```Python\r\n# This will calculate similarity for neighborhood sizes from 1*1 to 91*91\r\nfind_multiresolution_similarity(array1, array2, min_size = 1, max_size = 100, steps = 10)\r\n```\r\nMore features to come soon.\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A python package to find similarity between two images at multiple scales.",
    "version": "0.0.1.1",
    "split_keywords": [
        "python",
        "multisimil",
        "land use validation",
        "categorical similarity",
        "multi-scale similarity"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "206122b55ce5df493e0bda20739d2fbfa487f2b4b4596fab737b3eafefeb8726",
                "md5": "80655fad253d8596629e3491e2402f7b",
                "sha256": "768c4af4406dbb57dea2d6266e11da1ddf34edbe97bcda81da76efb572cf720a"
            },
            "downloads": -1,
            "filename": "multisimil-0.0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "80655fad253d8596629e3491e2402f7b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4538,
            "upload_time": "2023-04-18T03:11:00",
            "upload_time_iso_8601": "2023-04-18T03:11:00.663483Z",
            "url": "https://files.pythonhosted.org/packages/20/61/22b55ce5df493e0bda20739d2fbfa487f2b4b4596fab737b3eafefeb8726/multisimil-0.0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-18 03:11:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pratik-tan10",
    "github_project": "multisimil",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "multisimil"
}
        
Elapsed time: 0.06497s