Indoor Map

Indoor Map

Indoor map allows users to accurately show the location indoors which is often not available with GPS.

OpenStreetMap

OpenStreetMap has support for buildings. For example, the commercial building called Citymark Building that our office is situated in:

is a great way of

level_browser

Floorplan Designer

floorplan_designer

Distance Measurement Tools

There are three available functions:

  1. Pixel Measurement - pixel_measurement button for Measuring Pixel
  2. man_button button for Counting Steps
  3. Angle Measurement - Browser Compass

compass

1. Measuring Pixel

The pixel_measurement button allows users to upload photos and measure the number of pixels between 2 points.

upload_image

Select the Choose file button and browse to the image location. Draw a line by selecting two different points and a green line will appear as shown in the image below.

total_px

1V2 means vertical reference of 2 metres high with 1x zoom level landscape.

V2L1 (landscape mode) = horizontal distance x vertical pixel / vertical height
Example: 2.15m x 2965px / 2 = 3187.38

horizontal distance = camera reference x vertical height / vertical pixel
Example: 3187.38 x 2 / 2965px = 2.15m

vertical height = horizontal distance x vertical pixel / camera reference
Example: 2.15m x 2965px / 3187.38 = 2.0m

2. Counting Steps

After the green man_button button is pressed, it will change to orange and shows the number of steps detected. In the example below, the number of steps detected is 7.

compass_on

3. Compass

On iOS, to use the compass, the green man_button button must first be pressed. After the green button is pressed, select Allow if prompted.

motion

On Android, the compass can be used without pressing the green man_button button.

compass_on_android

Angle and Distance Estimation

Distance Marker is an add-on to Image Markers, where the a standard length of an object in the photo is disclosed, so distance between the camera and the object can be calculated.

For example, doors are very often used as Image Markers since they are of similar sizes and universally available indoors across the world. However, a matching photo only indicates that the cameras are in similar location.

Distance Marker can increase the accuracy of Image Markers substantially by providing an exact distance from camera to the Image Marker, instead of just indicating that the mobile phone is "near" an Image Marker.

Distance Capture also enable Image Makers to be used from much further away, even outdoors, to provide backup geo positioning based on vision (in cases where GNSS satellites malfunction or are taken out by war).

visual reference point to a know location for the radio signals collected on the mobile phone.

Calibration Photo

Before taking distance measurement with the camera on your phone, you need to take a calibration photo to determine the Pixels to Metres Ratio of your camera.

This Pixels to Metres Ratio is unique to your camera and you (your height, the way you hold the camera etc.) and will be attached to your Alias. You can take a few more calibration photos to get an average value to increase accuracy, although this is generally not necessary.

Mark Door

Find a door and use a sticky tape or a pencil to make a mark on the vertical part of the door frame at a height of 1 meters from the floor (bottom of the door frame).

If you do not have the tools make your own 1 metre marker on the door frame, you can use the bottom of the door handle or door knob (which is normally approximately 1 metre above the floor).

Stand far enough from the door so the whole door is visible from the camera. Try to take the photo directly in front of the door at 90 degrees, but taking at an angle is also ok. Make sure that the begin and end points of that 2 meters (the mark and the floor) are clearly visible from the camera position.

Measure the distance on the floor between the camera and the door frame (with the marked 2 meters vertical length). Record this Floor Distance in meters for future use.

Take Photo

Take a photo of that 2 meters vertical length using the Photo feature of your Personal Console with the highest resolution camera available on your phone using portrait mode placing the door in the middle of the photo. The photo should show the whole door, with a little space above and below it and more spaces on either side of the door.

Do not use any zoom, you need to use the SAME magnification (focal length) every time.

Measure Pixel

Transfer the resulting photo to the Measure Pixel program that comes with your Personal Console e.g. https://measure.aunsw.88.io/pixel/

With the above Measure Pixel program, you just need to click the begin and end points of the 2 meter length and a green line will be drawn along the 2 meters from one point to another point, the pixels between those 2 points will also be shown to you.

Enter the Floor Distance you measured in step one above and the program will calculate and store the Pixel per Meter Ratio for your camera under your Alias.

Measure Distance

The Pixel per Meter Ratio that is now stored under your Alias can be used to with the length of any object in a photo to estimate the distance between the camera and that object.

If you have more than one camera in your phone, then you need to create a different calibration photo for each extra cameras (they cannot share the same calibration photos).

Due to differences in photographer heights and photo taking styles, other people using your phone to make distance measurements should use different Aliases with their own Pixel to Meter Ratios stored.

Receive New Coordinate

Software

Get Photo Marker coordinates using Camera coordinates.

Note the earth radius is not uniform, for use in these calculation default value is 6,371 km.

PHP

function calculateNewCoordinates($lat1,$long1,$d,$angle)
{
    # Earth Radius in KM
    $R = 6378.14;

    # Degree to Radian
    $latitude1 = $lat1 * (M_PI/180);
    $longitude1 = $long1 * (M_PI/180);
    $brng = $angle * (M_PI/180);

    $latitude2 = asin(sin($latitude1)*cos($d/$R) + cos($latitude1)*sin($d/$R)*cos($brng));
    $longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1),cos($d/$R)-sin($latitude1)*sin($latitude2));

    # back to degrees
    $latitude2 = $latitude2 * (180/M_PI);
    $longitude2 = $longitude2 * (180/M_PI);

    # 6 decimal for Leaflet and other system compatibility
   $lat2 = round ($latitude2,6);
   $long2 = round ($longitude2,6);

   // Push in array and get back
   $tab[0] = $lat2;
   $tab[1] = $long2;
   return $tab;
 }

source: python - Get lat/long given current point, distance and bearing - Stack Overflow

Javascript

function calculateNewCoordinates(lat, lon, distance, bearing) {
    const R = 6371e3; // Radius of the Earth in meters
    const toRadians = degrees => degrees * Math.PI / 180;
    const toDegrees = radians => radians * 180 / Math.PI;

    const bearingRad = toRadians(bearing);
    const latRad = toRadians(lat);
    const lonRad = toRadians(lon);

    const newLatRad = Math.asin(Math.sin(latRad) * Math.cos(distance / R) + 
                                Math.cos(latRad) * Math.sin(distance / R) * Math.cos(bearingRad));
    const newLonRad = lonRad + Math.atan2(Math.sin(bearingRad) * Math.sin(distance / R) * Math.cos(latRad), 
                                          Math.cos(distance / R) - Math.sin(latRad) * Math.sin(newLatRad));

    const newLat = toDegrees(newLatRad);
    const newLon = toDegrees(newLonRad);

    return { latitude: newLat, longitude: newLon };
}

// Example usage:
const originalLat = 51.5074; // Original latitude (London)
const originalLon = -0.1278; // Original longitude (London)
const distance = 1000; // Distance in meters
const bearing = 90; // Bearing in degrees (East)

const newCoords = calculateNewCoordinates(originalLat, originalLon, distance, bearing);
console.log(newCoords);

Photo Marker Distance

To create a Photo Marker you need to take the photo of the object from the distance using the camera len that have the Pixel per Metre Ratio stored.

Step Length

We are using 0.7 meters as default step length (but average length between 0.6 to 0.8 meters are quite common).

Pick a step measure process that is the most comfortable to you and you can reproduce the easiest. You can then use the same process every time to give you the an approximate distance between the object in photo and the position you took the photo from.

A sample process using your RIGHT foot for measuring distance ot an object:

  1. Facing away from the object, put the heel of your RIGHT foot against the object (e.g. a side of the door frame).
  2. Put both feet together (bring left foot next to right foot).
  3. Start with the LEFT foot walk in a straight line towards the spot you will be taking photo from.
  4. Talk an EVEN number of steps (e.g. 6 steps), landing on your RIGHT foot.
  5. Enter the number of steps you have taken above into the Photo Marker application.

To take the photo from that many steps away from the Object:

  1. Turn around 180 degrees (so you end up facing the object that you originally started out from) - keep your RIGHT foot in place and rotating on top of the middle of your RIGHT foot by moving your LEFT foot around it.
  2. Select the the camera len (the zoom level) that you have the Distance Ratios stored.
  3. Use that camera len to take photo of the Object in Landscape mode, placing the object in the middle photo.

After you have taken the photo you can OPTIONALLY walk back toward the Object to confirm the number of steps - starting with the LEFT foot, after walking the same number of steps, the toe of your RIGHT foot should more or less touch the Object.

From this position you can take a take a photo of the door using the Calibrated Zoom Level.