how can i make a change in my image ?

hi guys . i have an image (257*161) .
im = f(x,y)
how can i change my image equation to im = f(x/8 , y/12 )
could you please help me ?
thanks

3 Comments

Hamed - in your function
im = f(x,y)
what are the inputs x and y? Are they (integer) pixel coordinates of your image, or something else? What is the purpose of your function f? Is the output, im, the image or ..? Please provide more details concerning the problem that you wish to be solved.
Stephen23
Stephen23 on 1 Sep 2014
Edited: Stephen23 on 1 Sep 2014
I downloaded your file matlab.mat , and using the MATLAB function image it created a lovely figure showing some torso cross-section, like from a CT scan.
What is the problem with the image? What exactly do you mean by "image equation"? What is the function f ? What are the variables x and y ? How should the image be different?
Do you wish to scale, resize or skew the image?
Hi i want to do scale and translation normalization
i read in a site :
p(x/a+x1,y/a+x2) to p(x,y),where p(x,y) is original image, x1 and x2 are the centroid of p(x,y),x1=m10/m00,x2=m01/m00,a=sqrt(β/m00),β is a predetermined value. In fact, this is doing scale and translation normalization
i computed m= a+x1 and n=a+x2 . now how can i compute P(x/m , y/n)??

Sign in to comment.

Answers (1)

Do you possibly mean imresize()?
[rows, columns, numberOfColorChannels] = size(im);
% Get new x-width and y-height using formulas x/8 , y/12
% Remember, arrays are (rows, columns) = (y, x) NOT (x,y)!!!!!!!!!!
newRows = round(rows/12); % New y height
newColumns = round(columns / 8); % New x width
% Resize image
resizedImage = imresize(im, [newRows, newColumns]);

5 Comments

Your "scale and translation normalization" sort of sounds like you want to paste the image in a different place. If you want to do that, see my image copy and paste demo, attached.
hamed
hamed on 1 Sep 2014
Edited: hamed on 1 Sep 2014
i saw your code but it's very complicated
please explain what's the meaning of f(x,y) change to f(x/m,y/n)
how can i do that ?
That just scales and shifts the image so that what once happened at x now happens at x/a + xbar, or at x/m in your equation.
thanks a lot for you answer and attention
i read some paper about Zernike moment and scale invariant problem. some of them solve it with this method :
image MUST first be normalized w.r.t. scale and translation
i.e. centroid of image is at image center, and image
has geometrical moment m00 = fixed number/scale
M00: sum of grey level (for greytone images)
or in another text i read
Moments η i j where i + j ≥ 2 can be constructed to be invariant to both translation and changes in scale by dividing the corresponding central moment by the properly scaled (00)th moment, using the following formula.
i want to write these equation in matlab and change my image scale with this equations but i don't know could you please help me ??
hamed, see my attached demo where I compute the first 4 image moments, mean, standard deviation, skewness, and kurtosis.

Sign in to comment.

Asked:

on 1 Sep 2014

Commented:

on 3 Sep 2014

Community Treasure Hunt

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

Start Hunting!