Last active
June 3, 2016 21:42
Revisions
-
vrunoa renamed this gist
Jun 1, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
vrunoa created this gist
Jun 1, 2016 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ // trying to convert Luv image to BGR JNIEXPORT jboolean JNICALL Java_com_test_run(JNIEnv* env, jobject thiz, jlong data) { __android_log_write(ANDROID_LOG_INFO, "TEST", "run"); if(data == 0) { __android_log_write(ANDROID_LOG_ERROR, "TEST", "empty jlong mat"); return false; } cv::Mat frame = *((cv::Mat*)data); if(frame.empty()) { return false; } cv::Mat bgr = cv::Mat(frame.rows, frame.cols); cv::cvtColor(frame, bgr, cv::COLOR_Luv2BGR); cv::Mat rotated; cv::Point2f center(frame.cols/2.0F, frame.rows/2.0F); cv::Mat rot = getRotationMatrix2D(center, 90, 1.0); cv::warpAffine(frame, rotated, rot, frame.size()); return doCollStuff(rotated.data); } /* throws this error * 05-31 21:02:23.021 22356-22854/? E/cv::error(): OpenCV Error: Assertion failed (scn == 3 && (dcn == 3 || dcn == 4) && (depth == CV_8U || depth == CV_32F)) in void cv::cvtColor(cv::InputArray, cv::OutputArray, int, int), file /builds/master_pack-android/opencv/modules/imgproc/src/color.cpp, line 8291 */