canny-operator

Adaptive parameter for Canny Edge

北慕城南 提交于 2019-11-30 20:43:57
I'm using a project using OpenCV for detecting a card that will be place on a atable. I have successfully detect it using Canny Edge. However, for different image the parameter must be tuned manually. I wish for my project to be worked with every image without manually tune the parameter. What Should I do? Balaji R If your image consist of Distinct Background & Foreground, You can get the threshold for that automatically as follows explained in this paper http://www.academypublisher.com/proc/isip09/papers/isip09p109.pdf . Compute Otsu's threshold + Binary threshold for your image. Use the Otsu

Adaptive parameter for Canny Edge

送分小仙女□ 提交于 2019-11-30 04:52:38
问题 I'm using a project using OpenCV for detecting a card that will be place on a atable. I have successfully detect it using Canny Edge. However, for different image the parameter must be tuned manually. I wish for my project to be worked with every image without manually tune the parameter. What Should I do? 回答1: If your image consist of Distinct Background & Foreground, You can get the threshold for that automatically as follows explained in this paper http://www.academypublisher.com/proc

How to detect edge and crop an image in Python

醉酒当歌 提交于 2019-11-28 23:17:44
问题 I'm new to Image Processing in Python and I'm trying to solve a common problem. I have an image having a signature of a person. I want to find the edges and crop it to fit the signature in the image. Input Image Expected Output I tried Canny Edge Detection and cropping the image using a list of existing solutions (articles & answers) using PIL, CV2, but none seem to work. I'm looking for a working solution. Some solutions I tried: https://www.quora.com/How-can-I-detect-an-object-from-static

how to remove straight lines or non-curvical lines in a canny image

ぃ、小莉子 提交于 2019-11-27 09:38:25
I have a canny edge image I want to remove all line except the lines that look like a semi-circle/ellipse or a 'C'. Tried Hough Circle transforms, it detects all curves.Don't need that. A simple approach would be: Find connected components Find the minimum oriented bounding box Compute the aspect ratio of the box, and check if it's too much elongated . On your image, I marked in red almost straight lines, and in green the curved lines. You can play with the threshold on the aspect ratio: Code: #include<opencv2/opencv.hpp> using namespace cv; int main() { // Load image Mat1b img = imread("path