Application of OPENCV----in app performance Test (I.)

Source: Internet
Author: User

Application Projects: Performance testing for Apps

Application Scenarios: App start speed video speed loading speed etc ~ ~

Edge: based on app logs and uiautomator test scenarios, test results are not straightforward and accurate response, the user's experience

Improvement: take the video by hand or automatically, and then use the image processing method to obtain the test results.

Schema Flowchart:

The main core points:

Video sub-frame: framing based on the FFmpeg library

Example: Ffmpeg-hide_banner-i video.mp4-an-vsync 0. \frames\%06d.png > Null

Image comparison: Image comparison based on OpenCV library

Core code:

intDiff_count (Constmat& Lmat,Constmat& Rmat,intthreshold) {    intcols =Lmat.cols; introws =lmat.rows; intEsize = (int) lmat.elemsize (); if(rmat.cols! = cols | | rmat.rows! = Rows | | (int) rmat.elemsize ()! =esize) {        return-1; }    intTotal = rows *cols; intDCount =0;  for(inti =0; I < total; i++) {Uchar* Lptr = Lmat.data + i*esize; Uchar* Rptr = Rmat.data + i*esize; intsum =0;  for(intj =0; J < Esize; J + +) {Uchar Lu=Lptr[j]; Uchar Ru=Rptr[j]; intTMP = LU > ru? Lu-ru:ru-Lu; Sum+ = tmp*tmp; }        if(sqrt (sum)/esize >=threshold) {DCount++; }    }    returnDCount;}

Application of OPENCV----in app performance Test (I.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.