# C++

## Finding Memory leaking, Stack and Heap overflow

When you access an array index, C and C++ don’t do bound checking. Segmentation faults only happen when you try to read or write to a page that was not allocated (or try to do something on a page which isn’t permitted, e.g. trying to write to a read-only page), but since pages are usually …

## Kalman Filter Explained With Python Code From Scratch

This snippet shows tracking mouse cursor with Python code from scratch and comparing the result with OpenCV. The CSV file that has been used are being created with below c++ code. A sample could be downloaded from here 1, 2, 3. Python Kalman Filter

## Decomposing Projection Using OpenCV and C++

And the output is:

## How to use image_geometry and camera_info_manager in ROS

camera_info_publisher.cpp:

image_geometry_demo.cpp:

CMakeLists.txt

## Open source Structure-from-Motion and Multi-View Stereo tools with C++

Structure-from-Motion (SFM) is genuinely an interesting topic in computer vision, Basically making 3D structure from something 2D is absolutely mesmerizing 🙂 There two open source yet very robust tools for SFM, which sometimes compiling them might be complicated, here I will share my experience with you. 1)VisualSFM Prerequisite: 1)Glew Download the glew from SF at http://glew.sourceforge.net/. Do NOT get it from Github as …

## 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 …

## 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 …

## get template parameter name and type with Boost demangle

Have you ever tied to get the type of a variable by its name? for instance “int”  or “string“? The following code snippet shows how to use boost demangle to get the type: