Skip to content

Commit

Permalink
* Map more functions of the OpenCV Transparent API with UMat and `…
Browse files Browse the repository at this point in the history
…UMatVector` parameters (issue bytedeco/javacv#518)
  • Loading branch information
saudet committed Oct 18, 2016
1 parent 067fca6 commit e051291
Show file tree
Hide file tree
Showing 24 changed files with 2,464 additions and 378 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Map more functions of the OpenCV Transparent API with `UMat` and `UMatVector` parameters ([issue bytedeco/javacv#518](https://github.com/bytedeco/javacv/issues/518))
* Add support for `android-arm` and `android-x86` platforms to TensorFlow presets ([pull #297](https://github.com/bytedeco/javacpp-presets/pull/297))
* Keep a reference of `tensorflow.SessionOptions` in `AbstractSession` to prevent premature deallocation ([pull #297](https://github.com/bytedeco/javacpp-presets/pull/297))
* Enable CUDA in `cppbuild.sh` script for TensorFlow ([issue #294](https://github.com/bytedeco/javacpp-presets/issues/294))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.2: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.2.5-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.javacpp;

Expand Down Expand Up @@ -506,6 +506,7 @@ the magnocellular way (motion information channel), unit is frames, typical valu
format (from 8bit to 16bits)
*/
public native void run(@ByVal Mat inputImage);
public native void run(@ByVal UMat inputImage);

/** \brief Method which processes an image in the aim to correct its luminance correct
backlight problems, enhance details in shadows.
Expand All @@ -524,6 +525,7 @@ This method is designed to perform High Dynamic Range image tone mapping (compre
@param outputToneMappedImage the output 8bit/channel tone mapped image (CV_8U or CV_8UC3 format).
*/
public native void applyFastToneMapping(@ByVal Mat inputImage, @ByVal Mat outputToneMappedImage);
public native void applyFastToneMapping(@ByVal UMat inputImage, @ByVal UMat outputToneMappedImage);

/** \brief Accessor of the details channel of the retina (models foveal vision).
<p>
Expand All @@ -538,11 +540,13 @@ This method is designed to perform High Dynamic Range image tone mapping (compre
@see getParvoRAW
*/
public native void getParvo(@ByVal Mat retinaOutput_parvo);
public native void getParvo(@ByVal UMat retinaOutput_parvo);

/** \brief Accessor of the details channel of the retina (models foveal vision).
@see getParvo
*/
public native void getParvoRAW(@ByVal Mat retinaOutput_parvo);
public native void getParvoRAW(@ByVal UMat retinaOutput_parvo);

/** \brief Accessor of the motion channel of the retina (models peripheral vision).
<p>
Expand All @@ -555,11 +559,13 @@ This method is designed to perform High Dynamic Range image tone mapping (compre
@see getMagnoRAW
*/
public native void getMagno(@ByVal Mat retinaOutput_magno);
public native void getMagno(@ByVal UMat retinaOutput_magno);

/** \brief Accessor of the motion channel of the retina (models peripheral vision).
@see getMagno
*/
public native void getMagnoRAW(@ByVal Mat retinaOutput_magno);
public native void getMagnoRAW(@ByVal UMat retinaOutput_magno);

/** \overload */
public native @Const @ByVal Mat getMagnoRAW();
Expand Down Expand Up @@ -756,6 +762,7 @@ This algorithm is already implemented in thre Retina class (retina::applyFastTon
@param outputToneMappedImage the output tone mapped image
*/
public native void applyFastToneMapping(@ByVal Mat inputImage, @ByVal Mat outputToneMappedImage);
public native void applyFastToneMapping(@ByVal UMat inputImage, @ByVal UMat outputToneMappedImage);

/** \brief updates tone mapping behaviors by adjusing the local luminance computation area
<p>
Expand Down Expand Up @@ -965,11 +972,14 @@ This algorithm is already implemented in thre Retina class (retina::applyFastTon
*/
public native void run(@ByVal Mat inputToSegment, int channelIndex/*=0*/);
public native void run(@ByVal Mat inputToSegment);
public native void run(@ByVal UMat inputToSegment, int channelIndex/*=0*/);
public native void run(@ByVal UMat inputToSegment);

/** \brief access function
@return the last segmentation result: a boolean picture which is resampled between 0 and 255 for a display purpose
*/
public native void getSegmentationPicture(@ByVal Mat transientAreas);
public native void getSegmentationPicture(@ByVal UMat transientAreas);

/** \brief cleans all the buffers of the instance
*/
Expand Down
446 changes: 397 additions & 49 deletions opencv/src/main/java/org/bytedeco/javacpp/opencv_calib3d.java

Large diffs are not rendered by default.

414 changes: 353 additions & 61 deletions opencv/src/main/java/org/bytedeco/javacpp/opencv_core.java

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion opencv/src/main/java/org/bytedeco/javacpp/opencv_dnn.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.2: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.2.5-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.javacpp;

Expand Down Expand Up @@ -425,6 +425,10 @@ Functionality of this module is designed only for forward pass computations (i.
private native void allocate(@ByVal Mat image, int dstCn/*=-1*/);
public Blob(@ByVal Mat image) { super((Pointer)null); allocate(image); }
private native void allocate(@ByVal Mat image);
public Blob(@ByVal UMat image, int dstCn/*=-1*/) { super((Pointer)null); allocate(image, dstCn); }
private native void allocate(@ByVal UMat image, int dstCn/*=-1*/);
public Blob(@ByVal UMat image) { super((Pointer)null); allocate(image); }
private native void allocate(@ByVal UMat image);

/** \brief Creates blob with specified \p shape and \p type. */
public native void create(@Const @ByRef BlobShape shape, int type/*=CV_32F*/);
Expand Down
14 changes: 12 additions & 2 deletions opencv/src/main/java/org/bytedeco/javacpp/opencv_face.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.2: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.2.5-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.javacpp;

Expand Down Expand Up @@ -346,6 +346,9 @@ And finally train it on the given dataset (the face images and labels):
}</pre>
*/
public native void train(@ByVal MatVector src, @ByVal Mat labels);
public native void train(@ByVal UMatVector src, @ByVal Mat labels);
public native void train(@ByVal MatVector src, @ByVal UMat labels);
public native void train(@ByVal UMatVector src, @ByVal UMat labels);

/** \brief Updates a FaceRecognizer with given data and associated labels.
<p>
Expand Down Expand Up @@ -395,9 +398,13 @@ Calling update on an Eigenfaces model (see createEigenFaceRecognizer), which doe
responsible for maintaining the dataset, he want to work with.
*/
public native void update(@ByVal MatVector src, @ByVal Mat labels);
public native void update(@ByVal UMatVector src, @ByVal Mat labels);
public native void update(@ByVal MatVector src, @ByVal UMat labels);
public native void update(@ByVal UMatVector src, @ByVal UMat labels);

/** \overload */
public native int predict(@ByVal Mat src);
public native int predict(@ByVal UMat src);


/** \brief Predicts a label and associated confidence (e.g. distance) for a given input image.
Expand Down Expand Up @@ -437,7 +444,8 @@ Or to get a prediction and the associated confidence (e.g. distance):
*/
public native void predict(@ByVal Mat src, @ByRef IntPointer label, @ByRef DoublePointer confidence);
public native void predict(@ByVal Mat src, @ByRef IntBuffer label, @ByRef DoubleBuffer confidence);
public native void predict(@ByVal Mat src, @ByRef int[] label, @ByRef double[] confidence);
public native void predict(@ByVal UMat src, @ByRef int[] label, @ByRef double[] confidence);
public native void predict(@ByVal UMat src, @ByRef IntPointer label, @ByRef DoublePointer confidence);


/** \brief - if implemented - send all result of prediction to collector that can be used for somehow custom result handling
Expand All @@ -450,6 +458,8 @@ To implement this method u just have to do same internal cycle as in predict(Inp
*/
public native void predict(@ByVal Mat src, @Ptr PredictCollector collector, int state/*=0*/);
public native void predict(@ByVal Mat src, @Ptr PredictCollector collector);
public native void predict(@ByVal UMat src, @Ptr PredictCollector collector, int state/*=0*/);
public native void predict(@ByVal UMat src, @Ptr PredictCollector collector);

/** \brief Saves a FaceRecognizer and its model state.
<p>
Expand Down
Loading

0 comments on commit e051291

Please sign in to comment.