MATLAB Answers


After using mat2tiles, how can I mark a patch image on the original image

Asked by YIYANG WANG on 12 Aug 2018
Latest activity Commented on by YIYANG WANG on 12 Aug 2018
I used 'mat2tiles' function to divide an image into different patches. Now I want to Mark (the border of the patch in red) a patch on the original image. For example, the interested patch is in the first row and the 39th column, I can get the patch image by 'imagesc(splitImage{1,39})'. But how can I get the coordinate information for this patch and marked it on the original image?


Sign in to comment.

1 Answer

Answer by Walter Roberson
on 12 Aug 2018
 Accepted Answer

block_row_number = 1; block_column_number = 39;
block_height = 32; block_width = 40; %for 32 x 40 blocks
y_start = (block_row_number - 1) * block_height + 1;
x_start = (block_column_number - 1) * block_width + 1;
rectangle('Position', [x_start, y_start, block_width, block_height])

  1 Comment

Sign in to comment.