
OpenCV
文章平均质量分 55
OpenCV中文网公众号
专注分享OpenCV和计算机视觉最新技术
展开
-
OpenCV读取MP4视频裁剪部分后写成AVI视频
// CropVideo.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "opencv.hpp"using namespace cv;using namespace std;int main(){ VideoCapture cap("F:\\Ima原创 2018-01-26 17:34:49 · 1853 阅读 · 0 评论 -
Python-OpenCV读取png图像转成jpg图像存储
import osimport cv2import sysimport numpy as nppath = "F:\\ImageLib\\VRWorks_360_Video _SDK_1.1\\footage14\\"print(path)for filename in os.listdir(path): if os.path.splitext(filename)[1] =原创 2018-01-22 10:43:51 · 25720 阅读 · 11 评论 -
配置OpenCV使之支持CMake直接编译工程
只需要将官方下载的OpenCV解压,将含有OpenCVConfig.cmake文件的目录添加到系统环境变量即可。在我的电脑里,也就是把目录F:\ImageLib\opencv\opencv3.4\build添加到系统环境变量。原创 2018-01-11 11:20:19 · 950 阅读 · 0 评论 -
OpenCV ios 摄像头获取和磁盘读取的图像RGB顺序问题
OpenCV ios 摄像头获取和磁盘读取的图像RGB顺序问题1.摄像头 - (void)processImage:(cv::Mat&)image { // Do some OpenCV processing with the image }在这个函数中,遵从OpenCV的习惯,输入输出参数原创 2018-01-09 11:08:42 · 895 阅读 · 0 评论 -
Zero-Copy: CUDA, OpenCV and NVidia Jetson TK1
Zero-Copy: CUDA, OpenCV and NVidia Jetson TK1: Part 1https://ohmwardbond.blogspot.jp/2017/03/zero-copy-cuda-opencv-and-nvidia-jetson.htmlIf you aren't yet familiar with NVidia's embedded ECU原创 2018-01-02 09:28:22 · 1507 阅读 · 0 评论 -
遍历OpenCV中Mat结构最快速的方法
#pragma omp parallel for num_threads(64)for (int i = 0; i < src_bgr.rows; i++){ uchar* data = src_bgr.ptr(i); for (size_t j = 0; j < src_bgr.cols; j++) { int B = *data++; int G = *data++; i原创 2017-12-29 14:12:32 · 2461 阅读 · 0 评论 -
LBP Library - A Collection of LBP algorithms for background subtraction in videos
https://github.com/carolinepacheco/lbplibraryThe LBP Library is a collection of eleven Local Binary Patterns (LBP) algorithms developed for background subtractionproblem. The algorithms were imp原创 2017-12-14 09:35:26 · 703 阅读 · 0 评论 -
批量图像格式转换
基于OpenCV和Dlib的批量图像格式转换的工程https://github.com/reunanen/convert-images主要代码在这里:#include #include #include "cxxopts/include/cxxopts.hpp"int main(int argc, char** argv){ if (argc == 1)原创 2017-11-30 10:23:19 · 1221 阅读 · 0 评论 -
OpenCV实现的SSIM
来自于 :path-to-opencv\sources\doc\tutorials\videoio\video-input-psnr-ssimScalar getMSSIM( const Mat& i1, const Mat& i2){ const double C1 = 6.5025, C2 = 58.5225; /****************************原创 2017-06-20 14:43:44 · 4357 阅读 · 0 评论 -
从视频读图像按照数字编号增加写入硬盘
从视频读图像按照数字编号增加写入硬盘void makeImagePath(const string &path, int index, string &imagePath){ char s[32]; sprintf(s, "%d", index); imagePath = path + s + string(".jpg");}void getImagesFromVideo(c原创 2016-10-31 11:39:11 · 424 阅读 · 0 评论 -
测试矩阵连续运算的速度问题的代码
float r = 0.0f;RNG rng(1);double t1 = (double)getTickCount();for (size_t i = 0; i < 10000; i++){ Mat a, b, c; a = Mat::ones(512, 512, CV_32FC1); a = a * rng.uniform(0.0f, 100.0f); b = Mat::on原创 2016-09-22 11:15:18 · 450 阅读 · 0 评论 -
OpenCV仿射变换
根据指定的3对点,确定仿射变换,并据此,对vSrc里的点进行仿射。原创 2014-09-25 17:45:22 · 725 阅读 · 0 评论 -
OpenCV读写yml文件里的Mat变量
void WriteObjectYml(const char* filename,const char* variablename,const Mat &source){ cv::FileStorage fs(filename, cv::FileStorage::WRITE); fs<<variablename<<source; fs.release();}void ReadOb原创 2014-06-23 14:23:55 · 1669 阅读 · 0 评论 -
OpenCV计算两个矩形的重合度
float DecideOverlap(const Rect &r1,const Rect &r2){ int x1 = r1.x; int y1 = r1.y; int width1 = r1.width; int height1 = r1.height; int x2 = r2.x; int y2 = r2.y; int width2 = r2.width; int hei原创 2014-06-23 14:20:10 · 6722 阅读 · 0 评论 -
OpenCV删除Mat矩阵的指定的一列
OpenCV的Mat类没有删除一行或一列的函数原创 2014-06-17 16:31:07 · 6527 阅读 · 2 评论 -
批量对txt里列出的图像去掉空格和#
#include "cv.h" #include "highgui.h" #include #include #include #include using namespace std;原创 2014-06-11 01:20:36 · 818 阅读 · 0 评论