Panorama

Panorama

Post by replma » Sun, 13 Jul 2003 20:56:06



"Hello World\n",

i would like to make a panorama 360 degree application.
The panorama image has a size of 1471 x 200 pixels. My application should
show
an area of 320 x 200 pixels. The panorama-image is photographed using a
35mm-Objektiv.
Can anyone help me with the mathematics? I searched the internet for
several hours
but either i used the wrong search criterion or there is not so much
information about this.

This is what i would like to do:

panorama[1471][200]

for (int j=0;j<200;j++) {
  for (int i=0;i<320;i++) {
     pixel[i][j]=panorama[???][???];
  }

Quote:}

Thx,
Florian
 
 
 

Panorama

Post by Dmytry Lavro » Sun, 13 Jul 2003 23:56:47



> "Hello World\n",

> i would like to make a panorama 360 degree application.
> The panorama image has a size of 1471 x 200 pixels. My application should
> show
> an area of 320 x 200 pixels. The panorama-image is photographed using a
> 35mm-Objektiv.
> Can anyone help me with the mathematics? I searched the internet for
> several hours
> but either i used the wrong search criterion or there is not so much
> information about this.

> This is what i would like to do:

> panorama[1471][200]

> for (int j=0;j<200;j++) {
>   for (int i=0;i<320;i++) {
>      pixel[i][j]=panorama[???][???];
>   }
> }

> Thx,
> Florian

K.I.S.S.

 for (int j=0;j<200;j++) {
   for (int i=0;i<320;i++) {
      pixel[i][j]=panorama[(i+angle_in_degrees*1471/360)MOD 1471][j];
   }
 }
- all what you need is to linear shift image by 0 at 0 degrees,and 1471
at 360.
here angle of screen wision is given by
320* 360/1471

i'm is a pascal programmer,i don't sure if "MOD" named "MOD" in C ,"MOD"
mean _remainder_of_division_ ( (1471+320) mod 1471 == 320 ) .

Dmytry Lavrov.

http://dmytrylavrov.narod.ru

 
 
 

Panorama

Post by replma » Sun, 13 Jul 2003 23:08:33



> for (int j=0;j<200;j++) {
> for (int i=0;i<320;i++) {
> pixel[i][j]=panorama[(i+angle_in_degrees*1471/360)MOD 1471][j];
> }
> }
> - all what you need is to linear shift image by 0 at 0 degrees,and 1471
> at 360.
> here angle of screen wision is given by
> 320* 360/1471

Ok, but this is a very simple panorama which doesn't give the illustration
that you stand somewhere and look around.

Quote:> i'm is a pascal programmer,i don't sure if "MOD" named "MOD" in C ,"MOD"
> mean _remainder_of_division_ ( (1471+320) mod 1471 == 320 ) .

in C modulo (mod) is done via % (8%3=2)

Thank you!
Florian

 
 
 

Panorama

Post by Dmytry Lavro » Mon, 14 Jul 2003 01:45:40




> > for (int j=0;j<200;j++) {
> > for (int i=0;i<320;i++) {
> > pixel[i][j]=panorama[(i+angle_in_degrees*1471/360)MOD 1471][j];
> > }
> > }
> > - all what you need is to linear shift image by 0 at 0 degrees,and 1471
> > at 360.
> > here angle of screen wision is given by
> > 320* 360/1471
> Ok, but this is a very simple panorama which doesn't give the illustration
> that you stand somewhere and look around.

Hmm,problem that screen to eye distance may vary,screen size too,

but if you want you can use
for (int i=0;i<320;i++){

float_pixelangle=arctan((i-160)/(screen_to_eye_distance_in_screen_pixels))

x=float_to_integer_conversion_in_C((float_pixelangle+float_wiew_angle)/pi*1471);
 if(x>1471){x=x-1471}
 if(x<0){x=x+1471}

 for (int j=0;j<200;j++){
  pixel[i][j]=panorama[x][j];
 }

Quote:}  

-it will be correct if screen is a plane and panoram is a cylinder.

Your panoram composed from some planar images,right?
Matrix in cam is not a cylinder.So, this algorithm is not more correct
than previous.But  far more complex.You should have some planar images
rather than panoram(or at least you should know where one image started
and where another)to correctly convert set_of_images into _cylindrical_
panoram.
In case when panoram is simply set of planar images,it's n-gon
panoram,not cylinder...

first alg assumes that screen and pan is a cylinders..or both are
parallel planes.When you're looking into center of image from cam,first
will be correct.Second newer will be correct if panoram is not
cylindrical...

Second alg in reverse(panorama[x][j]=picturepixel[i][j]) is how you can
convert set of pictures into cylindrical panoram

(of course you can pre-convert it with some already avaliable software)

Quote:> > i'm is a pascal programmer,i don't sure if "MOD" named "MOD" in C ,"MOD"
> > mean _remainder_of_division_ ( (1471+320) mod 1471 == 320 ) .
> in C modulo (mod) is done via % (8%3=2)

> Thank you!
> Florian

--
-
http://dmytrylavrov.narod.ru
 
 
 

Panorama

Post by Hans-Bernhard Broeke » Tue, 15 Jul 2003 07:39:22



> for (int j=0;j<200;j++) {
>   for (int i=0;i<320;i++) {
>      pixel[i][j]=panorama[???][???];

It's not quite as simple as that.  The correct mapping from panorama
pixels to screen pixels is nonlinear --- it's the projection of 2D
points on a circular arc on to a line.  Imagine the panorama glued to
interior wall of a cylindrical building, just like it used to be done
on the original (painted) panorama images.  What you're doing is
equivalent to taking a photo of that curved wall.

You also lack some input, mainly the field-of-view angle and the
direction the viewer is currently looking.
--

Even if all the snow were burnt, ashes would remain.