Ask Your Question

AdhamEnaya's profile - activity

2015-12-07 06:46:59 -0600 asked a question Re-size Mat frame using OpenCV Native for android

I am capturing Video frames using OpenCV4Android Java SDK. Then I pass the Mat object for that frame to NDK funtion. This NDK function should receive the mat and perform resize operation using the cv::resize. But I got this errors:

********** Crash dump: **********
Build fingerprint: 'google/hammerhead/hammerhead:6.0/MRA58N/2289998:user/release-keys'
pid: 32320, tid: 32696, name: Thread-1677  >>> com.grafty <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x53
Stack frame 12-07 13:43:09.048   201   201 F DEBUG   :     #00 pc 00255a3c  /data/app/com.grafty-1/lib/arm/libGrafty.so (cv::Mat::create(int, int cons
t*, int)+1291): Routine std::vector<dlib::processed_weight_vector<dlib::scan_fhog_pyramid<dlib::pyramid_down<6u>, dlib::default_fhog_feature_extractor
> >, std::allocator<dlib::processed_weight_vector<dlib::scan_fhog_pyramid<dlib::pyramid_down<6u>, dlib::default_fhog_feature_extractor> > > >::resize(
unsigned int) at D:/scryptech/ndk_project/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.8/include/bits/stl_vector.h:668
Stack frame 12-07 13:43:09.048   201   201 F DEBUG   :     #01 pc 0026b5bb  /data/app/com.grafty-1/lib/arm/libGrafty.so (cv::_OutputArray::create(cv::
Size_<int>, int, int, bool, int) const+546): Routine std::_Deque_iterator<unsigned int, unsigned int&, unsigned int*>::operator-(int) const at D:/scry
ptech/ndk_project/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.8/include/bits/stl_deque.h:218
Stack frame 12-07 13:43:09.048   201   201 F DEBUG   :     #02 pc 0018b9f7  /data/app/com.grafty-1/lib/arm/libGrafty.so (cv::resize(cv::_InputArray co
nst&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)+166): Routine ??
??:0
Stack frame 12-07 13:43:09.048   201   201 F DEBUG   :     #03 pc 000bfb83  /data/app/com.grafty-1/lib/arm/libGrafty.so (GraftySystem::setCurrentFrame
(cv::Mat&)+346): Routine ??
??:0
Stack frame 12-07 13:43:09.048   201   201 F DEBUG   :     #04 pc 000f8591  /data/app/com.grafty-1/lib/arm/libGrafty.so (Java_com_grafty_GraftyNative_
runGrafty+112): Routine ??
??:0
Stack frame 12-07 13:43:09.049   201   201 F DEBUG   :     #05 pc 0007f135  /data/app/com.grafty-1/oat/arm/base.odex (offset 0x7f000) (byte[] com.graf
ty.GraftyNative.runGrafty(long)+88)
Stack frame 12-07 13:43:09.049   201   201 F DEBUG   :     #06 pc 0007f5bd  /data/app/com.grafty-1/oat/arm/base.odex (offset 0x7f000) (byte[] com.graf
ty.GraftyNative.run(org.opencv.core.Mat)+72)
Stack frame 12-07 13:43:09.049   201   201 F DEBUG   :     #07 pc 0007fbcf  /data/app/com.grafty-1/oat/arm/base.odex (offset 0x7f000) (void com.grafty
.MainActivity$Consumer.consume()+378)
Stack frame 12-07 13:43:09.049   201   201 F DEBUG   :     #08 pc 0007fcaf  /data/app/com.grafty-1/oat/arm/base.odex (offset 0x7f000) (void com.grafty
.MainActivity$Consumer.run()+50)
Stack frame 12-07 13:43:09.049   201   201 F DEBUG   :     #09 pc 737998d1  /data/dalvik-cache/arm/system@[email protected] (offset 0x1eb1000)

Java side 1- Taking the frame from the video camera:

 public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
        mRgba = inputFrame.rgba();
        mGray = inputFrame.gray();
        grafty.run(message);

        return mRgba;
    }

2- Native function signature

private static native byte[] runGrafty(long frame);

public byte[] run(Mat imageGray) {
    return runGrafty(imageGray.getNativeObjAddr());
}

JNI ... (more)