OpenCV

building opencv with sfm module issues

元气小坏坏 提交于 2021-02-11 13:26:55
问题 I am trying to build opencv with sfm modules I've built and installed gflags then glog and the ceres-solver. Yet the make logs says: Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags . Even though in earlier lines it says it finds both to these directories. I've also built and installed VTK though for some reason it doesn't find it even when I manually select the build directory. Below is the relevant section of my CMake log: VTK is not found. Please set

building opencv with sfm module issues

天大地大妈咪最大 提交于 2021-02-11 13:26:36
问题 I am trying to build opencv with sfm modules I've built and installed gflags then glog and the ceres-solver. Yet the make logs says: Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags . Even though in earlier lines it says it finds both to these directories. I've also built and installed VTK though for some reason it doesn't find it even when I manually select the build directory. Below is the relevant section of my CMake log: VTK is not found. Please set

I'm reading images on the disk, how to plot like the first 50 images?

给你一囗甜甜゛ 提交于 2021-02-11 13:13:03
问题 I am reading images on the disk, how to make a for and where to put it to plot the first 50 images on the screen, I want to make sure, that I'm reading the right images, it's for deep learning. def load_clef_database(): img_data_list = [] dataset_dir = "/Users/PlantCLEF2015" root = os.path.join(dataset_dir, 'train') filenames = [] # files class_species = [] class_species_unique = [] class_species_unique_id = [] class_familys = [] class_geni = [] class_ids = [] class_contents = [] metadata = [

opencv C++ negative X,Y cordinates from detections (yolo detections)

老子叫甜甜 提交于 2021-02-11 13:11:30
问题 I am using Yolo detection algorithm to predict bounding boxes, but the detection returns some values as negative integers , but the cv::rectangle function draws correct rectangles on to images, so it's kind of puzzling why there are negative or even long values in the detection coordinates, here get_rect function returns x,y,width,height, after applying NMS std::vector<uint> rr = get_rect(img, res[j].bbox); later converted it into opencv understandable format: cv::Rect r = cv::Rect(rr[0],rr[1

I'm reading images on the disk, how to plot like the first 50 images?

穿精又带淫゛_ 提交于 2021-02-11 13:11:08
问题 I am reading images on the disk, how to make a for and where to put it to plot the first 50 images on the screen, I want to make sure, that I'm reading the right images, it's for deep learning. def load_clef_database(): img_data_list = [] dataset_dir = "/Users/PlantCLEF2015" root = os.path.join(dataset_dir, 'train') filenames = [] # files class_species = [] class_species_unique = [] class_species_unique_id = [] class_familys = [] class_geni = [] class_ids = [] class_contents = [] metadata = [

windows下用c++调用caffe做前向

偶尔善良 提交于 2021-02-11 13:10:42
参考博客: https://blog.csdn.net/muyouhang/article/details/54773265 https://blog.csdn.net/hhh0209/article/details/79830988 新建caffe的属性表,caffe_gpu_x64_release.props 将NugetPackages,caffe,CUDA中的头文件加进去 属性-C/C++-附加包含目录: D:\caffe20190311\NugetPackages\OpenCV.2.4.10 \build\native\include D:\caffe20190311\NugetPackages\OpenBLAS. 0.2.14.1 \lib\native\include D:\caffe20190311\NugetPackages\protobuf -v120.2.6.1 \build\native\include D:\caffe20190311\NugetPackages\glog. 0.3.3.0 \build\native\include D:\caffe20190311\NugetPackages\gflags. 2.1.2.1 \build\native\include D:\caffe20190311\NugetPackages\boost. 1.59.0

opencv C++ negative X,Y cordinates from detections (yolo detections)

我是研究僧i 提交于 2021-02-11 13:07:25
问题 I am using Yolo detection algorithm to predict bounding boxes, but the detection returns some values as negative integers , but the cv::rectangle function draws correct rectangles on to images, so it's kind of puzzling why there are negative or even long values in the detection coordinates, here get_rect function returns x,y,width,height, after applying NMS std::vector<uint> rr = get_rect(img, res[j].bbox); later converted it into opencv understandable format: cv::Rect r = cv::Rect(rr[0],rr[1

How to extract vertical and horizontal lines from the image

為{幸葍}努か 提交于 2021-02-11 12:44:55
问题 Task: I have a set of images where every image looks like this: I'd like to extract all horizontal and all vertical lines from this image. Desired results: Current approach: import cv2 image = cv2.imread('img.png') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) blur = cv2.GaussianBlur(gray, (3, 3), 0) thresh = cv2.threshold(blur, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1] horizontal_kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (20, 1)) horizontal = cv2.morphologyEx(thresh, cv2

How do you redistort a point?

谁说我不能喝 提交于 2021-02-11 12:42:46
问题 I have a distorted image on which I use Cv2.Undistort() which straightens it out. After this I find some points in the image. I need to get the location of those points in the distorted image. I have tried Cv2.ProjectPoints() but failed to get appropriate coordinates. They were outside the bounds of the image. This is how I went about doing this: List<float> arr = new List<float>(); foreach (var i in points) { arr.Add(i.X); arr.Add(i.Y); arr.Add(0); } Mat pointArr = new Mat(3, points.Count,

how to get a direct byte buffer from an address location

旧巷老猫 提交于 2021-02-11 12:32:29
问题 In this opencv example, the Mat object has a nativeObj field, returning a long that represents the address of the object (i.e 140398889556640 ). Because the size of the data within the object is known, I wish to access the contents of the Mat object directly, returning a byte buffer. What is the best way to do so? 回答1: You can wrap the address with a DirectByteBuffer or use Unsafe. While you can do this, you probably shouldn't. I would explore all other options first. // Warning: only do this