首页 文章 精选 留言 我的

精选列表

搜索[水平分库],共10003篇文章
优秀的个人博客,低调大师

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); } }

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

Vitess 10 发布,MySQL 数据库集群水平扩展系统

Vitess 10 发布了。Vitess 是一个分布式 MySQL 工具集,它可以自动分片存储 MySQL 数据表,将单个 SQL 查询改写为分布式发送到多个 MySQL Server 上,支持行缓存(比 MySQL 本身缓存效率高)与复制容错等。 此版本主要新特性包括: Major Themes 在这个版本中,Vitess 的维护者仍继续专注于兼容性。它仍然是 Vitess 成为 MySQL 生态系统一部分的最关键的组成部分。开发团队也已经开始着手进行基准测试和性能优化。这些改进让其对 Vitess 的哪些方面可以在性能上有所提高有了清晰的认识。 兼容性(MySQL、框架) 随着 V10.0 的发布,Vitess(unsharded) 通过了 Ruby on Rails 框架的所有自动化端到端测试。现在,即使你使用得不是 Rails,这些改进也可能使你受益。接下来,开发团队还计划继续增加对更多框架的测试。 Migration Freno-style throttling 已添加到 VReplication 工作流程中。source 和 target tablets 都可以根据 corresponding shards 的 replication lag 来 throttled。 通过新的安装和迁移命令,你可以从另一个 Vitess cluster 导入数据。 该版本还包括还包括 VReplication V2 用户指令的改进指标、错误修复和微调。 Schema Management Online DDL在第 9 版的基础上继续发展,一些新的和值得注意的内容有: 改进的 SQL语法 通过@@ddl_strategy='online'VReplication 引入基于 VReplication 的迁移是 resharding、materialized views、MoveTables 等背后的基础机制。现在,它可以运行架构迁移 Revertible Online DDL:对已完成的迁移进行无损、online revert Declarative schema更改 性能优化 为 query plans 添加了一个新的、性能更好的缓存实现。新的缓存使用 LFU 驱逐算法,使其对 pollution 有更强的适应性,所以它在 pathological cases 下表现得特别好(比如大量插入活动数据库),同时在正常操作中具有更快的响应时间和更好的命中率。 Vitess SQL Parser 的性能在解析速度和减少内存分配方面都得到了极大的提高。这将减少 vtgate 实例的 CPU 使用率,缩短查询时间,并减少 GC 流失。如果依赖 Vites 解析器的第三方应用程序升级到最新版本,它们也将获得这些好处-外部 API 基本上保持不变。 Vitess 在 SQL 语法树上执行的许多 AST 操作已经过重新设计,因此除非绝对必要,否则它们不会分配内存。这将导致 vtgate 进程的内存使用量明显减少,尤其是在 busy Vitess clusters 中。 大多数改进是在 vtgate 的 CPU 和内存使用方面。开发团队正在努力对延迟和吞吐量的影响进行基准测试,一旦有结果就会公布。 User Interface Vitess 10.0 引入了一个实验性的 multi-cluster admin API 和 Web UI,称为 VTAdmin。部署 vtadmin-api 和 vtadmin-web 组件是完全自愿的。值得注意的是,VTAdmin 依赖于新的 VtctldServer API,所以你必须在你的 vtctlds 上运行新的 grpc-vtctld 服务才能使用它。 Benchmarking 为了确保 Vitess 为用户提供高性能,自 Vitess 9.0 以来,开发团队一直在改进基准测试和性能监控技术。项目arewefastyet是这些技术的核心,目前仍在开发中,其目标是自动测量和观察 Vitess 的性能。 详情可查看:https://vitess.io/blog/2021-04-27-announcing-vitess-10/

资源下载

更多资源
Nacos

Nacos

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

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册