just open file called /etc/ld.so.conf.d/opencv.conf, then insert
/usr/local/opencv/
then type: sudo ldconfig