imple ISP with background subtraction数据手册中参数

dst2是背景模型的输入地址呢,还是输出地址呢?

这个和mean_img_init参数的设置有关嘛?

Parents
  • 这个地址既作输入也作输出。

    首先这个库的作用之一是根据【当前帧】和【历史帧】的差异找到运动的目标。
    src指向【当前帧】,这个你是理解的。
    dst2需要指向一块空的专用的buffer,称为【历史帧】。

    在camera捕获第一帧图像的时候,【历史帧】是空的,此时需要给mean_img_init设置为0。
    之后的每一帧图像,【历史帧】都不为空,此时mean_img_init固定写1就可以了。
  • 非常感谢您的解答,我已经理解了这个参数的含义。
    但是调试程序还是出现了一些问题,灰度显示的dst3没有问题,但是检测运动的二值化dst1却一直是黑的。我的参数设置如下:
    历史帧初始化,参数设置如下:
    p_input_bufadr = R_BCD_CameraGetFrameAddress(frame_buf_id);
    R_MMU_VAtoPA((uint32_t)p_input_bufadr, &(param.src)); /* Convert pointer to uint32_t */
    param.dst2 = mode_buffer[0];
    param.width = R_BCD_CAMERA_WIDTH;
    param.height = R_BCD_CAMERA_HEIGHT;
    param.area1_offset_x = 0;
    param.area1_offset_y = 0;
    param.area1_width = R_BCD_CAMERA_WIDTH;
    param.area1_height = R_BCD_CAMERA_HEIGHT;
    param.area2_offset_x = 0;
    param.area2_offset_y = 0;
    param.area2_width = 0;
    param.area2_height = 0;
    param.area3_offset_x = 0;
    param.area3_offset_y = 0;
    param.area3_width = 0;
    param.area3_height = 0;
    param.component = 0x001; /* Accumlate ON */

    param.bias_r = 0x00;
    param.bias_g = -16;
    param.bias_b = -16;
    param.gain_r = 0x1D48;
    param.gain_g = 0x123D;
    param.gain_b = 0x1CCC;

    param.blend = 0x000;
    param.strength = 50;//Sharpening filter emphasis value (0 to 255)
    param.coring = 50; //Sharpening filter coring value (0 to 255)
    param.gamma = 0; //1: Perform gamma correction;0: Do not perform gamma correction
    param.table = 0;
    param.mean_img_init = 0; //1: The background model is initialized. 0: The background model is not initialized.
    param.alpha = 0; //The weight of input image at the time of updating the background model (0 to 255)
    param.threshold_latest = 50; //Binarization threshold for input image (0 to 255)
    param.threshold_diff = 30; //Binarization threshold of the difference image between the input image and background
    进入循环后,参数设置(改变了的)如下:
    p_output_bufadr = R_BCD_LcdGetVramAddress();
    R_MMU_VAtoPA((uint32_t)p_output_bufadr, &(param.dst1)); /* Convert pointer to uint32_t */
    param.dst2 = mode_buffer[0];
    R_MMU_VAtoPA((uint32_t)ave_result, &(param.accumulate)); /* Convert pointer to uint32_t */
    param.dst3 = param.dst1+R_BCD_CAMERA_WIDTH*R_BCD_CAMERA_HEIGHT;
    param.mean_img_init = 1; //1: The background model is initialized. 0: The background model is not initialized.
  • 你的代码里边,dst1做了地址转换,但是dst2和dst3都没做,可能是一个隐患。
    再一点是,dst2初始化一次之后,循环中不需要重新赋值了,毕竟地址不会变。
    另外,你拿到了LCD的显示buffer地址给了dst1,这一步没有问题;
    然后把上述地址做了一帧的偏移给了dst3,这一步我不太明白,你是想让dst3指向哪里?
  • 非常感谢,关于dst3的指向,我是通过实验理解的,可能有误。我想要在一个显示屏上分屏输出两个图像,第一个图像的地址是lcd的显示buffer,第二个就是做一帧偏移之后得到的。关于这一点,我是在hsv detection里面实验得到的(主要原因是我按照数据手册把dst3赋值为0,显示屏关于dst3的那个半屏无法消失,我也不知道应该通过什么方式给dst3赋值)。
    我按照您的意见,修改程序后,结果还是没有变化,可能是dst3的问题吗?dst3应该怎么设置啊?
  • 你试着单独给dst3一块buffer,看看里边的数据对不对。
    或者把LCD的显示buffer给了dst3单独做个测试。
Reply Children
No Data