首页 文章 精选 留言 我的

精选列表

搜索[android things],共10000篇文章
优秀的个人博客,低调大师

Android---Monkey指令进行压力测试实例(模拟点击)

我们在做安卓APP测试的时候,经常会用到Monkey指令来模拟对APP的点击操作,从而达 到多次点击的效果,比如连续点击1W次,看看APP的运行情况。下面呢我就给大家介绍下 用Monkey指令模拟点击APP的的方法。 下载好adb文件,我这里是已经有了,然后解压到自己的某个路径(随意,不强 制放在C盘目录下),我这里放在了D盘 设置好adb的环境变量: 通过cmd验证是否安装成功,输入adb shell,成功的话会显示如下: 我这手机在充电模式,这样显示了。开机后不会有下面的error信息。 在手机上先安装好要测试的APP,然后在cmd里发送指令。 首先,我们要获取到这个APP的包名,使用指令如下:aapt dump badging +包的路径 执行指令后,name变量的对应的值就是包名 使用指令发送压力测试 我们执行adb shell的时候就已经连接到手机上了,所以不要乱发送指令,有可能会把 手机玩坏! 这里-p就是上一步查看到的包名,-v只要执行的次数,我这里是10000,后面的路径是 Log的存放路径。 好了,一个简单的Monkey压力测试就算完成了 本文转自niedongri 51CTO博客,原文链接:http://blog.51cto.com/laomomo/1920085,如需转载请自行联系原作者

优秀的个人博客,低调大师

OpenCV的+安卓+号牌识别(OpenCV + Android +水平矫正)

ImageView imgView = (ImageView) findViewById(R.id.imageView1); Bitmap bmp = BitmapFactory.decodeResource(getResources(),car); //First convert Bitmap to Mat Mat ImageMatin = new Mat ( bmp.getHeight(), bmp.getWidth(), CvType.CV_8U, new Scalar(4)); Mat ImageMatout = new Mat ( bmp.getHeight(), bmp.getWidth(), CvType.CV_8U, new Scalar(4)); Mat ImageMatBk = new Mat ( bmp.getHeight(), bmp.getWidth(), CvType.CV_8U, new Scalar(4)); Mat ImageMatTopHat = new Mat ( bmp.getHeight(), bmp.getWidth(), CvType.CV_8U, new Scalar(4)); Mat temp = new Mat ( bmp.getHeight(), bmp.getWidth(), CvType.CV_8U, new Scalar(4)); Bitmap myBitmap32 = bmp.copy(Bitmap.Config.ARGB_8888, true); Utils.bitmapToMat(myBitmap32, ImageMatin); //Converting RGB to Gray. Imgproc.cvtColor(ImageMatin, ImageMatBk, Imgproc.COLOR_RGB2GRAY,8); Imgproc.dilate(ImageMatBk, temp, Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(9, 9))); Imgproc.erode(temp, ImageMatTopHat, Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(9,9))); //Core.absdiff(current, previous, difference); Core.absdiff(ImageMatTopHat, ImageMatBk, ImageMatout); //Sobel operator in horizontal direction. Imgproc.Sobel(ImageMatout,ImageMatout,CvType.CV_8U,1,0,3,1,0.4,Imgproc.BORDER_DEFAULT); //Converting GaussianBlur Imgproc.GaussianBlur(ImageMatout, ImageMatout, new Size(5,5),2); Imgproc.dilate(ImageMatout, ImageMatout, Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(3,3))); Mat element = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(17, 3)); Imgproc.morphologyEx(ImageMatout, ImageMatout, Imgproc.MORPH_CLOSE, element); //threshold image Imgproc.threshold(ImageMatout, ImageMatout, 0, 255, Imgproc.THRESH_OTSU+Imgproc.THRESH_BINARY); Now I need to extract number Plate Please help me to convert following C++ code to java+opencv:. std::vector rects; std::vector<std::vector >::iterator itc = contours.begin(); while (itc != contours.end()) { cv::RotatedRect mr = cv::minAreaRect(cv::Mat(*itc)); float area = fabs(cv::contourArea(*itc)); float bbArea=mr.size.width * mr.size.height; float ratio = area/bbArea; if( (ratio < 0.45) || (bbArea < 400) ){ itc= contours.erase(itc); }else{ ++itc; rects.push_back(mr); } } import java.util.*; import org.opencv.imgproc.Imgproc; import org.opencv.core.*; /* ... */ ArrayList<RotatedRect> rects = new ArrayList<RotatedRect>() ArrayList<MatOfPoint> contours = new ArrayList<MatOfPoint>(); Imgproc.findContours(image, contours, new Mat(), Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_NONE); ListIterator<MatOfPoint> itc = contours.listIterator(); while(itc.hasNext()) { MatOfPoint2f mp2f = new MatOfPoint2f(itc.next().toArray()); RotatedRect mr = Imgproc.minAreaRect(mp2f); double area = Math.abs(Imgproc.contourArea(mp2f)); double bbArea= mr.size.area(); double ratio = area / bbArea; if( (ratio < 0.45) || (bbArea < 400) ) { itc.remove(); // other than deliberately making the program slow, // does erasing the contour have any purpose? } else { rects.add(mr); } }

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

用户登录
用户注册