red eye removal

红眼消除技术:

在picturethread 中,拍完照之后调用:

2205 int CameraHardware::pictureThread()
    2206 {
    ...
    SnapshotPostProcessing (main_out, cap_width, cap_height);
    ...
    }
函数内容如下:

3945 int CameraHardware::SnapshotPostProcessing(void *img_data, int width, int height)
    3946 {
    3947 // do red eye removal
    3948 int img_size;
    3949
    3950 // FIXME:
    3951 // currently, if capture resolution more than 5M, camera will hang if
    3952 // ShRedEye_Remove() is called in 3A library
    3953 // to workaround and make system not crash, maximum resolution for red eye
    3954 // removal is restricted to be 5M
    3955 if (width > 2560 || height > 1920 || awb_to_manual)
    3956 {
    3957 LOGD(" Bug here: picture size must not more than 5M for red eye removal\n");
    3958 return -1;
    3959 }
    3960
    3961 img_size = mCamera->m_frameSize (mPicturePixelFormat, width, height);
    3962
    3963 mAAA->DoRedeyeRemoval (img_data, img_size, width, height, mPicturePixelFormat);
    3964
    3965 return 0;
    3966 }
DoRedeyeRemoval 调用到 libmfldadvci.so 里的函数:
275 void AAAProcess::DoRedeyeRemoval(void *img_buf, int size, int width, int height, int format)
     276 {
     277 Mutex::Autolock lock(mLock);
     278 if(!mInitied)
     279 return;
     280
     281 if(SENSOR_TYPE_RAW == mSensorType)
     282 {
     283 ci_adv_user_buffer user_buf;
     284 switch (format)
     285 {
     286 case V4L2_PIX_FMT_YUV420:
     287 user_buf.format= ci_adv_frame_format_yuv420;
     288 break;
     289 default:
     290 LOGE("%s: not supported foramt in red eye removal", __func__);
     291 return;
     292 }
     293 user_buf.addr = img_buf;
     294 user_buf.width = width;
     295 user_buf.height = height;
     296 user_buf.length = size;
     297 ci_adv_correct_redeyes(&user_buf);
     298 }
     299 }
ci_adv_correct_redeyes 就会调用驱动层的相应处理函数,对图像进行消除红眼处理。


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值