The 'pixdeg' param is used only if you are using the FloorPlan applet
along with PMVR. In fact, using the 'pixdeg' param is the trigger/flag to
PMVR to look for and use the FloorPlan applet.
By reading this
discussion and following the interactive demo below, you will gain an
understanding on how to use the 'pixdeg' applet parameter to set viewing
direction and correct for image/map imperfections.
Please note that this interactive demo requires that your browser supports
JavaScript (most browsers do).
PMVR / Panorama
FloorPlan / Map
pixdeg parameter
The 'pixdeg' parameter is an ordered list of 'pixel'='degree' (ordered by
pixel number, separated by commas).
Namely, you need to provide PMVR a list of: "When you are looking at pixel
'pixel' in the panorama, draw a line in direction 'degree' on the map".
At a minimum, the first and last pixel of an image must be specified. PMVR
will then automatically calculate the direction of all other pixel locations.
Interactive Demo
To avoid having to scroll up/down a lot, I recommend printing this page and
reading the discussion below while the above panorama and map are
displayed in your browser window.
Notice the 'pixdeg' edit box above. This gives you direct interactive
control over the 'pixdeg' parameter in the applet, which the demo below
uses.
Click in the panorama picture above and then press the 'd' key on your
keyboard. You will see
a debug specification that lists the leftmost and rightmost pixels
displayed along with the degree (angle) that pixel represents (angles
will only be displayed if a 'pixdeg' param is configured).
NOTE: The degree system used (0-359) is
right=0°, up=90°, left=180°, down=270° as illustrated below:
This debug display ('d') is a 'must-have' tool when creating the 'pixdeg'
specification. Also, note that pressing the left and right arrows on
your keyboard scrolls the image by one pixel. Holding shift down when
pressing the arrows scrolls by ten pixels. You now know how to discover
the 'pixel' component of a 'pixel'='degree'.
To discover the 'degree' component of a 'pixel'='degree', the FloorPlan has
a debug tool that will allow you to decide which degree to use. Just
right-click-drag within the FloorPlan around the hilight dot. A line
will appear on the FloorPlan along with the degree that line represents.
Just drag around until you are happy with where the line is and you have
found the 'degree' you are looking for. NOTE: This FloorPlan debug tool
was added in version 2.5d.
The first step when creating a new 'pixdeg' parameter is to point
the first and last pixel of a panorama in the proper direction.
Namely, pixel 0 in the panorama should cause a line on the map
in what direction?
Use the left/right arrows (as described in the step one) to
move the panorama so that pixel 0 is the leftmost pixel (Left: 0).
In what direction on the map do you think pixel 0 in the
panorama is facing?
Just right-click-drag within the FloorPlan until you think the
FloorPlan line matches where pixel 0 in the panorama (the left edge of
the panorama) should be located. You should play around a little bit,
but I think the line matches fairly well at 76°. So our first
'pixel=degree' is '0=76. And since the panorama is a 360° panorama,
the first and last panorama pixels must point in the same direction.
The panorama above is 2304 pixels
wide, so our next 'pixel=degree' is '2304=76'.
We now have an initial pixdeg of "0=76,2304=76". Many 'pixel=degree' are
added into the same list be separating each entry by a comma and entries
are placed into the list in pixel order. Namely, place entries into the
list so that the pixel component of each entry keeps increasing (2304 comes
after 0).
Press the 'Step2' link above (just below the panorama) to use this first pixdeg.
You will see a hilight on the floor plan image appear and
the left line of the hilight arc points at 76°, just
as we told it to with this pixdeg.
With a perfect panorama and a perfect map, you are done. However
most images are not perfect, so some correction hints are needed. Scroll
in the panorama above and try to find locations where the map
hilight lines do not match what is viewed within the panorama.
Where you might immediately notice imperfections is in 'significant features'
such as corners of rooms, doorways, columns, etc. It is hard to notice
imperfections on a wall or other surface without 'significant features'.
So, if you correct at a couple of 'significant features' in the image, the
entire image will look much better.
For example, in the panorama above, click in the panorama and
scroll so that the leftmost pixel is 570. In the panorama, you should
see that pixel 570 (the left edge in the viewer) is directly
in the middle of a porch column. However, the left line of the hilight
arc on the FloorPlan does not go directly over the porch column on the map.
To correct, we need to add an entry into the pixdeg that states in what
direction panorama pixel 570 should point.
Just right-click-drag in the FloorPlan until you find the correct
angle. I think the line at 354° looks good. So "570=354" has to be
added into the pixdeg. Since entries are in pixel order (and 570 is
after 0, but before 2304), our new pixdeg is "0=76,570=354,2304=76".
Press the 'Step3' link above (just below the panorama) to see this. You will see the hilight arc
on the FloorPlan adjust to this new pixdeg and the hilight arc on the
map now looks correct.
Now let's perform the exact same type of correction for the column
at pixel location 1680, but this time with the rightmost edge of
the panorama display. Click in the panorama and use the
left/right arrows to position the rightmost pixel in the panorama
to pixel 1680. Now, the right line of the hilight arc on the FloorPlan
does not go directly over the porch column.
Just right-click-drag in the FloorPlan until you find the correct
angle. I think the line at 186° looks good. So "1680=186" has to be
added into the pixdeg in the proper location (1680 is after 570, but
before 2304).
Press the 'Step4' link above (just below the panorama) to see this and the new 'pixdeg' of
"0=76,570=354,1680=186,2304=76". Again, the hilight arc on the FloorPlan
adjusts to this new pixdeg.
That is it! You should now be able to use the 'pixdeg' parameter
by yourself. Please play around with the pixdeg edit box above and
press 'SET' to make your change. However, please note that to keep
the PMVR program very small, there is not much error checking, so
entering a 'pixdeg' that is not pixel ordered or is not in the proper
format will result in 'undefined' behavior.
Final TIP: The first step in creating a pixdeg is to define the
degrees of the first and last panorama pixel locations. Then, check the
panorama and apply corrections as needed. Note: It helps a lot to pick
a pixel correction point (that is a significant feature) that is as close
as possible to a mid-way point between existing pixdeg adjustments --
because correcting at a mid-way point many times adjusts the whole area.
Repeat as needed.