- 博客(291)
- 资源 (3)
- 收藏
- 关注

原创 好博客 好工具
博客网站:田志亮博客:http://home.cnblogs.com/u/tianzhiliang/ 有一个开源的项目:http://www.cnblogs.com/hegezhou_hot/archive/2012/01/31/2332635.html#2299814周靖的博客(出版书的互动平台):http://transbot.blog.16
2012-07-17 10:48:32
1326
转载 Aruco 码精细化检测--参数说明
例如,如果单元格的大小为40像素,参数值为0.1,那么大小为40*0.1=4像素的边界将被剔除。原因在于,透视变换之后,单元格的颜色不会完全分离,白色的单元格可能会混入一些黑色的单元格(反之亦然)。例如,图像大小为640 x 480,最小相对marker周长为0.05的图像,将会产生一个最小周长640*0.05=32(像素)的marker,因为640是图像的最大尺寸。较大的值可以产生窗口区域内比较靠近的图像角,marker角会移动到一个不同的错误的地方。两张不同的marker之间的任一对角的最小距离。
2023-11-20 23:36:47
1190
原创 OpenCV 相机相关函数
2. 计算多个二维点对之间的最优放射变换矩阵(误差最小准则):estimateRigidTransform();3. 计算四个二维点对之间的透射变换:getPerspectiveTransform();1. 计算三个二维点对之间的仿射变换矩阵:getAffineTransform()3. 对输入二维点对进行仿射变换:transform();4. 对输入三维点对进行透射变换:perspectiveTransform();4. 计算多个三维点对之间的仿射变换:estimateAffine3D();
2023-10-26 11:53:29
1244
原创 win10 + VS2022 安装opencv C++
最近需要用到C++ opencv,看了很多帖子都需要自己编译opencv源码。为避免源码编译,可以使用VS来配置opencv C++。
2023-08-10 00:08:25
839
转载 nginx location 详解
在nginx中配置proxy_pass时,如果在proxy_pass后面的url加/,相当于是绝对根路径,则nginx不会把location中匹配的路径部分代理走;如果没有/,则会把匹配的路径部分给代理走。
2022-12-14 21:32:49
309
原创 数据长度与数据类型的选择
进行开发时,对一些数据范围的要求,需要确定使用什么想的数据类型。在C++中,数据类型有:int (int32, int64), long , short, float, double, bool, char。其中bool 和char很简单,一个字节。重点探讨其余几种的长度。在程序中,可通过使用sizeof获取类型的长度。类型 数据范围(32位) 64位 备注 char* 4 4 指针四个字节(即一个整形) int 4 4 -2^31 ..
2022-04-16 09:38:41
1115
原创 通过服务名称 远程调用服务
import osimport sysimport grpcclass CustomModule: def __init__(self, name, server_info, proto_files,): # proto_file: one folder, includes proto file name + proto file content self.name = name self.server_info = server_in.
2022-02-15 16:02:24
619
翻译 python md5加密
import hashlibdef _md5(file_path): md5hash = hashlib.md5() chunk_size = 4096 with open(file_path, 'rb') as f: content_buffer = f.read(chunk_size) while content_buffer: md5hash.update(content_buffer) c.
2021-11-24 13:49:53
113
原创 Ray 简单性能对比
import timeimport ray@ray.remotedef multi(x): return x*xdef single_thread(x): return x*xstart = time.time()parallel_result = [multi.remote(i) for i in range(100)]diff = time.time()-startprint(diff)start = time.time()for i in range(1.
2021-10-20 13:31:28
289
2
翻译 python thread VS async
python - Threads vs. Async - Stack Overflowhttps://krondo.com/in-which-we-begin-at-the-beginning/与threading相比, async的优势表现为3点:It is very difficult to write code that is thread safe. With asyncronous code, you know exactly where the code will shift fro
2021-10-13 09:35:42
1062
原创 python 多线程/async 读/写文件
IO操作会造成程序阻塞耗时,因此采用 QUEUE + 多线程方式让IO操作不再阻塞主程序的运行,这样可以减少主程序的等待时间from concurrent.futures import ThreadPoolExecutorimport timeimport threadingdata_queue=[] # event_id: [data] | event_id: [data1, data2, ... ]def call_write_data(data): print('
2021-10-12 15:30:22
3879
原创 grpc : Received message larger than max
status = StatusCode.RESOURCE_EXHAUSTED details = "Received message larger than max (4282239 vs. 4194304)" debug_error_string = "{"created":"@1633745838.187727309","description":"Received message larger than max (4282239 vs. 4194304)"grp...
2021-10-09 10:35:33
4485
转载 Filebeat + ES + kibana Ingest node 做解析
https://zhuanlan.zhihu.com/p/77413046使用Filebeat + ES + Kibina的组合进行日志收集的一个优点就是轻量级,因为去掉了笨重的logstash, 占用资源更少。但这也引入了一个问题,即filebeat并没有logstash那样强大的日志解析能力,往往只能把整条日志当成一个整体扔到ES中。好消息是,ES从5.x版本开始引入了Ingest Node,即允许你在对文档进行索引之前进行预处理,且支持logstash的Grok语法。因此我们可以在ES中针对我
2021-09-08 14:52:54
322
原创 ES集群的两节点cluster UUID不同
问题:[2021-09-08T10:38:59,081][WARN ][o.e.c.c.Coordinator ] [ES101] received cluster state from {ES102}{ucX4ZoDlRCC7K5rb8nQNbw}{szS9UWQ5Qa6rxJf-0bhObg}{10.1.100.43}{10.1.100.43:9301}{cdfhilmrstw}{ml.machine_memory=67411681280, ml.max_open_jobs=512,...
2021-09-08 13:31:04
4428
3
转载 elstic search 报错max virtual memory areas vm.max_map_count [65530] is too low,max file descriptors
https://blog.youkuaiyun.com/ghostyusheng/article/details/87201037
2021-09-07 18:24:30
94
1
原创 ES ./elasticsearch-setup-passwords
今天手欠 本来想往集群中添加一台ES,配置好后,手欠有运行了一次 setup password 然后 ES启动不来了 错误Failed to authenticate user 'elastic' against http://172.16.xxx.xxx:9200/_security/_authenticate?prettyPossible causes include:* The password for the 'elastic' user has already been change...
2021-09-07 15:59:04
5185
转载 ES 之 Routing
前言当索引一个文档的时候,文档会被存储到一个主分片中。那么,elasticsearch如何知道一个文档应该存放到哪个分片中呢?首先这肯定不是随机的,否则在检索文档时就不知道该从哪去寻找它了。实际上这个过程是根据下面公式决定的:shard = hash(routing) % number_of_primary_shardsrouting是一个可变值,默认是文档的_id,也可以是自定义的值。hash函数将routing值哈希后生成一个数字,然后这个数字再除以number_..
2021-09-03 14:02:28
3025
2
转载 ES 之 Rollover
在看ILM时发现很多policy 对HOT数据都有rollover操作,不太明白这个rollover是什么神操作。终于找到一篇相关介绍,防止原博客被删,自己copy过来。https://www.shuzhiduo.com/A/rV57W9ea5P/索引名一般而言,客户端将数据每天写入一个索引,比如直接写入YYYY-MM-HH格式的索引,那么我们只需要在写入的客户端里面获取时间,然后得到相应的格式即可,例如logstash写入ES时索引名就是logstash-YYYY-MM-HH,
2021-09-03 09:48:36
1550
2
转载 Elasticsearch Index Lifecycle Management (ILM)
0 - 前言Elastic Stack 6.6版本的发布,带来了很多新功能,比如:Index Lifecycle Management Frozen Index Geoshape based on Bkd Tree SQL adds support for Date histograms ……在这些众多功能中,Index Lifecycle Management(索引生命周期管理,后文简称 ILM) 是最受欢迎的。今天我们从以下几方面来快速了解下该功能:为什么索引会有生命?什么是索引生
2021-09-02 17:52:58
1071
2
原创 XGBoost tree
1. python有已经封装好的XGboost库,直接pip install就可以调用, 抄的源代码如下:from xgboost import XGBClassifierfrom numpy import loadtxtimport numpy as npfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import accuracy_scorefrom xgboost import plo..
2021-08-31 19:11:40
260
转载 Ubuntu 安装 pyltp
https://blog.youkuaiyun.com/m0_45478865/article/details/109764596安装ltpgit clone https://gitee.com/fastsource/ltpcd ltppip install -r requirements.txtpython setup.py install回到ltp的上级目录git clone https://gitee.com/fastsource/pyltpcp -r ltp/ pyltp/cd p.
2021-08-24 16:49:44
305
转载 protobuf 的duration 与 timestamp
// Protocol Buffers - Google's data interchange format// Copyright 2008 Google Inc. All rights reserved.// https://developers.google.com/protocol-buffers///// Redistribution and use in source and binary forms, with or without// modification, are per.
2021-08-11 13:41:35
1355
原创 protobuf 中bytes与string在C++中的区别
protobuf中有string 和 bytes两种数据类型, 相对应于python中的 string和 bytes类型。但在C++中有::std::string 却没有bytes类型。他们之间怎么转换。看了一些介绍得到的结论是:(1)在C++中,protobuf的string类型和bytes类型都对应与C++的::std::string类型(2)区别是,protobuf中string 对应的 std::string 类型需进行UTF8字符的检查,而bytes对应的std::string类型
2021-08-11 12:53:13
4562
3
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人