I use the VLIB_mixtureOfGaussiansS16 to test a video frame,but i found that the foreground is always zero...
#define num_frame 100
#define num_pixels 352*288
/* DECLARE AND INITIALIZE MIXTURE OF GAUSSIANS PARAMETERS */
/* update rate for weights, SQ0.15 */
int16_t updateRate1 = 0.001 * INT16_MAX / VLIB_MAX_0p16;
/* update rate for means and variances, SQ0.31 */
int32_t updateRate2 = 0.001 * INT32_MAX / VLIB_MAX_0p16;
/* mahalanobis distance threshold, SQ4.27 */
int32_t mdThreshold = (2.5 * 2.5) * (INT32_MAX / VLIB_MAX_4p12);
/* background subtraction threshold, SQ0.15 */
int16_t bsThreshold = 0.9 * INT16_MAX / VLIB_MAX_0p16;
/* initial weight for new component, SQ0.15 */
int16_t initialWt = 0.001 * (INT16_MAX / VLIB_MAX_0p16);
/* initial variance for new component, SQ16.15 */
int32_t initialVar = 320 * (INT32_MAX / VLIB_MAX_16p16);
*((volatile unsigned int *) 0x1840020) &= 0x00; //close L1P cache
*((volatile unsigned int *) 0x1840040) &= 0x00; //close L1D cache
*((volatile unsigned int *) 0x1840000) &= 0x00; //close L2 cache
int32_t Input_Image_Addr = 0xC0000000;
uint32_t temp_Image_Addr = 0xC0000000;
uint32_t Mid_Plus_fgMask_Data_Addr = 0xC6000000;
uint32_t currentWts_addr = Mid_Plus_fgMask_Data_Addr;
uint32_t currentMeans_addr = currentWts_addr + num_pixels * 3 * sizeof(int16_t);
uint32_t currentVars_addr = currentMeans_addr + num_pixels * 3 * sizeof(int16_t);
uint32_t compIndex_addr = currentVars_addr + num_pixels * 3 * sizeof(int16_t);
uint32_t intBuffer_addr = compIndex_addr + num_pixels * sizeof(uint8_t);
uint32_t fgMask_addr = intBuffer_addr + num_pixels * sizeof(uint8_t);
uint8_t* volatile inputIm = (uint8_t *)Input_Image_Addr;
int16_t* volatile currentWts = (int16_t *)currentWts_addr;
int16_t* volatile currentMeans = (int16_t *)currentMeans_addr;
int16_t* volatile currentVars = (int16_t *)currentVars_addr;
uint8_t* volatile compIndex = (uint8_t *)compIndex_addr;
uint8_t* volatile intBuffer = (uint8_t *)intBuffer_addr;
uint32_t* volatile fgMask = (uint32_t *)fgMask_addr;
for(i = 0 ; i < num_frame ; i++)
{
memcpy((void *)Input_Image_Addr , (void *)(temp_Image_Addr + i*num_pixels) , num_pixels);
//dsp start run the gmm algotirhm
fail = VLIB_mixtureOfGaussiansS16(inputIm,
currentWts,
currentMeans,
currentVars,
compIndex,
intBuffer,
fgMask,
num_pixels,
updateRate1,
updateRate2,
mdThreshold,
bsThreshold,
initialWt,
initialVar);
}
Any help would be much appreciated!