edge-detection

find the edge based on normals

寵の児 提交于 2020-01-06 13:52:32
问题 I have a 480*640 depth image, and I got the normals (a 480*640*3 matrix) of each pixel from this depth image. Does anyone know how could I find the edge based on the normal information? Thanks a lot! 回答1: An intuitive definition of an edge in a depth image is where the surface normal faces away from the viewer. Assuming a viewing direction [0 0 -1] (into the XY plane) any normal that has nearly vanishing z component can be characterized as an edge. e = abs( depth(:,:,3) ) < 1e-3; %// a nice

find the edge based on normals

我们两清 提交于 2020-01-06 13:52:30
问题 I have a 480*640 depth image, and I got the normals (a 480*640*3 matrix) of each pixel from this depth image. Does anyone know how could I find the edge based on the normal information? Thanks a lot! 回答1: An intuitive definition of an edge in a depth image is where the surface normal faces away from the viewer. Assuming a viewing direction [0 0 -1] (into the XY plane) any normal that has nearly vanishing z component can be characterized as an edge. e = abs( depth(:,:,3) ) < 1e-3; %// a nice

OpenCV - canny edge detection not working properly

核能气质少年 提交于 2020-01-01 11:51:02
问题 I am new to OpenCV with Android. I am currently working on document detection demo app. What I did so far is as below: Original image -> Gray scale image -> GaussianBlur -> Canny edge detection -> finding contours -> draw Contours I am able to detect paper sheet perfectly as you can see in below image . But it does not detect some documents. Below is one of them I researched a lot about that and found that the problem lies in canny edge detection and below is the canny image : As you can see

OpenCV - canny edge detection not working properly

你离开我真会死。 提交于 2020-01-01 11:50:44
问题 I am new to OpenCV with Android. I am currently working on document detection demo app. What I did so far is as below: Original image -> Gray scale image -> GaussianBlur -> Canny edge detection -> finding contours -> draw Contours I am able to detect paper sheet perfectly as you can see in below image . But it does not detect some documents. Below is one of them I researched a lot about that and found that the problem lies in canny edge detection and below is the canny image : As you can see

How to detect smooth curves in matlab

主宰稳场 提交于 2020-01-01 10:57:10
问题 I am trying to detect a bent conveyor in an image. I used the following code using Hough transform to detect its edges %# load image, and process it I = imread('ggp\2.jpg'); g = rgb2gray(I); bw = edge(g,'Canny'); [H,T,R] = hough(bw); P = houghpeaks(H,500,'threshold',ceil(0.4*max(H(:)))); % I apply houghlines on the grayscale picture, otherwise it doesn't detect % the straight lines shown in the picture lines = houghlines(g,T,R,P,'FillGap',5,'MinLength',50); figure, imshow(g), hold on for k =

Find Edges with ImageJ Programmatically

人走茶凉 提交于 2019-12-31 02:54:30
问题 I want to use find edges option of the ImageJ , have the edges-found array and save it to another file programatically. ImagePlus ip1 = IJ.openImage("myimage.jpg"); ImageProcessor ip = new ColorProcessor(ip1.getWidth(), ip1.getHeight()); ip.findEdges(); However, the function findEdges is abstract and I can't have the edge-found image. EDIT: I wrote the following lines: ip.findEdges(); BufferedImage bimg = ip.getBufferedImage(); However, when I try to print out the RGB values of the

object (Car) Detection and segmentation

血红的双手。 提交于 2019-12-30 03:33:30
问题 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

How to connect broken lines in a binary image using Python/Opencv

二次信任 提交于 2019-12-30 00:38:50
问题 How can I make these lines connect at the target points? The image is a result of a skeletonization process. I'm trying to segment each line as a region using Watershed Transform. 回答1: MikeE's answer is quite good: using dilation and erosion morphological operations can help a lot in this context. I want to suggest a little improvement, taking advantage of the specific structure of the image at hand. Instead of using dilation/erosion with a general kernel, I suggest using a horizontal kernel

How to detect the Sun from the space sky in OpenCv?

一世执手 提交于 2019-12-28 12:10:09
问题 I need to detect the Sun from the space sky. These are examples of the input images: I've got such results after Morphologic filtering ( open operation for twice ) Here's the algorithm code of this processing: // Color to Gray cvCvtColor(image, gray, CV_RGB2GRAY); // color threshold cvThreshold(gray,gray,150,255,CV_THRESH_BINARY); // Morphologic open for 2 times cvMorphologyEx( gray, dst, NULL, CV_SHAPE_RECT, CV_MOP_OPEN, 2); Isn't it too heavy processing for such a simple task? And how to

OpenCV cvCanny memory exception

寵の児 提交于 2019-12-24 10:38:30
问题 I am trying to do the examples in the OpenCV book and I got to the part regarding cvCanny. I am trying to use it, but I keep getting a memory exception error of Unhandled exception at 0x75d8b760 in Image_Transform.exe: Microsoft C++ exception: cv::Exception at memory location 0x0011e7a4.. I have also looked at another post that was similar to this question, but it did not help for me as I got the same error each time. Any help is greatly appreciated and the source code for the function is