Tag Archives: cpp

Basename and Dirname

Often the unix commands basename and dirname are useful in shell scripts, but how do you use these in c or c++?. The C way: libgen.h If you’re working in c, the posix header libgen.h provides dirname and basename functions, with some limitations: They only work with char *, and dirname will modify the char * you pass into it … Continue reading

Posted in <code> | Tagged , , , , , , , , , | Leave a comment

OpenCV: Corner Detection Using cvGoodFeaturesToTrack

Here’s an example opencv application which uses cvGoodFeaturesToTrack to detect corners in a webcam video feed. download good_features.cpp source // // This code displays corners found by the opencv function // GoodFeaturesToTrack (cvGoodFeaturesToTrack) // // Sample webcam code taken from // http://www.cs.iit.edu/~agam/cs512/lect-notes/ // opencv-intro/opencv-intro.html#SECTION00070000000000000000 // // compile with: // gcc `pkg-config –cflags opencv` `pkg-config –libs opencv` // -o good_features good_features.cpp … Continue reading

Posted in <code> | Tagged , , , , , , , , , , , , | 10 Comments
<RSS Feed>