Posts

Showing posts from May, 2016

NVidia Driver Status Linux Commands & Headless X11

This is a short post listing the ways to check the NVidia driver status at different levels of the Linux system.

Prepared as gist


Little hack for C++ function replacement in OpenCV

This is a small post on using shared library preloading for replacing a C++ function by another for filtering the OpenCV behavior. In particular we are disabling imshow.

The trick is based on LD_PRELOAD plus dlsym, and it needs to be customized by function lookup due to C++ mangling

Target:

#include <opencv2/opencv.hpp>intmain(int argc,charconst*argv[]){auto p = cv::imread(argv[1],0); cv::imshow("ciao",p); cv::imshow("!ciao2",p); cv::waitKey(0);return0;}

The source code can be found: https://github.com/eruffaldi/redirectcv

Note that for building this example uses cmakego