Could MATLAB do text-mirroring?
이전 댓글 표시
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.
채택된 답변
추가 답변 (1개)
KSSV
2021년 3월 17일
I = imread('image.png') ; % read image
I1 = fliplr(I) ; % flip the image
imshow(I1)
댓글 수: 2
JUNXIANG ZHANG
2021년 3월 17일
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 ;

카테고리
도움말 센터 및 File Exchange에서 Language Support에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

