Search code examples
imagematlabimage-processingmatlab-cvstregion

Trying to create a rectangular box within my image after using imshow in MATLAB


I currently have an image where I want to highlight a particular area. As shown in the picture below. I do not need the coordinates to appear on the image. I know of two ways I can do this in MATLAB:

enter image description here

  • Create an image of the same size, with the Area of Interest highlighted with a particular colour. Now superimpose this image with the original image.
  • Create a complex for loop that highlights the edges with a particular colour.

But neither of this is convenient, as one of them loses some of the information of the image, while the other is quite cumbersome to implement. Therefore I wanted to know if there was a function that would let me do this.


Solution

  • Have you tried using the Rectangle function of MATLAB?