September 2017

Hamming distance calculation

This is a small snippet of how to calculate hamming distance in cpp with small bit of assembly for doing a population count. Code typedef unsigned long long hash_t; #include #include int popcount64(const hash_t& val) noexcept { int ret; __asm__ (“popcnt %1, %1” : “=r” (ret) : “0” (val)); return ret; } int hamming_distance(const hash_t& … Read more

Histogram Comparison for Image Analysis

DRAFT This is the first article in the series on Image Comparison using Local Binary Patterns.Complete code is on github lbp-matcher We will start off by looking at different methods of comparing histograms. Histogram Intersection Log Likehood Chi Squared Kullback Leibler Divergence All our operations will be performed on 8bpp(bits per pixel) images anything that … Read more