Skip to main content

edge_assessment

standard-readme compliant

An assessment tool for evaluating the quality of object edges within an input map.

Table of Contents

Background

An accurate delineation of edge is critical for object-based image analysis on land resources such as agricultural field objects and building objects, and change detection particularly for climate-induced land change such as snow melting and treeline shifts. The traditional F1-score has been widely used for assessing map quality, which, however, often fails to provide information on object boundary quality. To address this problem, we developed a new evaluation index to take account of both thematic and edge accuracy.

Install

Install AssessEdge using pip:

pip install AssessEdge

Use requirements.txt to install the required packages.

pip install -r requirements.txt

Usage

The two main functions are eval_edge and plot_results in edge_buffer.py

eval_edge(testing_field, reference_field, step, min_width, initial_max_width): input two variables(testing_field & reference_field), the testing_field represents the result of classification, the reference_field represents the real reference object field. The pixel values of target objects should be processed as 1, and pixel values of background should be 0 or no data. The function will return a dictionary include commission error, omission error, edge f1 score, middle point, etc. The step defaults as 3, the initial_max_width defaults as 0, and the min_width defaults as 3.

plot_results: show the testing_field and reference_field data fit curves and their data points.

Users can type the following codes to use these two functions

from AssessEdge import eval_edge, plot_results
from AssessEdge import rasterio_loaddata

def main(map_path, reference_path):
    map_path = "/images/testing_field.tif"
    reference_path = "/images/reference_field.tif"
    map_array = rasterio_loaddata(map_path)
    reference_array = rasterio_loaddata(reference_path)
    result = eval_edge(map_array, reference_array)
    plot_results(result)

if __name__ == "__main__":
    main()

Test

Testing images have been placed in the images folder. The test procedure is assess_image.py in test folder. To test it

python assess_image.py --map_path map_path --reference_path reference_path

It will show the test result as following

Contributors

Yingfan Zhang (zhangyingfanuk@163.com), Su Ye

License

Apache License

Metadata

Release files for AssessEdge 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AssessEdge 2.0
File Size Uploaded
assessedge-2.0.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for AssessEdge 2.0
File Interpreter ABI Platform
AssessEdge-2.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / assessedge-2.0.tar.gz

Download URL assessedge-2.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5436e08da2ee0fb8d6145589e34835140a725e556190eaa6fde419a36106fce1
BLAKE2b-256 checksum
How to use checksums
c48207019d09780e926640ec9854ab31a198d441128fcfc600024d831fa81389
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / AssessEdge-2.0-py3-none-any.whl

Download URL AssessEdge-2.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95b5c10c1e831b99dc50017c676b57af666e1cb8be3bcfc39a197e1af6cb448b
BLAKE2b-256 checksum
How to use checksums
06d85ec9d1215d4e004938649c0166f347156131a127242fda93bb10153c020c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

2.0 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page