MATLAB: How to devide image into sector and tracks

Image Processing Toolboxmasktrack and sector

i want to draw circles on image and devide each circle into 8 sector and calculate num of pixel in each sector .

Best Answer

See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F and the question following that one on drawing a sector. Then you can pass the x,y data into poly2mask() to create a mask that you can apply to your image
mask = poly2mask(x, y, rows, columns);
maskedImage = grayImage; % Initialize
maskedImage(~mask) = 0; % Blacken outside mask.
Related Question