Distance between two GPS coordinates

For distance between two GPS coordinates as I googled I realized the best method to use is haversine formula.

The haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the sides and angles of spherical “triangles”.

Continue reading

Generating a Google Static Maps API with markers

Go

The Google Static Maps API lets you embed a Google Maps image on your web page without requiring JavaScript or any dynamic page loading. The Google Static Maps API service creates your map based on URL parameters sent through a standard HTTP request and returns the map as an image you can display on your web page.

The Google Static Maps API returns an image (either GIF, PNG or JPEG) in response to an HTTP request via a URL. For each request, you can specify the location of the map, the size of the image, the zoom level, the type of map, and the placement of optional markers at locations on the map. You can additionally label your markers using alphanumeric characters.

In this post I decided to write a function to generating a Google Static Maps with marker as easy as possible here is my version:

Continue reading

Transform rotated image to the original image

For solving part of my problem I needed to find the transformation matrix between the rotated image and its original so I told myself why not write the post in my blog about this problem. For this post I am going to show you how we can transform rotated image to the original image. Let’s start:

close all
clear all
%% Input images.
original_lena=imread('image2.jpg');
rotated_lena=imread('lena.jpg');

Detect features in both images and match the features:

Continue reading

Shape from shading Pentland approach

Pentland used the linear approximation of the reflectance function in terms of the surface gradient, and applied a Fourier transform to the linear function to get a closed form solution for the depth at each point. (Pentland takes the Fourier transform of both sides of the equation). (Pentland, A., “Shape Information From Shading: A Theory About Human Perception,” Computer Vision., Second International Conference on , vol., no., pp.404-413, 5-8 Dec 1988.)

Continue reading