At line 14, 15 you will have to change the xp and yp xp=a*cos(ang); yp=b*sin(ang); where a is the major axis and b is the minor axis of ellipse. You can put the parametric equation of the curve you want to find here.
@@pratikian thanks a lot for replying bro actually I had to do this for lame curve so can you help me with some code for it, as on net very complex codes are there
I dont understand. I have fixed R and I know x, y point of edge. How I can get(calculate) a and b to increment accumulator? Which a, b I must use? Which range of a,b? From what to what?
So what do X and Y mean here? Apart from that I feel that the algorithm is fine it should work. here is an algorithm that I had used. first define a circle with radius r. ang=0:0.1:2*pi; xp=r*cos(ang); yp=r*sin(ang); Now we just have to move this circle so that it centers at the edge point (x,y). Now make an accumulator matrix which is of size (m+2*r, n+2*r) (where the image size is m x n ) now run a for loop for all the edge points x,y detected make the circle in the accumulator matrix centered at every edge point (x,y) v = x + xp; w = y + yp; increment the accumulator at v,w position accumulator(v,w) += 1; Finally choose the point which is having the maximum value in the accumulator. That is the required center of the circle. here you can see the matlab code for the above algorithm drive.google.com/drive/u/0/folders/1UTIgcj0Z-dKo67zNZj8qwmueH0g3OPp0
here is an algorithm that I had used. first define a circle with radius r. ang=0:0.1:2*pi; xp=r*cos(ang); yp=r*sin(ang); Now we just have to move this circle so that it centers at the edge point (x,y). Now make an accumulator matrix which is of size (m+2*r, n+2*r) (where the image size is m x n ) now run a for loop for all the edge points x,y detected make the circle in the accumulator matrix centered at every edge point (x,y) v = x + xp; w = y + yp; increment the accumulator at v,w position accumulator(v,w) += 1; Finally choose the point which is having the maximum value in the accumulator. That is the required center of the circle. here you can see the matlab code for the above algorithm drive.google.com/drive/u/0/folders/1UTIgcj0Z-dKo67zNZj8qwmueH0g3OPp0
You can also look at some other implementations my code is not very Robust in.mathworks.com/matlabcentral/fileexchange/4985-circle-detection-via-standard-hough-transform
Okay I will try. Acctually my code is not very robust meanwhile you can also try other implementations in.mathworks.com/matlabcentral/fileexchange/4985-circle-detection-via-standard-hough-transform Hope that helps
Sure here is the link for the matlab code drive.google.com/drive/mobile/folders/1UTIgcj0Z-dKo67zNZj8qwmueH0g3OPp0?usp=sharing This code is not very robust it is for a constant r , it is good for understanding purpose
Great video, thanks for the explanation. I have a question regarding your code, I wonder if your code is based on hough circle for unknown radius? how do you draw the accumulator array for an unknown radius? your code: drive.google.com/drive/u/0/folders/1UTIgcj0Z-dKo67zNZj8qwmueH0g3OPp0