Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. JNIEXPORT void JNICALL
  2. Java_com_example_test_1open_1cv_MainActivity_imageprocessing8(
  3. JNIEnv*env,
  4. jobject instance,
  5. jlong addrInput,
  6. jlong addrResult) {
  7.  
  8. Mat &img_input = *(Mat *) addrInput;
  9. Mat &img_result = *(Mat *) addrResult;
  10.  
  11. Mat src = img_input;
  12.  
  13. cvtColor(img_input, src, IMREAD_GRAYSCALE);
  14.  
  15. Mat noise(src.size(), CV_32SC1);
  16.  
  17.  
  18.  
  19. randn(noise, 0, 10);
  20.  
  21. Mat dst;
  22.  
  23. add(src, noise, dst, Mat(), CV_8U);
  24.  
  25. img_result = dst;
  26. }
  27.  
  28. E/cv::error(): OpenCV(4.1.0) Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array') in arithm_op, file /build/master_pack-android/opencv/modules/core/src/arithm.cpp, line 663
  29.  
  30. E/libc++abi: terminating with uncaught exception of type cv::Exception: OpenCV(4.1.0) /build/master_pack-android/opencv/modules/core/src/arithm.cpp:663: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of
  31. channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op'
  32.  
  33. A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 6255 (le.test_open_cv), pid 6255 (le.test_open_cv)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement