0

We have written a code for edge detection in OpenCV java where the background for the image would be plain white to increase accuracy. We have added the following functions for the edge detection part:

Imgproc.GaussianBlur(im, im2, new Size(0,0), 10);       
Core.addWeighted(im, 1.5, im2, 0.5, 0.2, im); 

Imgproc.Canny(im, edges, 20, 100);

However, there is some problem in the edge detection as even other points in the background appear as edges which affect the code. Can somebody please tell me some improvements so as to get a more accurate output keeping in mind that image would be taken from a smartphone camera as it is the premise of my project.

Devid Farinelli
  • 7,514
  • 9
  • 42
  • 73
  • 4
    provide an images. you cannot detect edges on a plain white background unless it is not plain white... why do you apply a gaussian blur with size 0? that makes no sense. – Piglet Apr 03 '17 at 08:16

1 Answers1

0

Your question is very unclear but I think you are asking "How can I remove noise in a binary image?"

If this is your question you can try to use Eroding and Dilating to remove some of the noise in an image.

And if you are a beginner in OpenCV i suggest reading the tutorials here, they helped me a lot when I started to use OpenCV

cocovii
  • 33
  • 5