[mcj]利用opencv打开本地摄像头
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include <opencv2/opencv.hpp> using namespace cv; int main() { VideoCapture capture(0); Mat frame; while (capture.isOpened()) { capture >> frame; imshow("capture", frame); if (cvWaitKey(10) == 27) //cvWaitKey的参数相当于多少ms一帧,现在是40ms一帧,1s25帧 break; //按ESC就退出 } return 0; } |
本文最后更新于2019年5月21日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
[mcj]IIS8.5下进行301重定向
这是目前本站的web.config配置文件内容,做了301重定向以及伪静态
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="/ Z-BlogPHP Imported Rule" stopProcessing="true"> <match url="^.*?" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:0}" /> </rule> <rule name="/ Z-BlogPHP Imported Rule index.php" stopProcessing="true"> <match url="^index.php/.*?" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" /> </conditions> <action type="Rewrite" url="index.php/{R:0}" /> </rule> <rule name="WWW Redirect" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^machunjie.com$" /> </conditions> <action type="Redirect" url="http://www.machunjie.com/{R:0}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration> |
本文最后更新于2019年5月21日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈 […]
[mcj]typecho使用过程说明
自定义typecho后台路径 Typecho 安装好后,默认的后台路径是 domain.com/admin/,为了提高安全性,我们允许以 domain.com/xxxx/ 的方式访问,其中 xxxx 是你自定义的路径。自定义的方法如下: 你 […]
[mcj]百度蜘蛛来访的各个IP段介绍
根据不同的IP我们可以分析网站是个怎样的状态.下面 就按照IIS日记上的百度蜘蛛IP为例:123.125.68.*这个蜘蛛经常来,别的来的少,表示网站可能要进入沙盒了,或被者降权。 220.181.68.*每天这个IP 段只增不减很有可 […]
[转]像素,分辨率,屏幕大小,实际大小,打印大小之间的关系
1、像素数 像素(Pixel)可理解为是不同亮度、色调、色相、色温、灰度等的颜色信息,是构成影像的最小单位,对应于相机感光器件上的感光最小单位。大部分数码相机标示的是CCD的像素数,对应CCD上光电感应元件的数量。 像素数决定了一张图片由多 […]
[mcj]利用MATLAB进行相机标定,附源码!
前面写了关于c++的代码,以及python的,后来发现MATLAB也可以,并且更简单。代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
% Auto-generated by cameraCalibrator app on 26-Mar-2019 %------------------------------------------------------- % Define images to process imageFileNames = {'/home/ubuntu/Desktop/mcj/left1.jpg',... '/home/ubuntu/Desktop/mcj/left2.jpg',... '/home/ubuntu/Desktop/mcj/left4.jpg',... '/home/ubuntu/Desktop/mcj/left6.jpg',... '/home/ubuntu/Desktop/mcj/left9.jpg',... }; % Detect checkerboards in images [imagePoints, boardSize, imagesUsed] = detectCheckerboardPoints(imageFileNames); imageFileNames = imageFileNames(imagesUsed); % Generate world coordinates of the corners of the squares squareSize = 25; % in units of 'mm' worldPoints = generateCheckerboardPoints(boardSize, squareSize); % Calibrate the camera cameraParams = estimateCameraParameters(imagePoints, worldPoints, ... 'EstimateSkew', false, 'EstimateTangentialDistortion', false, ... 'NumRadialDistortionCoefficients', 2, 'WorldUnits', 'mm'); % View reprojection errors h1=figure; showReprojectionErrors(cameraParams, 'BarGraph'); % Visualize pattern locations h2=figure; showExtrinsics(cameraParams, 'CameraCentric'); % For example, you can use the calibration data to remove effects of lens distortion. originalImage = imread(imageFileNames{1}); undistortedImage = undistortImage(originalImage, cameraParams); % See additional examples of how to use the calibration data. At the prompt type: % showdemo('MeasuringPlanarObjectsExample') % showdemo('SparseReconstructionExample') |
会生成两个图,一个是标定图片的空间位置 另一个是每张图片的重投影误差 图片最 […]
[mcj]利用python-opencv进行相机标定(多张图片,附完整代码及图片)
之前已经有一个用python-opencv做标定的程序,https://www.machunjie.com/visual/60.html 不过有点问题,只是单张图片而已,这次的程序是多个图片一起进行标定,结果会增加不少。 代码如下: [cr […]
[mcj]ubuntu16.04 美化 更换更加漂亮的主题
要更换的是flatabulous主题,这个主题看起来很漂亮哦~ 首先更新一下源
1 |
sudo apt update |
这里注意下,有很多博客这里都会加上sudo apt upgrade,不过我劝大家不要这么做,这 […]
[mcj]如何利用二级域名跳转二级目录
适用于Apache、nginx、IIS 其实很简单,只需要利用php的跳转功能,不多说,代码如下:
1 2 3 4 5 6 7 8 |
<?php $domain = $_SERVER['HTTP_HOST']; if($domain == "www.machunjie.com"){ header("location:http://www.machunjie.com/blog"); }else if($domain == "machunjie.com"){ header("location:http://www.machunjie.com/blog"); } ?> |
本文最后更新于2019年5月21日,已超过 1 年没有更新,如果文章内容或 […]
[mcj]Ubuntu16.04使用LXD/LXC容器连接USB
我需要将我的USB接口暴露给我的LXD容器,而我正在使用Ubuntu 16.04机器。运行“lsusb”,我可以在主机和容器上看到相同的接口。 在我的容器内我使用的软件利用了这个USB接口(和相关的连接设备),但在执行阶段,一条消息告诉: […]