小功能
刀么克瑟拉莫
那温热的牛奶瓶在你手中握紧
展开
-
yolo格式转labelme格式并验证
【代码】yolo格式转labelme格式并验证。原创 2023-09-07 18:04:50 · 508 阅读 · 0 评论 -
python使用鼠标在图片上画框
【代码】python在图片上画框。原创 2023-09-05 17:10:23 · 1331 阅读 · 0 评论 -
python直接在RGB调整饱和度,亮度,对比度
【代码】python直接在RGB调整饱和度,亮度,对比度。原创 2023-07-10 11:35:59 · 1212 阅读 · 0 评论 -
python查看coco格式的box
【代码】python查看coco格式的box。原创 2023-06-29 11:29:10 · 144 阅读 · 0 评论 -
labelme点到图像外面导致崩溃的解决办法
【代码】labelme点到图像外面导致崩溃的解决办法。原创 2023-06-21 20:18:47 · 105 阅读 · 0 评论 -
求点集中最近点对--期望线性法
点集中最近点对,期望线性法,vector和普通数组原创 2022-11-21 18:45:49 · 213 阅读 · 1 评论 -
查看任意hsv值的颜色(Trackbar)
查看任意hsv值的颜色查看任意rgb值的颜色原创 2022-10-27 14:42:00 · 761 阅读 · 2 评论 -
你不知道的stringstream的用法
保留两位小数并保存到字符串stringstream和iostream的用法很相似#include <sstream>#include <iomanip>#include <iostream>using namespace std;int main(int argc, char **argv) { double a = 0.13567; stringstream ss; ss << fixed << setprecis.原创 2022-05-30 10:37:21 · 113 阅读 · 0 评论 -
最小二乘法拟合直线
直线方程是y=a*x+b推导如下图右边例子是用(1,8)和(5,20)拟合直线C++代码如下void GetLine(vector<MyPoint> v, float &a, float &b) { float xy=0,x=0,y=0,xx=0; int n = v.size(); for(int i = 0; i < v.size(); ++i) { xy += v[i].x * v[i].y; x += v[i].x; y += v[i].原创 2022-05-06 11:00:38 · 503 阅读 · 0 评论 -
opencv提取图像红色部分并提取角点
#include <iostream>#include <opencv2/opencv.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;void rgb2hsv(double r, double g, double b, double &h, dou原创 2022-04-26 11:46:11 · 974 阅读 · 0 评论 -
opencv摄像头异常处理
摄像头打开失败摄像头中途拔插,掉电cv::VideoCapture capture(camera_id_);cv::Mat frame;while (!capture.isOpened()){ ROS_INFO("%s open fail!", camera_id_.c_str()); sleep(3); capture.open(camera_id_);}while (ros::ok()){ capture >> frame; if .原创 2021-07-28 11:32:38 · 1472 阅读 · 0 评论 -
ubuntu C++文件夹操作
#include <iostream>#include <unistd.h> // access#include <sys/types.h> // mkdir rmdir#include <sys/stat.h> // mkdir rmdirusing namespace std;int main() { char path[] = {"/home/lwd/code/cpp/原创 2021-07-28 11:27:48 · 353 阅读 · 0 评论 -
ubuntu同时解压多个tar到不同目录
n=1for i in $(seq 1 300)do mkdir $n n=$((1+n))donen=1for f in /home/lwd/data/imagenet/train_tar/*tardo echo $n tar -xf $f -C $n n=$((1+n))done原创 2021-03-12 14:57:16 · 343 阅读 · 0 评论 -
C++求素数(程序计时)
#include <iostream>#include <string>#include <stdio.h>#include <time.h>//#include <sys/time.h>using namespace std;//统计小于n的素数个数int prime(int n) { //记录某数是否访问 ...原创 2015-05-21 12:10:03 · 808 阅读 · 0 评论 -
21种颜色的rgb值及显示
#include <opencv2/opencv.hpp>int colors[21][3] = { {255, 0, 0}, {255, 69, 0}, {255, 99, 71}, {255, 140, 0}, {255, 165, 0}, {238, 173, 14}, {255, 193, 37}, {255, 255, 0}, .原创 2020-11-02 14:57:08 · 1740 阅读 · 0 评论 -
linux记录某个程序的内存和CPU占用
mem.sh#!/bin/bashprocess=$1pid=$(ps -e|grep $process| grep -v 'grep' | awk '{print $1;}')while truedo mem=`cat /proc/$pid/status|grep -e VmRSS` cpu=`top -n 1 -p $pid|tail -3|head -1|awk '{ssd=NF-4} {print $ssd}'` echo $(date +"%y-%m-%d-%H:%M.原创 2020-09-07 14:17:07 · 2874 阅读 · 0 评论 -
C++、python从路径中提取文件名
string getPicName(string path) { int l = path.length(); int i; for(i = l-1; i >=0; i--) { if(path[i] == '/') break; } return path.substr(i+1, l-i-1);}原创 2020-07-13 14:38:05 · 1342 阅读 · 0 评论 -
写代码不得不看系列
在电脑上发现以前保存的一段脚本#!/bin/bashfor sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do ( syspath="${sysdevpath%/dev}" devname="$(udevadm info -q name -p $syspath)" [[ "$devname" == "bus/"* ]] && continue .原创 2020-07-01 14:15:02 · 125 阅读 · 0 评论 -
C++实现按空格暂停,按任意键继续,按ESC退出
借助opencv实现#include<opencv2/opencv.hpp>using namespace cv;int key = waitKey(10) & 0xff;if(key == 32) { waitKey(0);}if(key == 27) { return;}原创 2020-06-16 16:30:08 · 4347 阅读 · 3 评论 -
求点集的最小面积外接矩形
求点集的最小面积外接矩形void Rotate(float& x, float& y, float angle) { float a = x * cos(angle) - y * sin(angle); float b = x * sin(angle) + y * cos(angle); x = a; y = b;}void Rect(const vecto...原创 2019-12-17 09:59:08 · 1575 阅读 · 0 评论 -
ubutnu C++获取所有文件
#include <iostream>#include <vector>#include <dirent.h>#include <sys/stat.h>using namespace std;int findfileinfolder(const char *dir_name, string extend_name, vector<...转载 2019-10-22 18:13:21 · 282 阅读 · 0 评论 -
ubuntu C++ 获取当前系统时间
#include <stdio.h>#include <time.h>std::string getCurrentTimeStr(){ time_t t = time(NULL); char ch[64] = {0}; char result[100] = {0}; strftime(ch, sizeof(ch) - 1, "%Y%m%d--%H%M%...原创 2019-10-21 17:55:20 · 2630 阅读 · 0 评论