distance-transform | Distance transforms of sampled functions | Math library
kandi X-RAY | distance-transform Summary
kandi X-RAY | distance-transform Summary
This module provides a Python implementation of the linear-time distance transform described in:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of distance-transform
distance-transform Key Features
distance-transform Examples and Code Snippets
Community Discussions
Trending Discussions on distance-transform
QUESTION
I am trying to use distance transform to contours, but I am getting an error:
...ANSWER
Answered 2020-Apr-14 at 11:41The issue is that the output of cv2.distanceTransform
is of type np.float32
.
You need to normalize out
to range [0, 1] before showing out
.
See OpenCV documentation:
Normalize the distance image for range = {0.0, 1.0}
so we can visualize and threshold it
cv.normalize(dist, dist, 0, 1.0, cv.NORM_MINMAX)
cv.imshow('Distance Transform Image', dist)
Here is the code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install distance-transform
You can use distance-transform like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page