edge-detection

Approximating jagged edges as lines

被刻印的时光 ゝ 提交于 2020-02-28 06:46:07
问题 I am trying to find accurate locations for the corners on ink blotches as seen below: My idea is to fit lines to the edges and then find where they intersect. As of now, I've tried using cv2.approxPolyDP() with various values of epsilon to approximate the edges, however this doesn't look like the way to go. My cv.approxPolyDP code gives the following result: Ideally, this is what I want to produce (drawn on paint): Are there CV functions in place for this sort of problem? I've considered

Hough circle detection accuracy very low

筅森魡賤 提交于 2020-02-14 00:42:55
问题 I am trying to detect a circular shape from an image which appears to have very good definition. I do realize that part of the circle is missing but from what I've read about the Hough transform it doesn't seem like that should cause the problem I'm experiencing. Input: Output: Code: // Read the image Mat src = Highgui.imread("input.png"); // Convert it to gray Mat src_gray = new Mat(); Imgproc.cvtColor(src, src_gray, Imgproc.COLOR_BGR2GRAY); // Reduce the noise so we avoid false circle

opencv canny: Do minVal and maxVal matter if you're working with a black and white image?

流过昼夜 提交于 2020-01-25 02:52:43
问题 Preface: This is a continuation of this question. Consider the following code, taken from here: import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('messi5.jpg',0) edges = cv2.Canny(img,100,200) # Would 100 and 200 matter if your original image was black and white? plt.subplot(121),plt.imshow(img,cmap = 'gray') plt.title('Original Image'), plt.xticks([]), plt.yticks([]) plt.subplot(122),plt.imshow(edges,cmap = 'gray') plt.title('Edge Image'), plt.xticks([]),

boundary detection after Canny Edge

冷暖自知 提交于 2020-01-24 09:38:45
问题 I've tried an open source java implementation of Canny Edge. I only need the boundary (the outline) of the image but there are extra lines in the output. Is there any way I could remove those lines after using Canny Edge (is there another algorithm)? Or are there other ways I could modify the program such that it will only detect the outline? I've tried this one. 回答1: If the outline you are looking for is a single "long" connected line, you could filter out "short" lines. One way to do it

opencv structured forest edge detection and findcontours

≯℡__Kan透↙ 提交于 2020-01-17 06:38:57
问题 I am trying to use opencv via visual c++ to extract contours of an image. I was able to do that using the opencv tutorial for findcontours. findcontours works in two steps Detect edges using canny edge detector. Feed the output of canny to findcontours. I want to try out the same with 'Structured Forest Edge Detection' (Zitnick et al). I am able to extract the edges and display them, but when I try to feed the output to findcontours. I am getting a 'cv::Exception at memory location 0x0020EE9C

Edge detection and removal

大城市里の小女人 提交于 2020-01-13 19:55:21
问题 I am new to Image Processing. I am developing a web application. I need to take an image (free hand drawings) and remove parts of it. For example, take an image of cat and remove everything except its eye. P.S-> I am developing a pictionary game based authentication system. It requires user to select an image co-relating his password, and I would morph it by detecting the edges and removing the parts of it and store it as a cue and display it to him, so that it makes sense only to him and not

matlab: find outer edges of objects in a picture

﹥>﹥吖頭↗ 提交于 2020-01-13 04:55:51
问题 I have a picture contains blood smear. What I want to do is to detect the edges of those cells. I first convert this color image into grayscale image and then fill holes in those cells. And I use the edge() function in matlab to detect edges. Since you can observe the inner part of some cell is much lighter, so there are edges detected inside one cell. The result is shown below: So is there any methods that only the outer edges of those cells can be detected? My code is shown below: I =

how to find corners points of a shape in an image in opencv?

a 夏天 提交于 2020-01-12 05:55:30
问题 I have to find corners of shapes in an image. i have used Harris corner detection algorithm to find corner, but it is giving total corners present in an image and for finding corners for a particular shape in that image it is not feasible. please suggest some other approach. 回答1: You could use Harris corner detection algorithm. Corners are junction of two edges, where an edge is a sudden change in image brightness. This algorithm takes the differential of the corner score into account with

how to find corners points of a shape in an image in opencv?

荒凉一梦 提交于 2020-01-12 05:55:20
问题 I have to find corners of shapes in an image. i have used Harris corner detection algorithm to find corner, but it is giving total corners present in an image and for finding corners for a particular shape in that image it is not feasible. please suggest some other approach. 回答1: You could use Harris corner detection algorithm. Corners are junction of two edges, where an edge is a sudden change in image brightness. This algorithm takes the differential of the corner score into account with

Best method to find edge of noise image

一个人想着一个人 提交于 2020-01-11 06:25:48
问题 I have a noise image I such as the bellow figure. Assume that it is Gaussian noise. Currently, I am using two steps to find the edge Smooth the image using Gaussian filter G Find edge based on the equation g=1/(1+β∇ (I*G)^2) where G is gaussian filter. β is weight to control the noise level. However, the Gaussian filter is reason for losing of edge in image. I want to find a better method that can preserve edge information. Could you suggest to me the best method to find the edge of that