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:
creating an image

Subject: creating an image

From: Dominic

Date: 22 May, 2009 17:52:02

Message: 1 of 2

Hi,

I have a struct with struct.x, struct.y and struct.value and want to create an image, where (struct.x,struct.y) represent the pixel and the value is interpreted as color or intensity in grey scale.

Is it better to have an 3D Array or doesn't it matter. The size of the picture is usually 512x512.

cheers,
Dominic

Subject: creating an image

From: Sadik

Date: 22 May, 2009 18:45:04

Message: 2 of 2

If the values are intensities, you need a 2D matrix

im2D

which will satisfy:

im2D(x,y) = value;

But if you are going to use color, then you could have a 3D matrix satisfying:

im3D(x,y,1) = redValue;
im3D(x,y,2) = greenValue;
im3D(x,y,3) = blueValue;

where value = [redValue,greenValue,blueValue];


"Dominic " <dom_awf@hotmail.com> wrote in message <gv6oo2$6t$1@fred.mathworks.com>...
> Hi,
>
> I have a struct with struct.x, struct.y and struct.value and want to create an image, where (struct.x,struct.y) represent the pixel and the value is interpreted as color or intensity in grey scale.
>
> Is it better to have an 3D Array or doesn't it matter. The size of the picture is usually 512x512.
>
> cheers,
> Dominic

Tags for this Thread

No tags are associated with 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