TAG: c++

A little place for me to spew hot crazy on you.

C++11 Convolution

Convolution Image convolution is one the easiest techniques to learn in computer vision and it's a technique that illustrates the power of local feature detection better than weeks of lecture. In principle, convolution involves nothing more than repeatedly applying an NxN matrix to a pixel and its neighbors. Depending on the matrix scalars several different effects can be achieved: Blur Edge Detection <--- Let's focus on this Sharpen Edge detection is one of the fundamental…

Free-Form Deformation Part 2

Awhile back I wrote a short post on free form deformation using the Sederberg/Parry paper Free-From Deformation of Solid Geometric Models.  That version of my code was based on a school project and contained a lot of unnecessary functionality.  So I present you with Free-From Deformation version 2.0.  The unnecessary bits and 3rd party dependencies are gone, replaced by a dependency on Unity3D.  My code is incredibly simple, adapting it to another framework won't…

C++11 Threading

C++11 (C++0x) introduced native support for multihreading.  Prior to this it was necessary to use 3rd party libraries (like pthreads) to write threaded code, but these libraries were OS specific.  Several other libraries, like Boost, did a nice job of wrapping OS specific threading up in to well defined frameworks.  The problem with Boost is it's like replacing a lightbulb with a power company, a glass company, and a company that makes filaments.  What…

Echo Shader: Multiple Echoes

My series(1, 2) on echo shaders has been, by far, the most popular set of posts on this site.  Even more so than the old Ogre+Havok posts, back before Unity saved me from having to write game engines from scratch. :)  Echo Shader version 1.0 served as a simple example that supported only 1 echo source.  Initially I was going to leave my code as-is but several visitors to this site emailed to ask…

Echo Shader: Update

[Update: 7/17/2013] Multiple echo post here. My original echo shader, posted on [7/03/2012], contained a couple of semantic errors that resulted in odd shading when using anything but the default 'White' texture. Below you'll find a simplified version plus a modified example that allows you to switch between textured and untextured shading. I hope that my code has enough comments to suffice as a tutorial of sorts. *Click to launch echo app…

Gaussian Blur

Here is an old script to apply a gaussian blur to an image using a 5x5 convolution matrix (see Kernel as well) based on the following formula: [math]G(x,y)=\frac{1}{2\pi\sigma^{2}}\epsilon^{-(x^{2}+y^{2})/2\sigma^{2}}[/math] Original script used CImg version 1-13 (something like 30 revisions ago :) ) I think my snippet is easy enough to follow that the image library I used shouldn't really matter.…