Changes between Version 27 and Version 28 of VisionFramework


Ignore:
Timestamp:
Nov 24, 2017, 11:26:10 AM (7 years ago)
Author:
benjialbert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VisionFramework

    v27 v28  
    169169mkdir build
    170170cd build
    171 cmake -DCMAKE_RELEASE_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF ..
     171cmake -DCMAKE_RELEASE_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DWITH_FFMPEG=OFF..
    172172make -j $[$(nproc)+1]
    173173sudo make install
    174174}}}
     175
     176This builds a single shared object file (libopencv_java320.so), a jar file (opencv-320.jar) and a ton of static libraries (*.a)[[BR]]
     177It copies the shared object file and the jar file to the install directory: {{{/usr/local/share/OpenCV/java/...}}}[[BR]]
     178
     179NOTE: we could not get the java wrapper to work with ffmpeg enabled (we ran into a Segmentation fault with opencv libs 3.2.0, 3.3.0, and 3.3.1).  We gave up and disabled it.[[BR]]
     180
     181If you do not want to git clone the master opencv repository, download a zipped version:
     182[https://github.com/opencv/opencv/archive/3.2.0.zip opencv-3.2.0.zip][[BR]]
     183
     184==== Java Projects with OpenCV ====
     185===== Enable VideoCapture =====
     186First, to allow OpenCV VideoCapture to access the ribbon cable camera, run the following command:
     187{{{
     188sudo modprobe bcm2835-v4l2
     189}}}
     190
     191===== Compiling =====
     192{{{
     193javac -d <build_path> -classpath <external_jars> <source_path>/*.java
     194}}}
     195
     196where:
     197* {{{build_path = directory to store class files}}}
     198* {{{external_jars = string specifying individual jar dependencies (such as OpenCV and Pi4J) with delimiters as follows:}}}
     199 * {{{:/path_to_jars/jar1.jar:/path_to_jars/jar2.jar}}}
     200* {{{souce_path = directory containing all of your java files to be compiled}}}
     201
     202We recommend creating a {{{libs}}} folder in which you store all of your external jars such as the {{{opencv-320.jar}}} and all the Pi4J jars rather than having your libraries scattered all over your machine.
     203
     204===== Running =====
     205{{{
     206sudo java -Djava.library.path=<opencv_install_path> -Dpi4j.debug -Dpi4j.linking=dynamic -classpath <external_jars> <Main_class>
     207}}}
     208
     209where:
     210* {{{external_jars = same string that you used in the Compilation step}}}
     211* {{{Main_class = name of the class file with main method}}}
     212 * For example, where {{{Vision.class}}} is the class file, {{{Main_class = Vision}}}