MATLAB: How to creat a rectangular 100*100 in center of an image

Computer Vision ToolboxImage Processing Toolboxrectangulat

i need to creat a rectangular 100*100 in center of an image? i used shapeInserter = vision.ShapeInserter but it`s not what i need. this function creats rectang. on image but i need a rectang. in center of image

Best Answer

imageArray(row1:row2, col1:col2) = grayValue; % grayValue can be any number.
row1 is half the height minus 50 pixels, col2 is half the width plus 50 pixels, and so on for other parameters.
Related Question