I really need a help on image processing


#1

Hi all, I was having a tutorial for image processing. The problem is I’m so stuck with the questions. Well, maybe it is so easy peasy for some of you. I’m such a newbie on this field. :argh: :argh: :argh:

the tutorial question:
an example:
sensorData[0] represents cell [0,0];
then
sensorData[0] = 50;//red

1)if sensorData[0] is for cell[0,0], then what is the corresponding sensorData array index for the following:
a) cell[12,25]
b)cell[25,25]
c)cell[5,5]

  1. whats the general equaltion for mapping array index for sensorData array with cell[…,…] array

pls guys…pls…I’m so stuck…


#2

You are probably best asking your tutor, that’s what they are there for.


#3

Sounds like a simple serialisation question, and faster/slower array walking.

IE: If you have an NxM two dimensional array, and the first digit of a look-up is the position in X on the table, the second its Y, it will be an X fastest array(every increment in x corresponds to M increments along the Y serie).

The conversion is a simple serialisation of that table into a one dimensional sequence.

In general to answer that you need to know how you are serialising, but assuming the standard NxM X faster than Y, you can use something like:
i = X*M + Y
Basically that means every time you advance in X, you advance in the serie by the length along X (or the number of Y entries in that X), then add the Y to find the offset within that line.

That’s columns then rows, if you scanline top to bottom then usually X will be slower than Y, as a hop down by one line will be N pixels on X jumped.

edit: btw, if you’re already finding it an obstacle to map a 2d table to a serie, and you’re taking programming classes, you might want to go back to some fundamentals in a hurry. This isn’t really image manipulation specific, this is very, very simple arithmetics behind data models and data management ABC.


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.