MATLAB Answers

Fat Man
0

Stretch the middle of image

Asked by Fat Man
on 27 Jun 2019
Latest activity Commented on by KSSV
on 27 Jun 2019
Accepted Answer by KSSV
Suppose I have a .png
How can I use Matlab to stretch the middle third of the image in horizontal direction by a factor of 2?
img = imread('dough.png');%Open the image input
image(img)
[rows,columns,~] = size(img)
Thank you for your help!!!

  0 Comments

Sign in to comment.

Tags

1 Answer

KSSV
Answer by KSSV
on 27 Jun 2019
 Accepted Answer

img = imread('dough.png');%Open the image input
image(img)
[rows,columns,~] = size(img)
iwant = imresize(img,[2*rows columns]) ;

  2 Comments

Fat Man
on 27 Jun 2019
Thank you for replying
But, the rows represents the Y-axis in Matlab figure. Please take a look at the output image that I would like to get
KSSV
on 27 Jun 2019
The code just resizes the matrix..you will not get the effect you want as shown.

Sign in to comment.