Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Allied Visions Vimba API preset #521

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions opencv/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if [[ -z "$PLATFORM" ]]; then
exit
fi

if ! [ -d "$PLATFORM$EXTENSION" ]; then

OPENCV_VERSION=3.4.0
download https://github.com/opencv/opencv/archive/$OPENCV_VERSION.tar.gz opencv-$OPENCV_VERSION.tar.gz
download https://github.com/opencv/opencv_contrib/archive/$OPENCV_VERSION.tar.gz opencv_contrib-$OPENCV_VERSION.tar.gz
Expand All @@ -24,7 +26,7 @@ patch -Np1 < ../../../opencv_contrib.patch
cd ../opencv-$OPENCV_VERSION
patch -Np1 < ../../../opencv.patch

BUILD_CONTRIB_X="-DBUILD_opencv_stereo=OFF -DBUILD_opencv_plot=ON -DBUILD_opencv_fuzzy=OFF -DBUILD_opencv_aruco=OFF -DBUILD_opencv_adas=OFF -DBUILD_opencv_bgsegm=OFF -DBUILD_opencv_bioinspired=ON -DBUILD_opencv_ccalib=OFF -DBUILD_opencv_datasets=OFF -DBUILD_opencv_dnn_modern=OFF -DBUILD_opencv_freetype=OFF -DBUILD_opencv_dpm=OFF -DBUILD_opencv_face=ON -DBUILD_opencv_latentsvm=OFF -DBUILD_opencv_line_descriptor=OFF -DBUILD_opencv_matlab=OFF -DBUILD_opencv_optflow=ON -DBUILD_opencv_reg=OFF -DBUILD_opencv_rgbd=OFF -DBUILD_opencv_saliency=OFF -DBUILD_opencv_surface_matching=OFF -DBUILD_opencv_text=ON -DBUILD_opencv_tracking=ON -DBUILD_opencv_xfeatures2d=ON -DBUILD_opencv_ximgproc=ON -DBUILD_opencv_xobjdetect=OFF -DBUILD_opencv_xphoto=OFF -DWITH_LAPACK=OFF"
BUILD_CONTRIB_X="-DBUILD_opencv_stereo=OFF -DBUILD_opencv_plot=ON -DBUILD_opencv_fuzzy=OFF -DBUILD_opencv_aruco=OFF -DBUILD_opencv_adas=OFF -DBUILD_opencv_bgsegm=OFF -DBUILD_opencv_bioinspired=ON -DBUILD_opencv_ccalib=OFF -DBUILD_opencv_datasets=OFF -DBUILD_opencv_dnn_modern=OFF -DBUILD_opencv_freetype=OFF -DBUILD_opencv_dpm=OFF -DBUILD_opencv_face=ON -DBUILD_opencv_latentsvm=OFF -DBUILD_opencv_line_descriptor=OFF -DBUILD_opencv_matlab=OFF -DBUILD_opencv_optflow=ON -DBUILD_opencv_reg=OFF -DBUILD_opencv_rgbd=OFF -DBUILD_opencv_saliency=OFF -DBUILD_opencv_surface_matching=OFF -DBUILD_opencv_text=ON -DBUILD_opencv_tracking=ON -DBUILD_opencv_xfeatures2d=ON -DBUILD_opencv_ximgproc=ON -DBUILD_opencv_xobjdetect=OFF -DBUILD_opencv_xphoto=ON -DWITH_LAPACK=OFF"

GPU_FLAGS="-DWITH_CUDA=OFF -DWITH_OPENCL=ON"
if [[ "$EXTENSION" == *gpu ]]; then
Expand Down Expand Up @@ -54,7 +56,8 @@ case $PLATFORM in
make install/strip
;;
linux-x86_64)
CC="gcc -m64" CXX="g++ -m64" $CMAKE -DCMAKE_INSTALL_PREFIX="$INSTALL_PATH" -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_JASPER=ON -DBUILD_JPEG=ON -DBUILD_WEBP=ON -DBUILD_OPENEXR=ON -DBUILD_PNG=ON -DBUILD_TIFF=ON -DBUILD_ZLIB=ON -DBUILD_opencv_java=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_hdf=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DWITH_1394=OFF -DWITH_FFMPEG=OFF -DWITH_GSTREAMER=OFF -DWITH_OPENMP=ON $GPU_FLAGS -DCUDA_HOST_COMPILER=/usr/bin/g++ -DWITH_IPP=OFF ${BUILD_CONTRIB_X} -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-$OPENCV_VERSION/modules
# Note: -DENABLE_CXX11=ON is for tesseract 4.0 support
CC="gcc -m64" CXX="g++ -m64" $CMAKE -DCMAKE_INSTALL_PREFIX="$INSTALL_PATH" -DENABLE_CXX11=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_JASPER=ON -DBUILD_JPEG=ON -DBUILD_WEBP=ON -DBUILD_OPENEXR=ON -DBUILD_PNG=ON -DBUILD_TIFF=ON -DBUILD_ZLIB=ON -DBUILD_opencv_java=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_hdf=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DWITH_1394=OFF -DWITH_FFMPEG=OFF -DWITH_GSTREAMER=OFF -DWITH_OPENMP=ON $GPU_FLAGS -DCUDA_HOST_COMPILER=/usr/bin/g++ -DWITH_IPP=OFF ${BUILD_CONTRIB_X} -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-$OPENCV_VERSION/modules
make -j $MAKEJ
make install/strip
;;
Expand Down Expand Up @@ -110,4 +113,6 @@ case $PLATFORM in
;;
esac

fi

