This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

connected components labeling

Other Parts Discussed in Thread: TMS320DM6437

Hi

Now I am doing a project on detecting moving object in a video. Firstly, I use the Gaussian Mixture Model to implement the object detection. And it works well. It produces the "black" background and the "white" foreground.

Next I aim to use a red rectangle to label the moving object in a video. So I want to use the connected components labeling algorithms which is implemented in the VLIB library to label the foreground region and find the position information about it. But I found when I use the library function “VLIB_getNumCCs”, the "numCC" which represents the number of the connected componets is always equal to zero. Could anybody tell me why?

Thanks! 

  • Hi Xuan,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages. Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics.

    There are quite a few different forums on E2E. This device forum is good for device-specific or hardware/driver questions. The C/C++ Compiler Forum is good for issues with the build tools and the Run-Time Support library. The Code Composer Forum is good for issues with the debugger and its capabilities.

    TI-RTOS forum is good for issues with SYS/BIOS, DSP/BIOS, IPC, SYSLINK, and TCP/IP (NDK), the Multicore SDK, Industrial SDK, DSPLIB, IMGLIB, VoLIB, OpenMP, and OpenCL.

    Moving your post to TI-RTOS forum.

    Regards,

    Shankari

  • Hi,

    Major steps of my program are:

    Firstly, intialization.

    primaryBuff1 = (unsigned char*)MEM_alloc(DDR2HEAP,sizeof(unsigned char)*720*576,32);
    primaryBuff2 = (unsigned char*)MEM_alloc(DDR2HEAP,sizeof(unsigned char)*720*576,32);
    overFlowBuff1 = (unsigned char*)MEM_alloc(DDR2HEAP,sizeof(unsigned char)*720*576,32);
    overFlowBuff2 = (unsigned char*)MEM_alloc(DDR2HEAP,sizeof(unsigned char)*720*576,32);

    ccHandleSize = VLIB_GetSizeOfCCHandle();
    handle = (VLIB_CCHandle*)MEM_alloc(DDR2HEAP,ccHandleSize,8);
    VLIB_initConnectedComponentsList(handle,
    primaryBuff1,
    720*576,
    primaryBuff2,
    720*576,
    overFlowBuff1,
    720*576,
    overFlowBuff2,
    720*576);

    then,

    FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);

    VLIB_mixtureOfGaussiansS32(inputImage,
    currentWgts,
    currentMeans,
    currentVars,
    compIndex,
    intBuffer,
    fgMask,
    pixNum,
    updateRate1,
    updateRate2,
    mdThreshold,
    bsThreshold,
    initialWt,
    initialVar);


    VLIB_createConnectedComponentsList(handle,
    (Uint16)width,
    (Uint16)height,
    (int*)fgMask,
    30,
    1);

    VLIB_getNumCCs(handle, &numCC);

    After all, each time when I debug the program I found the "numCC" was 0. Besides, I also don't know how much I should allocate to the primaryBuff1 and primaryBuff2.

  • Xuan, Are you still working on this issue? What device are you using?

  • Hi, David

    I am still working on the issue. I am using  DSP with a C64x+  processing core(TMS320DM6437).

    I found that the detection result was good, but when I call the VLIB function, which is VLIB_getNumCCs, the variable numCCs that stands for the number of the connected components was always equal to 0. It seems that the function doesn't work.