Add the following at the bottom of the MidPoint Circle function to created filled circles
for ii = xc-int16(radius):xc+(int16(radius))
for jj = yc-int16(radius):yc+(int16(radius))
tempR = sqrt((double(ii) - double(xc)).^2 + (double(jj) - double(yc)).^2);
if(tempR <= double(int16(radius)))
This code is extremely useful.
I'm not particularly good in using matlab but i had no trouble understanding how to use it (although it took me a good FIVE minutes).
So Five stars for sure for doing EXACTLY what it says on the box, nothing more and nothing less. You guys should be ashamed for rating less then 5 stars.
For others, to get rid of the gaps I used
FilteredResult=medfilt2(Result, [3 3])
This is how I used this code
(you will now notice i'm no good at matlab)
GGG=medfilt2(GGG, [3 3])
this is a coding to draw a circle.
i using the same code but i looping it with reduce the radius.
let say, my radius is 7, I try looping it by draw radius with 7, and then 6, and then 5 and so on until it become 0. It really fill in a lot of space but the problem is still got some space is empty.
My problem now is I want to fill in all the area inside the circle. So, any idea to solve this problem? Thank you