edge-detection

Robust card detection/persecutive correction OpenCV

天涯浪子 提交于 2019-12-02 16:01:37
I currently have a method for detecting a card in an image and for the most part it works when the lighting is fairly consistent and the background is very calm. Here is the code I am using to preform this operation: Mat img = inImg.clone(); outImg = Mat(inImg.size(), CV_8UC1); inImg.copyTo(outImg); Mat img_fullRes = img.clone(); pyrDown(img, img); Mat imgGray; cvtColor(img, imgGray, CV_RGB2GRAY); outImg_gray = imgGray.clone(); // Find Edges // Mat detectedEdges = imgGray.clone(); bilateralFilter(imgGray, detectedEdges, 0, 185, 3, 0); Canny( detectedEdges, detectedEdges, 20, 65, 3 ); dilate

Best articles to start learning about edge detection/image recognition

孤人 提交于 2019-12-02 14:19:13
I am involved in a personal project which will require pretty extensive knowledge of edge detection and image segmentation/object recognition. I know the importance of planning/understanding before writing code and with this in mind, what is the best place to start, to learn about these areas of computing? I am ideally looking for online articles/papers. Thanks I found the series by Christian Graus on Code Project to be useful: Image Processing for Dummies with C# and GDI+ Part 1 - Per Pixel Filters Image Processing for Dummies with C# and GDI+ Part 2 - Convolution Filters Image Processing for

How to determine edges in an image optimally?

扶醉桌前 提交于 2019-12-02 09:46:01
I recently was put in front of the problem of cropping and resizing images. I needed to crop the 'main content' of an image for example if i had an image similar to this: (source: msn.com ) the result should be an image with the msn content without the white margins(left& right). I search on the X axis for the first and last color change and on the Y axis the same thing. The problem is that traversing the image line by line takes a while..for an image that is 2000x1600px it takes up to 2 seconds to return the CropRect => x1,y1,x2,y2 data. I tried to make for each coordinate a traversal and

Structured Edge Detection

情到浓时终转凉″ 提交于 2019-12-02 09:40:26
I'm trying to implement SED from OpenCV to android but I'm running into an error. So this is the code I'm using and it requires a model file (trained model to detect edges) which is located in the asset folder : private Bitmap StructuredDetectEdges (Bitmap bitmap){ Mat rgba = new Mat(); Utils.bitmapToMat(bitmap,rgba); Mat edges = new Mat(rgba.size(), CvType.CV_8UC1); Imgproc.cvtColor(rgba,edges,Imgproc.COLOR_RGB2GRAY,4); StructuredEdgeDetection pDollar = createStructuredEdgeDetection("file:///android_asset/SEDmodel.yml"); pDollar.detectEdges(edges,edges); Bitmap resultBitmap = Bitmap

Matlab: First derivative edge detection, about gradients

不打扰是莪最后的温柔 提交于 2019-12-02 03:15:05
I'm writing a program that asks the user to choose between Prewitt and Sobel image filters to detect edges of objects of an image. I must use their filter templates, not the edge function. The user also tells if he wants to detect 'horizontal', 'vertical' or 'diagonal' edges. My problem is theoretical rather than about programming. In my notes i've got that to compute the magnitude of the gradient at each pixel, it is often approximated as sqrt(Gx^2 + Gy^2) where Gx would be the vertical derivative and Gy the horizontal derivative. But what is the value of Gx if I only calculate the horizontal

Find Edges with ImageJ Programmatically

喜你入骨 提交于 2019-12-02 01:07:02
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 BufferedImage, it only prints "-16777216" for each pixel RGB. OK, I got the solution, the problem was that I didn

How to get well-defined edges regardless of the color

*爱你&永不变心* 提交于 2019-12-02 01:02:59
问题 I am trying to develop an App that detects cards "master cards, visa, cutomer cards, etc" using Android Camera, for that purpose i used OpenCV4Android version 3.0.0. To achieve this task, i did the following: 1- converted the frame taken from the camera to gray scale using Imgproc.cvtColor(this.mMatInputFrame, this.mMatGray, Imgproc.COLOR_BGR2GRAY); 2- blurring the frame using Imgproc.blur(this.mMatGray, this.mMatEdges, new Size(7, 7)); 3- apply Canny edge detector as follows Imgproc.Canny

Find the edges of image and crop it in MATLAB

妖精的绣舞 提交于 2019-12-01 13:00:43
I have a RGB image. I have scanned the image. So the image occupies a small portion of an A4 size sheet. I want to find the border of the image and crop it. I could use edge detection operators like 'Sobel' etc, but they detect all the edges present in the image. All I want is the border of the image. Also many of the edge detection functions including 'bwboundaries' work only with binary or grayscale images. My image is RGB. I tried using 'imcrop', but this is more of interactive cropping. I am keen on doing this automatically. Uploading a test image: Since this is an rgb image, there will be

Find the edges of image and crop it in MATLAB

早过忘川 提交于 2019-12-01 10:50:47
问题 I have a RGB image. I have scanned the image. So the image occupies a small portion of an A4 size sheet. I want to find the border of the image and crop it. I could use edge detection operators like 'Sobel' etc, but they detect all the edges present in the image. All I want is the border of the image. Also many of the edge detection functions including 'bwboundaries' work only with binary or grayscale images. My image is RGB. I tried using 'imcrop', but this is more of interactive cropping. I

Find contour/edge in pcolor in Matlab

杀马特。学长 韩版系。学妹 提交于 2019-12-01 10:41:07
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 through the mid-points of the face (red dots) of the pixels. Note that I don't want the contour to follow the