Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
change image width and height

Subject: change image width and height

From: vishnu kumar

Date: 15 Oct, 2010 09:50:05

Message: 1 of 5


 i want to change the image width and height , but how to change it?

image1=imread('C:\crowds\1.jpg')
size(image1)

ans =

   240 320 3


image2=imread('C:\crowds\5.jpg')
size(image2)

ans =

         768 1024 3


Now i need to set the width and height of image 2 as 240x320.... how to do this?

image2.Width=size(image1,1);
image2.Height=size(image1,2);

is it correct? but i get some error message.....

Warning: Struct field assignment overwrites a value with class "uint8".
 See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Disp


please! someone help me...

Subject: change image width and height

From: ImageAnalyst

Date: 15 Oct, 2010 10:09:20

Message: 2 of 5

Look up the imresize() function.

Subject: change image width and height

From: Ömer KAYA

Date: 15 Oct, 2010 14:07:03

Message: 3 of 5

"vishnu kumar" <sasivishnu@gmail.com> wrote in message <i9984d$kkv$1@fred.mathworks.com>...
>
> i want to change the image width and height , but how to change it?
>
> image1=imread('C:\crowds\1.jpg')
> size(image1)
>
> ans =
>
> 240 320 3
>
>
> image2=imread('C:\crowds\5.jpg')
> size(image2)
>
> ans =
>
> 768 1024 3
>
>
> Now i need to set the width and height of image 2 as 240x320.... how to do this?
>
> image2.Width=size(image1,1);
> image2.Height=size(image1,2);
>
> is it correct? but i get some error message.....
>
> Warning: Struct field assignment overwrites a value with class "uint8".
> See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Disp
>
>
> please! someone help me...

Hi;

do you want to crop the image... or cut it? or strech or compress it?

Ömer KAYA
METU

Subject: change image width and height

From: vishnu kumar

Date: 15 Oct, 2010 15:50:04

Message: 4 of 5

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <3a25dca6-65fb-4fcb-a4ba-4d7c4be1f936@g18g2000yqk.googlegroups.com>...
> Look up the imresize() function.

thanks..... a lot..

Subject: change image width and height

From: vishnu kumar

Date: 15 Oct, 2010 15:58:03

Message: 5 of 5

> Hi;
>
> do you want to crop the image... or cut it? or strech or compress it?
>
> Ömer KAYA
> METU


i want to know about cropping the image.

[95.5 67.5 159 114]

this is the pixel position i cropped from one image.....

now , i want to compare some 1000 frames only at this pixel position to find out the frame difference between them ,.... how to do that?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us