Could MATLAB do text-mirroring?
Show older comments
Hi!
I would like to have some inserted text in an image mirrored. An example is shown by the figures below.
Original:
Wanted:
(Note that, this is no string flipping, like 'test' to 'tset')
And preferably NOT through the following work flow:
Cropping -> saving it as a new image -> loading -> flipping.
Much appreciated, thanks.
%% A better example would be:
Original:

Wanted:

The text was added with the function 'insertText'.
Thanks.
Accepted Answer
More Answers (1)
KSSV
on 17 Mar 2021
I = imread('image.png') ; % read image
I1 = fliplr(I) ; % flip the image
imshow(I1)
2 Comments
JUNXIANG ZHANG
on 17 Mar 2021
Crop the text part of your image, when prompted.
I = imread('image.png') ;
[I1,rect] = imcrop(I) ; % crop the image where your text is present
%
I1 = fliplr(I1) ;
% Replace
position = round(rect) ;
col1 = position(1);
col2 = col1 + position(3)-1;
row1 = position(2);
row2 = row1 + position(4)-1;
I(row1:row2, col1:col2, :) = I1 ;

Categories
Find more on Language Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
