You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, March 14th 2011, 10:22pm

Angle of panormaic images

Hi,

I have a lot of panoramic images which are assigned to coordinates, do you have any suggestion/advise how can i calculate the arrow direction to enable to go the next panorama?

Thanks in advance!

This post has been edited 2 times, last edit by "Gulsun" (Mar 15th 2011, 8:12am)


Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

2

Tuesday, March 15th 2011, 10:14am

you need to know the y distans (long1 - long2) and the distance(lat1 - lat2) and then perform a tanges to know the angle between these points.

Alsoo this is a good site: http://www.movable-type.co.uk/scripts/latlong.html

search for bearing.

3

Tuesday, March 15th 2011, 10:33am

Hi,

Thanks for answer! I have also tried some ways (postgis, bearing calculation) but i dont know how can i show this result as arrow in krpano (ath/atv or rotate)?

best regards
Gülsün

spacerywirtualne

Professional

Posts: 988

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

4

Tuesday, March 15th 2011, 10:50am

plugin

Hi.

I have KRpano plugin who automatically calculates the distance between two markers.

example no javascript *cool*

The result given in kilometers in miles.

pietero

edit:

I used this formula.
ACOS(SIN(lat1)*SIN(lat2)+COS(lat1)*COS(lat2)*COS(lon2-lon1))*6371
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

5

Tuesday, March 15th 2011, 11:22am

Hi spacerywirtualne,

Your plugin is not for download or? Anyway i need a solution to show my arrow direction in krpano automatically. Is there any way to draw a line between two lat/lon(maybe it is a solution)? Or bearing is really for me a solution?

Is there nobody who really worked with lat/lon?

Thanks in advance!

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

6

Tuesday, March 15th 2011, 11:42am

once you have the bearing, you can make a arrow hotspot pointing up, you then can use ath for the bearing (north being at 0)

7

Tuesday, March 15th 2011, 1:46pm

Hi Zephyr,

Thanks for answer! What do you exactly mean with (north being at 0)?

My Problem is;

if my way horizantal like this bearing from X to x2 => 90 and from X to x3 => 270. I see my arrow in left and right not in front of my car. (my arrow in the wrong place)

--------------------------------------------
x1 X x2
--------------------------------------------

if my way; X to X1 => 0 and X to X2 => 180. And my arrow in the right place, in front or back of my car.

| x1 |
| |
| X |
| |
| x2 |
| |

Do you have any advice? Thanks a lot!

Gülsün


My code calculating bearing in java
double dLon = Math.toRadians(Double.valueOf(point2.getLon())-Double.valueOf(point1.getLon()));

double y = Math.sin(dLon) * Math.cos(Double.valueOf(point2.getLat()));
double x = Math.cos(Double.valueOf(point1.getLat()))*Math.sin(Double.valueOf(point2.getLat())) -
Math.sin(Double.valueOf(point1.getLat()))*Math.cos(Double.valueOf(point2.getLat()))*Math.cos(Double.valueOf(dLon));
double brng = Math.atan2(y, x);
return (Math.toDegrees(brng));

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

8

Tuesday, March 15th 2011, 2:53pm

with north = 0, I mean that you should align your panorama so, that the center of the image is your north bearing (so in krpano ath = 0 = north)

see attachmebnt for image
Zephyr has attached the following image:
  • Untitled-1.jpg

9

Tuesday, March 15th 2011, 4:59pm

Hi Zephyr,

Firstly thanks for answer but i cannot understand exactly, what do you mean?

I have to change my latitude and longitude for aliging to north 0? Because i tried your formula but it does not work for me. Or i have to calculate bearing of my lat/lon to north.

best regards
Gülsün

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

10

Tuesday, March 15th 2011, 8:25pm

A panorama is just an image. YOU have to say, my car is north or northwest. Else you can just put your panorama upside down and make it black :P Only then you can start putting hotspots down on base of long/lat.

11

Wednesday, March 16th 2011, 11:46pm

Thanks for answer :) i unterstand now :)

12

Wednesday, July 20th 2011, 1:47am

orienting panoramas

with north = 0, I mean that you should align your panorama so, that the center of the image is your north bearing (so in krpano ath = 0 = north)
Hello, I have the problem of having two panoramas wich are not align to same 'north', meaning, the ath = 0 is looking at different directions in both panos. this is a problem when going from one pano to the next, since they are no aligned to eacht other.

how can i correct this? some correction factor, so ath=0 is lookint at the real north in both panoramas.

thanks

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

13

Wednesday, July 20th 2011, 11:19am

Best way is photoshop. But krpano provides a parameter to adjust the rotation:
http://krpano.com/docu/xml/#image.prealign