cd ../..
94 changes: 94 additions & 0 deletions opencv/src/main/java/org/bytedeco/javacpp/opencv_text.java
Original file line number Diff line number Diff line change
Expand Up @@ -2149,4 +2149,98 @@ public native void run(@ByRef Mat image,
// #endif // _OPENCV_TEXT_OCR_HPP_


// Parsed from <opencv2/text/textDetector.hpp>

// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.

// #ifndef __OPENCV_TEXT_TEXTDETECTOR_HPP__
// #define __OPENCV_TEXT_TEXTDETECTOR_HPP__

// #include "ocr.hpp"

/** \addtogroup text_detect
* \{
<p>
/** \brief An abstract class providing interface for text detection algorithms
*/
@Namespace("cv::text") public static class TextDetector extends Pointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public TextDetector(Pointer p) { super(p); }

/**
\brief Method that provides a quick and simple interface to detect text inside an image
<p>
@param inputImage an image to process
@param Bbox a vector of Rect that will store the detected word bounding box
@param confidence a vector of float that will be updated with the confidence the classifier has for the selected bounding box
*/
public native void detect(@ByVal Mat inputImage, @ByRef RectVector Bbox, @StdVector FloatPointer confidence);
public native void detect(@ByVal Mat inputImage, @ByRef RectVector Bbox, @StdVector FloatBuffer confidence);
public native void detect(@ByVal Mat inputImage, @ByRef RectVector Bbox, @StdVector float[] confidence);
public native void detect(@ByVal UMat inputImage, @ByRef RectVector Bbox, @StdVector FloatPointer confidence);
public native void detect(@ByVal UMat inputImage, @ByRef RectVector Bbox, @StdVector FloatBuffer confidence);
public native void detect(@ByVal UMat inputImage, @ByRef RectVector Bbox, @StdVector float[] confidence);
public native void detect(@ByVal GpuMat inputImage, @ByRef RectVector Bbox, @StdVector FloatPointer confidence);
public native void detect(@ByVal GpuMat inputImage, @ByRef RectVector Bbox, @StdVector FloatBuffer confidence);
public native void detect(@ByVal GpuMat inputImage, @ByRef RectVector Bbox, @StdVector float[] confidence);
}

/** \brief TextDetectorCNN class provides the functionallity of text bounding box detection.
This class is representing to find bounding boxes of text words given an input image.
This class uses OpenCV dnn module to load pre-trained model described in \cite LiaoSBWL17.
The original repository with the modified SSD Caffe version: https://github.com/MhLiao/TextBoxes.
Model can be downloaded from [DropBox](https://www.dropbox.com/s/g8pjzv2de9gty8g/TextBoxes_icdar13.caffemodel?dl=0).
Modified .prototxt file with the model description can be found in {@code opencv_contrib/modules/text/samples/textbox.prototxt}.
*/
@Namespace("cv::text") public static class TextDetectorCNN extends TextDetector {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public TextDetectorCNN(Pointer p) { super(p); }

/**
\overload
<p>
@param inputImage an image expected to be a CV_U8C3 of any size
@param Bbox a vector of Rect that will store the detected word bounding box
@param confidence a vector of float that will be updated with the confidence the classifier has for the selected bounding box
*/
public native void detect(@ByVal Mat inputImage, @ByRef RectVector Bbox, @StdVector FloatPointer confidence);
public native void detect(@ByVal Mat inputImage, @ByRef RectVector Bbox, @StdVector FloatBuffer confidence);
public native void detect(@ByVal Mat inputImage, @ByRef RectVector Bbox, @StdVector float[] confidence);
public native void detect(@ByVal UMat inputImage, @ByRef RectVector Bbox, @StdVector FloatPointer confidence);
public native void detect(@ByVal UMat inputImage, @ByRef RectVector Bbox, @StdVector FloatBuffer confidence);
public native void detect(@ByVal UMat inputImage, @ByRef RectVector Bbox, @StdVector float[] confidence);
public native void detect(@ByVal GpuMat inputImage, @ByRef RectVector Bbox, @StdVector FloatPointer confidence);
public native void detect(@ByVal GpuMat inputImage, @ByRef RectVector Bbox, @StdVector FloatBuffer confidence);
public native void detect(@ByVal GpuMat inputImage, @ByRef RectVector Bbox, @StdVector float[] confidence);

/** \brief Creates an instance of the TextDetectorCNN class using the provided parameters.
<p>
@param modelArchFilename the relative or absolute path to the prototxt file describing the classifiers architecture.
@param modelWeightsFilename the relative or absolute path to the file containing the pretrained weights of the model in caffe-binary form.
@param detectionSizes a list of sizes for multiscale detection. The values{@code [(300,300),(700,500),(700,300),(700,700),(1600,1600)]} are
recommended in \cite LiaoSBWL17 to achieve the best quality.
*/
public static native @Ptr TextDetectorCNN create(@Str BytePointer modelArchFilename, @Str BytePointer modelWeightsFilename,
@ByVal SizeVector detectionSizes);
public static native @Ptr TextDetectorCNN create(@Str String modelArchFilename, @Str String modelWeightsFilename,
@ByVal SizeVector detectionSizes);
/**
\overload
*/
public static native @Ptr TextDetectorCNN create(@Str BytePointer modelArchFilename, @Str BytePointer modelWeightsFilename);
public static native @Ptr TextDetectorCNN create(@Str String modelArchFilename, @Str String modelWeightsFilename);
}

/** \} */
//namespace text
//namespace cv


// #endif // _OPENCV_TEXT_OCR_HPP_


}
Loading