Forums - Problem in implementing Circle Detection in Fastcv-Android?

3 posts / 0 new
Last post
Problem in implementing Circle Detection in Fastcv-Android?
Join Date: 23 Mar 15
Posts: 3
Posted: Fri, 2015-04-03 23:45

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,
            (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);


  • Up0
  • Down0
Join Date: 21 Nov 16
Posts: 1
Posted: Wed, 2017-03-01 04:35

I am having the same issue with same error code. Is there anyone who faced this error and solved it.

  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 84
Posted: Thu, 2017-03-02 14:54

You may have a problem with numCircle. You have a NULL pointer there.



  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.