edge-detection

Get edge co-ordinates after edge detection (Canny)

ぃ、小莉子 提交于 2019-12-01 08:56:58
I have been working with OpenCV for a fairly short time, and have performed Canny Edge Detection on an image, and also performed dilation after that to further separate the object (in my case a square) from the background. My problem, now is to identify graspable regions in 2D using an algorithm that requires me to handle co-ordinates of the points in those edges. Is there any way I can use OpenCV to get the co-ordinates of the corners so I can find the equation of the lines forming the edge of the square? I know the size of the square. My problem involves 2D co-ordinate geometry, and hence

Find contour/edge in pcolor in Matlab

核能气质少年 提交于 2019-12-01 08:33:30
问题 I'm trying to make a contour that follows the edges of the 'pixels' in a pcolor plot in Matlab. This is probably best explained in pictures. Here is a plot of my data. There is a distinct boundary between the yellow data (data==1) and the blue data (data==0): Note that this is a pcolor plot so each 'square' is essentially a pixel. I want to return a contour that follows the faces of the yellow data pixels , not just the edge of the yellow data. So the output contour (green line) passes

Opencv Edge extraction

主宰稳场 提交于 2019-11-30 15:39:54
I have an image and I want to create an edge histogram. I divide the image into 1100 image-blocks and try to find edge and its direction (horisontal, vertical, 45° diagonal, 135° diagonal or nondirectional) in each block. How can I extract that information about edges? Do you have any ideas? Regards! user101375 I found the answer in this paper: Efficient Use of MPEG-7 Edge Histogram Descriptor by Won. My goal was to find following edges: Won divide each Image Block into 4 parts, calculate the average gray level in each of them and use the following coefficients: We use this coefficients as

Prepare complex image for OCR

孤者浪人 提交于 2019-11-30 13:17:07
问题 I want to recognize digits from a credit card. To make things worse, the source image is not guaranteed to be of high quality. The OCR is to be realized through a neural network, but that shouldn't be the topic here. The current issue is the image preprocessing. As credit cards can have backgrounds and other complex graphics, the text is not as clear as with scanning a document. I made experiments with edge detection (Canny Edge, Sobel), but it wasn't that successful. Also calculating the

Closing a contour curve in OpenCV

*爱你&永不变心* 提交于 2019-11-30 12:22:40
I'm using OpenCV (Canny + findCountours) to find external contours of objects. The curve drawn is typically almost, but not entirely, closed. I'd like to close it - to find the region it bounds. How do I do this? Things considered: Dilation - the examples I've seen show this after Canny, although it would seem to me it makes more sense to do this after findContours Convex hull - might work, though I'm really trying to complete a curve Shape simplification - related, but not exactly what I want Using PolyLine method to draw contours cv2.PolyLine(img, points, is_closed=True, 255, thickness=1,

opencv - counting non directional edges from canny

南楼画角 提交于 2019-11-30 11:10:57
问题 can anyone help me how to count the number of non directional edge using opencv cannyedge detection? I have a cannyEdge image from opencv and I would like to have an histogram based on edge directions and there by i can count he number of directional and non directional edges. 回答1: I think you are confusing edge detection with gradient detection. Canny provides an edge map based on the gradient magnitude (normally using a Sobel operator, but it can use others) because Canny only returns the

object (Car) Detection and segmentation

 ̄綄美尐妖づ 提交于 2019-11-30 10:24:56
I am trying to segment cars from image that consist of only one car and an easy background like but what I get from my implementation is this and respectively but it works very easily on almost already segmented images like. giving results like The Code I am using is import cv2 import numpy as np THRESH_TYPE=cv2.THRESH_BINARY_INV def show(name,obj): cv2.imshow(name,obj) cv2.moveWindow(name, 100, 100) cv2.waitKey(0) cv2.destroyAllWindows() def process_end(new): drawing = np.zeros(o.shape,np.uint8) # Image to draw the contours contours,hierarchy =cv2.findContours(new,cv2.RETR_TREE,cv2.CHAIN

Extract one object from bunch of objects and detect edges

心不动则不痛 提交于 2019-11-30 10:19:27
For my college project I need to identify a species of a plant from plant leaf shape by detecting edges of a leaf. (I use OpenCV 2.4.9 and C++), but the source image has taken in the real environment of the plant and has more than one leaf. See the below example image. So here I need to extract the edge pattern of just one leaf to process further. Using Canny Edge Detector I can identify edges of the whole image. But I don't know how to proceed from here to extract edge pattern of just one leaf, may be more clear and complete leaf. I don't know even if this is possible also. Can anyone please

Canny Edge detector threshold values gives different result

最后都变了- 提交于 2019-11-30 10:17:57
I am trying to find contour of a image, before that I am applying Canny's edge detector. It's giving different result for different images.For one image it's giving perfect contours at threshold value - min-40 max-240 and for other image its 30-120. I want to make it generic. In laymen terms, edge detection needs a threshold to tell what difference/change should be counted as edge. For details read here . So, the edges depend on the the content of image ie the level of brightness/darkness/contrast. I suggest you to simply find the mean of whole gray image and take threshold as follows: min

detecting object in Homogeneous Intensity image

岁酱吖の 提交于 2019-11-30 09:53:22
I have image of Tiger's Pugmark (footprint impression) in mud. I want to detect the boundary of the pugmark but the image is uniform in intensity that is foreground and background cannot be distinguished based on intensity variations. What can i do to distinguish between the pugmark and the background.! In segmentation tasks if you have both Good markers; and Strong edges around the object of interest then it is directly solved by a Watershed Transform. The problem, of course, is obtaining these markers, as well enhancing relevant edges as needed. Obtaining these might involve problem-specific