perspective-correction | Automatic perspective correction on photos of A4 | Computer Vision library
kandi X-RAY | perspective-correction Summary
kandi X-RAY | perspective-correction Summary
Automatic perspective correction on photos of A4 papers using Canny detector and Hough transform with opencv-python.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Corrects the aspect ratio of the image .
- Main function .
- Find intersections between two lines .
- Processes an image .
- Eliminate duplicate lines .
- Reorder corners .
- Filter lines that are perpendicular to a given margin .
- Convert an image to cartesian coordinates .
- annotate intersections
- Return the distance between two lines .
perspective-correction Key Features
perspective-correction Examples and Code Snippets
Community Discussions
Trending Discussions on perspective-correction
QUESTION
I'm trying to use opencv.js to find a document in a provided image (detect edges, apply perspective transform, etc.
I've got a reasonable set of code that (occasionally) detects edges of a document and grabs the bounding box for that. However, I'm struggling to do the perspective transform steps. There are some helpers for this (not in JS) here and here.
Unfortunately I'm getting stuck on something simple. I can find the matching Mat
that has 4 edges. Displaying that shows it to be accurate. However, I have no idea how to get some simple X/Y info out of that Mat
. I thought minMaxLoc()
would be a good option, but I keep getting an error passing in my matching Mat
. Any idea why I can draw foundContour
and get bounding box info from it, but I can't call minMaxLoc
on it?
Code:
...ANSWER
Answered 2019-Mar-20 at 21:04For anyone else looking to do this in OpenCV.JS, what I commented above seems to still be accurate. The contour found can't be used with minMaxLoc
, but the X/Y data can be pulled out of data32S[]
. That should be all that's needed to do this perspective transform. Some code is below.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install perspective-correction
You can use perspective-correction 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