- 博客(20)
- 收藏
- 关注
原创 c++计时函数
#include <chrono>using namespace std::chrono;int main(int argc,char** argv){ auto startTime = high_resolution_clock::now(); auto endTime = high_resolution_clock::now(); cout<<"用时: "<<duration_cast<microseconds>(endTime
2021-09-16 11:13:29
221
原创 openMP配置(qmake&cmake)
qmakeQMAKE_CXXFLAGS+=/openmpCMakeListsfind_package(OpenMP)if(OpenMP_CXX_FOUND) target_link_libraries(MyTarget PUBLIC OpenMP::OpenMP_CXX)endif()
2021-09-16 09:51:29
589
原创 ubuntu18.4 pcl1.12安装
1.安装pcl所需库sudo apt-get updatesudo apt-get install libboost-all-devsudo apt-get install libflann-devsudo apt-get install libusb-1.0-0-dev sudo apt-get install libopenni-dev libopenni2-dev #可选 用于kinect等iosudo apt-get install libqhull* #可选,用
2021-09-05 13:41:48
2547
5
原创 ubuntu18.4安装opencv4.5.3及contrib模块
1.下载解压wget -O opencv.zip https://github.com/opencv/opencv/archive/master.zipwget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/master.zipunzip opencv.zipunzip opencv_contrib.zip2.安装opencvmkdir -p build && cd build
2021-09-05 12:01:04
545
转载 pcl点云变换位姿及显示
#include <pcl/io/pcd_io.h>#include <pcl/common/transforms.h>#include <pcl/visualization/cloud_viewer.h>int main(){ pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); pcl::io::loadPCDFile("mod
2021-07-15 14:29:00
1520
原创 pthread属性设置(detach)
#include <pthread.h>#include <iostream>using namespace std;void* printChar(void* data){ int a = *reinterpret_cast<int*>(data); while(true) cout<<a++<<endl; return reinterpret_cast<void*>(*reinterpre
2021-07-14 09:02:55
290
原创 pthread创建多个线程实例
通过Pthread循环创建多个线程#include <pthread.h>#include <iostream>using namespace std;void* printChar(void* data){ return reinterpret_cast<void*>(*reinterpret_cast<int*>(data));}int main(void){ pthread_t tids[10]; int r
2021-07-13 16:18:44
767
转载 映射中象与原象的概念
**设两个集合A和B,和它们元素之间的对应关系R,如果对于A中的每一个元素,通过R在B中都存在唯一一个元素与之对应,则该对应关系R就称为从A到B的一个映射(Mapping).其中A称为原象,B称为象.例: f(5)→3 5的像是3,3的原像是5**...
2021-07-05 19:38:36
4416
转载 getOptimalNewCameraMatrix()函数说明
Consider the image above. It has been undistorted. Lines that are straight in 3D space are now straight in the 2D projection (the 2D image). Radial distortion has been removed. But what’s up with the “four pointed star” shape? This is because in order to .
2021-06-29 09:12:36
1381
原创 opencv4b遍历文件夹工具glob
1.API说明void cv::glob ( String pattern,std::vector< String > & result,bool recursive = false ) pattern : 待遍历文件夹result:该文件夹下所有文件路径resursive: 递归遍历(递归遍历pattern文件夹下的文件夹)2.例子#include <iostream>#include <vector>#include <st
2021-06-28 15:57:53
385
原创 Linux下生成可双击执行的C++程序
在CMakeLists.txt文件中设定// An highlighted blockset(CMAKE_CXX_FLAGS "-no-pie") set(CMAKE_C_FLAGS "-no-pie")
2021-06-25 14:31:12
698
2
转载 类成员函数中对另一成员函数使用多线程
class ClassA{public: void Fun1() { std::thread t(&ClassA::Fun2, this); t.join(); } void Fun2() { // do sth... std::cout << "in Fun2" << std::endl; }};int main(){ ClassA a; .
2021-06-18 09:31:48
247
原创 c++ 多线程调用类成员函数方法
main.cpp#include <iostream>#include <thread>using namespace std;class print{public: void printHello(string name) { cout<<"Hello "<<name<<"!!!\n"; }};int main(int argc, char **argv) { print
2021-04-29 16:35:08
7047
原创 undefined reference to cv::imread(std::__cxx11::basic_string.......未定以引用
问题描述: 用cmake编译时出现这个问题: undefined reference to cv::imread(std::__cxx11::basic_string.... 对‘cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)’未定义的引用解决方法:在CMakeLists.txt中加入以下指令:
2020-11-27 10:52:57
2929
4
原创 用c++遍历文件夹
代码:#include <iostream>#include <string>#include <vector>#include <algorithm>#include <dirent.h>using namespace std; bool get_filelist_from_dir(std::string _path, std::vector<std::string>& _files){ DIR* di
2020-11-18 14:38:27
182
原创 在Kaggle上训练PointNet
一级标题二级标题# This Python 3 environment comes with many helpful analytics libraries installed# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python# For example, here's several helpful packages to loadimport numpy as n
2020-11-12 15:33:54
521
1
原创 使用pcl将ply格式点云转化为pcd格式
下面展示一些 内联代码片。#include <iostream>#include <pcl/point_types.h>#include <pcl/io/ply_io.h>#include <pcl/io/pcd_io.h>typedef pcl::PointXYZ PointT;typedef pcl::PointCloud<PointT> PointCloudT;int main(int argc,char** argv){
2020-11-11 15:05:52
550
2
原创 AttributeError: module ‘tensorflow._api.v2.io.gfile‘ has no attribute ‘get_filesystem‘错误
AttributeError: module ‘tensorflow._api.v2.io.gfile’ has no attribute 'get_filesystem’错误在运行pytorch官方历程时出现题示错误1.原因在同一环境中安装pytorch和tensorflow以及tensorboard,产生冲突2.解决方案(1) 将tensorflow安装到其他环境中(2)代码开头添加:import tensorflow as tfimport tensorboard as tbtf.i
2020-10-21 08:36:44
3219
3
原创 用PCL库读取并显示PLY点云文件
下面展示一些 内联代码片。// main.cpp#include <iostream>#include <pcl/point_types.h>#include <pcl/io/ply_io.h>#include <pcl/visualization/pcl_visualizer.h>typedef pcl::PointXYZ PointT;typedef pcl::PointCloud<PointT> PointCloudT;
2020-09-02 09:05:46
5300
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人