I am trying to implement circle detection in fastcv Android.
but i m facing "Assertion failed "at fcvHoughCircle..!!
( Assertion failed @fcvHoughCircleu8: src && circles && numCircle && data && srcStride >= srcWidth )
code is little bit messy. but mainly i want to get correct values of NUmcircle and pointer structure of circles in ANdroid LOG as of now.
My code in JNI looks like this..
JNIEXPORT void JNICALL Java_com_cvapps_testcircledetect_ImageProcessing_detectcirclesNative (JNIEnv* env, jobject obj,jbyteArray src,jbyteArray dst,jint width,jint height) { jbyte* srcData = NULL; // not useful now jboolean isCopy = 0; jint stride = width; jint frameSize = width*height; jint* numCircle = 0; jbyte* jimgData = NULL; fcvCircle* fcvccircle=NULL; jimgData = env->GetByteArrayElements( src, &isCopy); // srcData = env->GetByteArrayElements(src, &isCopy); uint8_t* data = (uint8_t*) fcvMemAlloc(width*height*16,128); uint8_t* pJimgData = (uint8_t*)jimgData; uint8_t* blurredImgBuf; blurredImgBuf = (uint8_t*)fcvMemAlloc( width*height, 128 ); fcvFilterGaussian3x3u8( pJimgData, width,height,blurredImgBuf,0 ); pJimgData = blurredImgBuf; __android_log_print (ANDROID_LOG_INFO, "test gpio", "Before numcircle ==%d",numCircle); fcvHoughCircleu8 ( (uint8_t *) pJimgData, (uint32_t) width, (uint32_t) height, (uint32_t) 0, fcvccircle, (uint32_t *) numCircle, (uint32_t) 20, (uint32_t) 0, (uint32_t) 100, (uint32_t) 100, (uint32_t) 0, (uint32_t) 43000, (void *) data ); __android_log_print (ANDROID_LOG_INFO, "test gpio", "AFTER numcircle ===%d",numCircle); }
I am having the same issue with same error code. Is there anyone who faced this error and solved it.
You may have a problem with numCircle. You have a NULL pointer there.
Cheers,
-Jeff