sto ottenendo i seguenti errori utilizzando alcune funzioni generiche all'interno OpenCV per androidOpenCV nMatToBitmap Asserzione non riuscita
12-05 21:08:55.486: E/cv::error()(6658): OpenCV Error: Assertion failed (src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols) in void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean), file /home/oleg/sources/opencv/modules/java/generator/src/cpp/utils.cpp, line 107
12-05 21:08:55.486: E/org.opencv.android.Utils(6658): nMatToBitmap catched cv::Exception: /home/oleg/sources/opencv/modules/java/generator/src/cpp/utils.cpp:107: error: (-215) src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)
12-05 21:08:55.486: E/CameraBridge(6658): Mat type: Mat [ 144*192*CV_8UC3, isCont=true, isSubmat=false, nativeObj=0x1024c0, dataAddr=0x44783010 ]
12-05 21:08:55.486: E/CameraBridge(6658): Bitmap type: 384*288
12-05 21:08:55.486: E/CameraBridge(6658): Utils.matToBitmap() throws an exception: /home/oleg/sources/opencv/modules/java/generator/src/cpp/utils.cpp:107: error: (-215) src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)
Non sono sicuro se questo è l'errore in sé o se è causato da un altro problema.
Qualcuno potrebbe suggerire un modo per ridimensionare il Mat in modo che abbia la stessa dimensione della Bitmap? Sto avendo lo stesso problema, ma sto ancora imparando OpenCV quindi non abbastanza competenze con esso ... Grazie in anticipo! –
Le domande sono meglio pubblicate come domande, non come commenti alle risposte. Assicurati di includere un piccolo codice che mostra ciò che hai provato finora e che cosa stai cercando di realizzare esattamente. – SSteve
Hai perfettamente ragione. Ho pensato che solo perché è strettamente correlato a questa domanda potrebbe essere pubblicato qui. Grazie per la tua risposta veloce. –