应用项目:  APP的性能测试

应用场景:  APP启动速度  视频开播速度 加载速度  等~~

缘来:  基于APP日志UiAutomator的测试方案,测试结果不能直白且精确的反应,用户的体验

改进: 通过手工操作或自动操作的方式录取视频,然后用图像处理的方式,来获取测试结果

架构流程图:

主要的核心点:

  视频分帧: 基于ffmpeg库 进行分帧

样例: ffmpeg  -hide_banner -i video.mp4 -an -vsync 0 .\frames\%06d.png > null

图片对比: 基于opencv库进行图片对比

核心代码:

int diff_count(const Mat& lmat, const Mat& rmat, int threshold) {
int cols = lmat.cols;
int rows = lmat.rows;
int esize = (int)lmat.elemSize(); if ( rmat.cols != cols || rmat.rows != rows || (int)rmat.elemSize() != esize ) {
return -;
} int total = rows * cols;
int dcount = ; for ( int i = ; i < total; i++ ) {
uchar* lptr = lmat.data + i*esize;
uchar* rptr = rmat.data + i*esize; int sum = ;
for ( int j = ; j < esize; j++ ) {
uchar lu = lptr[j];
uchar ru = rptr[j]; int tmp = lu > ru ? lu - ru : ru - lu;
sum += tmp*tmp;
} if ( sqrt(sum)/esize >= threshold ) {
dcount++;
}
} return dcount;
}

最新文章

  1. oracle--子查询--bai
  2. win7下安装Sass和compass
  3. WEB前端工程师面试题【前端】
  4. php图片合成
  5. RDLC使用手册_RDLC报表部署
  6. #JAVA操作LDAP
  7. 解决浏览器background-image属性不支持css3动画
  8. vb6-很简单的配置密码验证提示
  9. 文件转换dll mingw
  10. 配置greenplum参数
  11. 通过YAJL生成json语句
  12. 【转】判断URL是否能够访问
  13. Controller &lt;-&gt; View 一般视图层级
  14. chrome的断点调试
  15. Linux入门(11)——Ubuntu16.04安装texlive2016并配置texmaker和sublime text3
  16. OpenStack Ironic 常见问题
  17. 归档日志空间满导致DB启动失败
  18. SpringBoot 集成数据库连接池Druid
  19. win10 开发mfc 64位 ocx控件
  20. jquery花式图片库——jqFancyTransitions

热门文章

  1. 【Android开发】之MediaPlayer的错误分析
  2. MongoDB安全:内置角色概览
  3. No.14 selenium for python table表单
  4. No.13 selenium for python 单选框和复选框
  5. Struts 2 Overview
  6. jquery插件使用记录
  7. 【LOJ】 #2665. 「NOI2013」树的计数
  8. C#实例 Unity依赖注入使用
  9. oracle配置ODBC
  10. hdoj2546 饭卡(DP,01背包)