MATLAB Answers

# How i can scale an image using scalle matrix that i determined?

63 views (last 30 days)
Cahaya on 5 Oct 2012
I think if i scale/shear a image matrix, it calculate the position of (x,y) not the value of (x,y) - is it true? I want scale an image using :
scaleMatrix = [0,0; 0,0.5];
a = imread('rectangle.bmp');
a = rgb2gray(a);
b = im2bw(a);
newImage = zeros(size(b));
My problem is how can i scale the matrix image using scaleMatrix that i determine before? and the result is store in newImage. I confused how i can calculate the location of each matrix image with the scaleMatrix.
Standar formula for scale that i know is (x',y') = (x,y).(Sx,0; 0,Sy).
thx.
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Walter Roberson on 5 Oct 2012
The formula (x',y') = (x,y).(Sx,0; 0,Sy) is to work on coordinate pairs such as for a vector geometry.
To rescale y by 1/2, consider using
newImage = imresize(b, size(b) .* [1 1/2]);
##### 2 CommentsShowHide 1 older comment
Image Analyst on 8 Oct 2012

Sign in to comment.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!