I have computed the center and radius and now I want to draw a white disk using these parameters on a black background. I tried something like below but its generating a flat edge in four directions. It is kind of urgent to compare the results so any help would be appreciated. I have attached two images to keep my point. Please zoom the images in order to see what am I claiming.
[imageSizeY,imageSizeX,d] = size(imgimg); [columnsInImage, rowsInImage] = meshgrid(1:imageSizeX, 1:imageSizeY); centerX = floor(centroid(1)); centerY = floor(centroid(2)); radius = ceil(radii); circlePixels = (rowsInImage - centerY).^2 + (columnsInImage - centerX).^2 <= radius.^2; circlePixels = mat2gray(circlePixels); %figure, imshow(circlePixels);
formatSpec_org = 'Proposed%d.png'; strProposed1 = sprintf(formatSpec_org, x); strProposed2 = 'OutputFolder\'; s_P = strcat(strProposed2,strProposed1); imwrite(circlePixels,s_P)
Best Answer