# Algorithms

## Computing the discrete Fréchet distance using dynamic programming

Definition The Fréchet distance is usually explained using the analogy of a man walking his dog. A man is walking a dog on a leash: the man can move on one curve, the dog on the other; both may vary their speed, but backtracking is not allowed. What is the length of the shortest leash …

## Stroke width identification algorithm for text like regions

In character recognition, the distance between two edges of a stroke, measured perpendicular to the stroke centerline is called the stroke width. Take a look at the below image. The length of lines marked in Red gives the stroke width of the character. There are quite a few ways to identify the stroke width, In …

## Otsu’s method for image thresholding explained and implemented

The process of separating the foreground pixels from the background is called thresholding. There are many ways of achieving optimal thresholding and one of the ways is called the Otsu’s method, proposed by Nobuyuki Otsu. Otsu’s method is a variance-based technique to find the threshold value where the weighted variance between the foreground and background …

## Fast nth Fibonacci number algorithm

Definition: The Fibonacci sequence is defined by the equation, where $$F(0) = 0$$, $$F(1) = 1$$ and $$F(n) = F(n-1) + F(n-2) \text{for } n \geq 2$$. This gives us the sequence 0,1,1,2,3,5,8,13 … called the Fibonacci Sequence. This post is about how fast we can find the nth number in the …