Switch to full style
General MATLAB code examples.
Post a reply

Draw rectangle on image

Sat Feb 25, 2012 1:45 am

This example draw rectangle on the image in matlab using imrect function .

Code:


    NumberArrays
=[20 20 120 120]
    % 
Show the Image
    figure
(1), imshow('000067.jpg');
    
imrect(gcaNumberArrays);
    
addNewPositionCallback(h,@(ptitle(mat2str(p,3)));
    % 
recall function to draw the rectangle
    
fcn makeConstrainToRectFcn('imrect',get(gca,'XLim'),get(gca,'YLim'));
    
setPositionConstraintFcn(h,fcn); 

 




Post a reply
  Related Posts  to : Draw rectangle on image
 Draw Fill Rectangle     -  
 Draw Oval,Arc,Polygon,string,Line,Round and 3D Rectangle     -  
 i want to draw a circle on a image(any format bmp,jpeg etc.)     -  
 Read an image bitmap (.bmp) file and draw it as texture     -  
 Ellipse in Rectangle     -  
 How to Calculate Volume of a Rectangle     -  
 Java Rectangle Class     -  
 Drawing rectangle using stars in java     -  
 ellipse, circle, rectangle, square, or parallelogram     -  
 Image-Viewer-Image Processing-Filters-Noise-enhancements     -  

Topic Tags

Matlab Image