admin

Finding Homography Matrix using Singular-value Decomposition and RANSAC in OpenCV and Matlab

Solving a Homography problem leads to solving a set of homogeneous linear equations such below: \begin{equation} \left( \begin{array}{ccccccccc} -x1 & -y1 & -1 & 0 & 0 & 0 & x1*xp1 & y1*xp1 & xp1\\ 0 & 0 & 0 & -x1 & -y1 & -1 & x1*yp1 & y1*yp1 &  yp1\\ -x2 & -y2 &

Finding Homography Matrix using Singular-value Decomposition and RANSAC in OpenCV and Matlab Read More »

Finding Affine Transform with Linear Least Squares

linear least squares is a method of fitting a model to data in which the relation between data and unknown paramere can be expressed in a linear form. \( Ax=b\) \( X^{*}= \underset{x}{\mathrm{argmin}}= \|Ax-b\|^{2} =(A^{T}A)^{-1}A^{T}b \)

And testing the code:

 

Finding Affine Transform with Linear Least Squares Read More »

Examples of Dynamic Programming with C++ and Matlab

In this tutorial, I will give you examples of using dynamic programming for solving the following problems: 1)Minimum number of coins for summing X.

  2)The most (least) costly path on a grid (dynamic time warping).

  3)Levenshtein edit distance.

  4)Seam Carving. I have written a tutorial on that

Examples of Dynamic Programming with C++ and Matlab Read More »

Peak Signal-to-Noise Ratio (PSNR) in Image using OpenCV and Matlab

Peak signal-to-noise ratio (PSNR) shows the ratio between the maximum possible power of a signal and the power of the same image with noise. PSNR is usually expressed in logarithmic decibel scale. \( MSE =1/m*n \sum_{i=0}^{m-1} \sum_{j=0}^{n-1}  [   Image( i,j)  -NoisyImage( i,j)  ]  ^2   \) \( PSNR =10* \log_{10} \Bigg(MAXI^2/MSE\Bigg)  \) MSE is Mean Square Error and MAXI is

Peak Signal-to-Noise Ratio (PSNR) in Image using OpenCV and Matlab Read More »

Seam Carving Algorithm for Content-Aware Image Resizing with Matlab Code

Seam carving is an algorithm for resizing images while keeping the most prominent and conspicuous pixels in the image. The important pixels in an image are usually those who are located over horizontal or vertical edges, so to throw away some pixels we first find horizontal and vertical edges and store their magnitude as pixel

Seam Carving Algorithm for Content-Aware Image Resizing with Matlab Code Read More »

Populating directed graph in networkx from CSV adjacency matrix

Populating directed graph in networkx from CSV adjacency matrix Read More »

Drawing graphs in Python with networkx

Drawing graphs in Python with networkx Read More »

Hierarchical Clustring in python

Hierarchical Clustering is a method of clustering which build a hierarchy of clusters. It could be Agglomerative or Divisive. Agglomerative: At the first step, every item is a cluster, then clusters based on their distances are merged and form bigger clusters till all data is in one cluster (Bottom Up). The complexity is \( O (n^2log(n) ) \). Divisive: At the beginning,

Hierarchical Clustring in python Read More »