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.)