MATLAB Answers

Stretch the middle of image

17 views (last 30 days)
Fat Man
Fat Man on 27 Jun 2019
Commented: KSSV on 27 Jun 2019
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.

Accepted Answer

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

  2 Comments

Fat Man
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
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.

More Answers (0)

Sign in to answer this question.

Tags