Hi i have a image of a red ball and if i do Canny edge detection it will find nice edge but if i use my image of a bowl it finds lot of bad edges. I did tried to use this code to calculate optimal threshold but id doesn't help. How can i get rid of lines on bowl and shadow on the ball?
MatOfDouble mu = new MatOfDouble();
MatOfDouble sigma = new MatOfDouble();
Core.meanStdDev(imageInMat, mu, sigma);
Mat canny = new Mat();
Imgproc.Canny(imageInMat, canny, mu.get(0,0)[0] - sigma.get(0,0)[0], mu.get(0,0)[0]+ sigma.get(0,0)[0]);