MATLAB: How to divide image into sectors around CoG

arcimage processingImage Processing Toolboxmasksector

How a binary image can be divided into equal size sectors circularly around its center of gravity (CoG).

Best Answer

Create x,y coordinates of an arc using the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_an_arc.3F.
Then pass those coordinates into poly2mask(x,y,rows,columns) to get a binary image (mask). Then multiply that by, or assign, the image to mask off everything except that sector.
Let me know if you can't figure out the attached, well commented code.
Related Question