
轮子
刀么克瑟拉莫
那温热的牛奶瓶在你手中握紧
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++有序数组求上下界
C++有序数组求上下界原创 2023-02-14 12:00:50 · 281 阅读 · 0 评论 -
求点到线段或直线的距离(不计算角度)
求点到线段或直线的距离 不计算角度原创 2022-12-16 10:04:15 · 144 阅读 · 0 评论 -
求点集中最近点对--期望线性法
点集中最近点对, 期望线性法, vector和普通数组原创 2022-11-21 18:45:49 · 292 阅读 · 1 评论 -
你不知道的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 · 146 阅读 · 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 · 605 阅读 · 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 · 849 阅读 · 0 评论 -
C++ 卡尔曼滤波
以行人为例,可测量的数据是二维坐标 #include <iostream> #include <eigen3/Eigen/Dense> #include <fstream> using namespace Eigen; using namespace std; class Kalman { public: Kalman() : is_init_(false) {} ~Kalman() {} void Init(float mx, float.原创 2020-12-29 10:54:18 · 878 阅读 · 3 评论 -
C++高斯混合型GMM实现
#ifndef MYGMM_H #define MYGMM_H #include <iostream> #include <Eigen/Dense> #include <math.h> #include <vector> #define EPS 0.00000001 using namespace std; using namespace Eigen; Eigen::MatrixXf getCov(Eigen::MatrixXf input) {原创 2020-11-09 17:58:35 · 337 阅读 · 0 评论 -
深度图坐标转化彩色图坐标
1. 理论 像素坐标系坐标原点在图像的左上角,X轴沿着水平方向向右,Y轴竖直向下 图像坐标系坐标原点在图像的中心,X轴沿着水平方向向右,Y轴竖直向下 相机坐标系X轴沿着水平方向向右,Y轴竖直向下,Z轴向前 像素(u,v)和三维点(x,y,z)的对应关系是 u=fx*x/z+cx (1) v=fy*y/z+cy (2) x=(u-cx)*z/fx (3) y=(v-cy)*z/fy (4) fx,cx,fy,cy是相机的内参 具体分析可以看这里 2.流程 从上面两个公式我们知道转化需要距离,所以原创 2020-09-22 11:11:40 · 1792 阅读 · 10 评论 -
决策树C++实现,ID3,C4.5,CART
#include <iostream> #include <vector> #include <queue> #include <math.h> #include <fstream> using namespace std; struct node { node *left; node *right; int feature_id; float threshold; }; /*******************原创 2020-08-03 16:25:52 · 459 阅读 · 4 评论 -
C++非极大值抑制NMS实现
闲言碎语不要讲,直接代码come on 调用process即可,输入为一种或多种类别的框 用到list降序排序的方法 #include <vector> #include <list> using namespace std; typedef struct bbox { int c; // 物体类别 float p; // 置信度 // 左上点坐标 int x; int y; // 右下点坐标 .原创 2020-06-02 14:24:46 · 939 阅读 · 0 评论 -
C++ 双线性插值缩放图像
缩放灰度图cv::Mat bilinear(cv::Mat src, int row, int col){ int rows = src.rows, cols = src.cols; cv::Mat dst(row, col, src.type()); for(int i = 0; i < row; ++i) { //以ptr的方式访问dst的数据原创 2017-07-26 21:31:33 · 4459 阅读 · 1 评论