I'm using a code obtained from to create a circle of 200 pixels radius . When I open the image with another program (paint or adobe for example) to verify that the number of pixels is 200, I find variations of more than 30 pixels in terms of length. The code is:
imageSizeX = 400;imageSizeY = 400;[columnsInImage rowsInImage] = meshgrid(1:imageSizeX, 1:imageSizeY);% Next create the circle in the image.
centerX = 200;centerY = 200;radius = 200;circlePixels = (rowsInImage - centerY).^2 ... + (columnsInImage - centerX).^2 <= radius.^2;% circlePixels is a 2D "logical" array.
% Now, display it.
image(circlePixels) ;colormap([1 1 1; 0 0 0]);axis off;saveas(image(circlePixels),'circulo.bmp')
What is the reason?
Thanks
Best Answer