matlab - Circle detection via Hough Transform -


i writing matlab code takes in photo , detects circular object. after using filters, got below image.

enter image description here

to detect circular object(it not perfect circle), tried apply hough transform passing different values of radius , threshold, couldn't detect properly. why happens? shape of object or background of image?

also possible detect same object @ following image using hough transform?

enter image description here

edge of circular object seems human eye, not sure background can eliminated image via hough transform.

you can use imfindcircles in image processing toolbox. using morphology fill in circle , cranking sensitivity may help:

im = imread('pattern.jpg'); im2 = rgb2gray(im(100:end-100, 100:end-100, :)); im3 = im2bw(im2, 0.1); im4 = imclose(im3, strel('disk', 4, 4)); im5 = imfill(im4, 'holes'); imshow(im5); [centers, radii] = imfindcircles(im5, [180, 200], 'sensitivity', .99); viscircles(centers, radii); 

enter image description here


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -