title: cannot find -lopencv_imgcodecs and -lopencv_videoio when installing caffe
body: <p>I got the problem when installing Caffe with opencv3.0+ and CUDA on Ubuntu 16.04</p>
  
  <p>I also added opencv_imgcodescs and opencv_videoio to my Makefile, but that's not solving the issue.</p>
  
  <p>I have checked several answers on the Caffe user group, but no answers solve my problem. </p>
  
  <p>My error message:</p>
  
  <pre><code>nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
  AR -o .build_release/lib/libcaffe.a
  LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
  /usr/bin/ld: cannot find -lopencv_imgcodecs
  /usr/bin/ld: cannot find -lopencv_videoio
  collect2: error: ld returned 1 exit status
  Makefile:566: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
  make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
  </code></pre>
  
  <p>My setting in Makefile</p>
  
  <pre><code>LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5 opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs opencv_videoio
  </code></pre>
  
  <p>My imgcodecs and videoio is under ~/miniconda2/envs/frcnn/include/opencv2/</p>
  
  <pre><code>(fastrcnn) pohsuan@pohsuan-Predator-G9-592:~/miniconda2/envs/fastrcnn/include/opencv2$ ls
  aruco            dnn.hpp         imgcodecs            photo          structured_light      videostab
  aruco.hpp        dpm.hpp         imgcodecs.hpp        photo.hpp      structured_light.hpp  videostab.hpp
  bgsegm.hpp       face            imgproc              plot.hpp       superres              xfeatures2d
  bioinspired      face.hpp        imgproc.hpp          reg            superres.hpp          xfeatures2d.hpp
  bioinspired.hpp  features2d      line_descriptor      rgbd           surface_matching      ximgproc
  calib3d          features2d.hpp  line_descriptor.hpp  rgbd.hpp       surface_matching.hpp  ximgproc.hpp
  calib3d.hpp      flann           ml                   saliency       text                  xobjdetect.hpp
  ccalib           flann.hpp       ml.hpp               saliency.hpp   text.hpp              xphoto
  ccalib.hpp       fuzzy           objdetect            shape          tracking              xphoto.hpp
  core             fuzzy.hpp       objdetect.hpp        shape.hpp      tracking.hpp
  core.hpp         hdf             opencv.hpp           stereo         video
  cvconfig.h       hdf.hpp         opencv_modules.hpp   stereo.hpp     video.hpp
  datasets         highgui         optflow              stitching      videoio
  dnn              highgui.hpp     optflow.hpp          stitching.hpp  videoio.hpp
  </code></pre>
  
  <p>Where I modified my Makfile.config regarding my Miniconda virtual environment :</p>
  
  <pre><code> ANACONDA_HOME := $(HOME)/miniconda2
   PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
               $(ANACONDA_HOME)/include/python2.7 \
               $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
  
  
  INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial /home/pohsuan/miniconda2/envs/fastrcnn/include
  
  LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /home/pohsuan/miniconda2/fastrcnn/lib
  </code></pre>