免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 974 | 回复: 0

red eye removal [复制链接]

论坛徽章:
0
发表于 2011-12-23 02:29 |显示全部楼层
红眼消除技术:

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

  1. 2205 int CameraHardware::pictureThread()
  2. 2206 {
  3. ...
  4. SnapshotPostProcessing (main_out, cap_width, cap_height);
  5. ...
  6. }
函数内容如下:

  1. 3945 int CameraHardware::SnapshotPostProcessing(void *img_data, int width, int height)
  2. 3946 {
  3. 3947 // do red eye removal
  4. 3948 int img_size;
  5. 3949
  6. 3950 // FIXME:
  7. 3951 // currently, if capture resolution more than 5M, camera will hang if
  8. 3952 // ShRedEye_Remove() is called in 3A library
  9. 3953 // to workaround and make system not crash, maximum resolution for red eye
  10. 3954 // removal is restricted to be 5M
  11. 3955 if (width > 2560 || height > 1920 || awb_to_manual)
  12. 3956 {
  13. 3957 LOGD(" Bug here: picture size must not more than 5M for red eye removal\n");
  14. 3958 return -1;
  15. 3959 }
  16. 3960
  17. 3961 img_size = mCamera->m_frameSize (mPicturePixelFormat, width, height);
  18. 3962
  19. 3963 mAAA->DoRedeyeRemoval (img_data, img_size, width, height, mPicturePixelFormat);
  20. 3964
  21. 3965 return 0;
  22. 3966 }
DoRedeyeRemoval 调用到 libmfldadvci.so 里的函数:

  1. 275 void AAAProcess::DoRedeyeRemoval(void *img_buf, int size, int width, int height, int format)
  2.  276 {
  3.  277 Mutex::Autolock lock(mLock);
  4.  278 if(!mInitied)
  5.  279 return;
  6.  280
  7.  281 if(SENSOR_TYPE_RAW == mSensorType)
  8.  282 {
  9.  283 ci_adv_user_buffer user_buf;
  10.  284 switch (format)
  11.  285 {
  12.  286 case V4L2_PIX_FMT_YUV420:
  13.  287 user_buf.format= ci_adv_frame_format_yuv420;
  14.  288 break;
  15.  289 default:
  16.  290 LOGE("%s: not supported foramt in red eye removal", __func__);
  17.  291 return;
  18.  292 }
  19.  293 user_buf.addr = img_buf;
  20.  294 user_buf.width = width;
  21.  295 user_buf.height = height;
  22.  296 user_buf.length = size;
  23.  297 ci_adv_correct_redeyes(&user_buf);
  24.  298 }
  25.  299 }
ci_adv_correct_redeyes 就会调用驱动层的相应处理函数,对图像进行消除红眼处理。










您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP