# Re: Image Shifting

In article <1182275601.543955.184870@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
chirag sehgal <chiragsehgal@xxxxxxxxx> wrote:

no i dont want to shift the color or anything....i have converted all
the necessary points into white and the rest of the image is black
now i want to calculate the shift of each white pixel by shifting the
2nd image and try to compare it with the 1st image, so that i can get
the average motion

i am using this approach coz there are a lot of new white pixels that
gets generated in the 2nd picture, so i have to take some sort of a
mean of all these white pixels

Well, that's clearer in some ways, but not in others.

I gather that you identify a bunch of items in the first image
and colour them white and the rest of that image black. And I
gather that you identify a bunch of items in the second image
and colour them white and the rest of that image black.
And I gather that items in the second image might have moved
relative to their positions in the first, and that there are
identified items in the second image that do not exist in the first.

What I am not clear on -includes- (but is not limited to!):

- do the items move independantly or as a group?

- do the items maintain their same orientation between the images?
The same scale?

- however the items are being identified: is the boundary finder
robust, always finding the same boundary, or are there difficulties
such as changing lighting (that affected boundary identification),
or difficulties such as items having moved close enough together to now
be identified as a single item?

- are all the items in the first image certain to be present in the second?

- is it a matter -conceptually- of moving the second image
until you find an exact copy of the first image within it, and then
you measure the (X,Y) distance of the shift, ignoring the white parts
in the second image that didn't have a match in the first?

- if not, then what kind of measure do the new white parts contribute?
Ideally if you were able to track every object in the first image
over into the second image, you could measure the average motion
ignoring the additional objects of the second image, but if you
can't do that kind of tracking reliably, then the more additional
objects that appeared in the second image, the less reliable would
be the average distance measure, since you would have a lot of noise

- if items move independantly, is there a scheme for tracking them
into a (single) location in the second image, or a probabilistic
weighting scheme if it is uncertain which second-image object
corresponds to a first-image object?

- if items move independantly, do they all move at -about- the same
velocity, or could some have zipped most of the way across the image
while others stayed still? Do they move at constant (independant)
speeds or might they have moved irregularly?

- in tracking where objects moved to, is it to be assumed that
objects cannot have crossed each other (i.e., occupy physical space),
thereby putting constraints on the tracking of objects from one frame
to the other? If so, then does there need to be a path plausibility
check, something like "If A was moving across at this speed, then
if B headed diagonally at this velocity for a while, it could have cut
around the far corner of A and turned and made it to this location
within the time/velocity constraints even though the straight path
at first appears to indicate that B would have had to go through A
to get where it is hypothesized to have ended up" ?
--
Is there any thing whereof it may be said, See, this is new? It hath
been already of old time, which was before us. -- Ecclesiastes
.

## Relevant Pages

• Re: Image Shifting
... mean of all these white pixels ... I gather that you identify a bunch of items in the first image ... And I gather that items in the second image might have moved ... can't do that kind of tracking reliably, ...
(comp.soft-sys.matlab)
• Re: How to merge JPG Files?
... You can use The GIMP, which is Open Source and available for Linux, ... I might want to center it horizontally above the second image I'll ... GIMP Toolbox has changed. ... In the first image ...
(comp.graphics.misc)
• Re: How to do this TD trick with CSS
... By wrapping the text and the image in a containing DIV then regardless if you have a small or large amount of associated text it will stay together with the image when the image is floated. ... If you follow with a second image and the view port is too small to accommodate the second image to the right of the first it will push to the left margin under the first image. ...
(alt.html)
• PIL 1.1.4 paste PNGs with transparency problem
... The 2nd image has an alpha channel with transparency. ... the second image appear as a grey-crosshatching pattern. ... original first image would peer through the transparent bits of the ...
(comp.lang.python)