I have an image which contains circles. i have to count the number of circles in the image. also if given co-ordinates of any random point inside these circles, i have to find the diameter of each of these circles using the given point only. i have written the code to convert the image to binary which is as follows:
clc;clear all;close all;img=imread('H:\BIOMEDICAL\img.jpg');figure,imshow(img);gimg = min( img, [], 3 );figure, imshow(gimg);BW = im2bw( gimg, .5 );figure,imshow(BW);
I think after taking the co-ordinates of the point inside the circle, i have to draw straight lines from this point up to the boundary of the circle, by checking whether the pixel is black or white, as the pixels inside the circle are shown as black in the binary image. i have to detect the small circles which are shown in the binary image.
Then by joining these points on the boundary i have to detect the edge of the circle and then count the number of circles. and lastly i have to give output as the number of circles detected along with their respective diameters. i don't know how to implement this code. can anyone help me please?
Best Answer