
计算机视觉
_iorilan
10年以上软件工程经验,先后从事在线教育/IT金融/即时通信/政府/物流平台/零售/门禁/监控等领域。专注夯实基础/项目成本与架构平衡/框架调研/团队高效协同工作
展开
-
yolo+ ubuntu完成视频分析
使用yolo ubuntu完成视频分析下载源码并编译git clone https://github.com/pjreddie/darknetcd darknetmake下载训练好的模型wget https://pjreddie.com/media/files/yolov3.weights使用命令预测图片./darknet detect cfg/yolov3.cfg...原创 2019-02-16 22:07:33 · 1783 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 9 从照片出抓出所有人脸属性
from PIL import Image, ImageDrawimport face_recognition# Load the jpg file into a numpy arrayimage = face_recognition.load_image_file("./images/two_people.jpg")# Find all facial features in ...原创 2019-01-19 21:26:35 · 925 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 8 判断一张照片中是否存在人脸
face_recognition结合PIL库来判断指定路径的照片是否能抓出人脸。模型使用的是HOG(默认实现),下面的CNN的实现会更准确一些。from PIL import Imageimport face_recognition# Load the jpg file into a numpy arrayimage = face_recognition.load_image_fil...原创 2019-01-19 21:22:37 · 3690 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 7 使用knn分类器
结合python的face_recognition的knn的实现。训练过程使用的是scikit-learn。 import mathfrom sklearn import neighborsimport osimport os.pathimport picklefrom PIL import Image, ImageDrawimport face_recognitionf...原创 2019-01-19 21:21:03 · 1843 阅读 · 1 评论 -
使用Python face_recognition 人脸识别 - 6 从webcam中获取人脸
如果你使用的是VMWARE的ubuntu,需要以下配置来允许VM访问笔记本摄像头驱动:1. make sure vm-> settings -> USB capitability is 1.12. run commandssudo apt-get install cheese build-essential linux-headers-`uname -r`sudo apt-...原创 2019-01-19 21:16:23 · 871 阅读 · 1 评论 -
使用Python face_recognition 人脸识别 - 5 人脸比对并打分
比对两张人脸编码后的照片,打印出相似度。 import face_recognition# Often instead of just checking if two faces match or not (True or False), it's helpful to see how similar they are.# You can do that by using the...原创 2019-01-19 21:10:51 · 4028 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 4 标记出人脸属性
from PIL import Image, ImageDrawimport face_recognition# Load the jpg file into a numpy arrayimage = face_recognition.load_image_file("./images/biden.jpg")# Find all facial features in all the ...原创 2019-01-19 21:08:57 · 1359 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 3 识别人脸轮廓并编码
import timeit# Note: This example is only tested with Python 3 (not Python 2)# This is a very simple benchmark to give you an idea of how fast each step of face recognition will run on your syste...原创 2019-01-19 21:06:14 · 1048 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 2 人脸1-1比对
导入face_recognition库,直接比对两张人脸照片:import face_recognitionknown_image = face_recognition.load_image_file("./images/biden.jpg")unknown_image = face_recognition.load_image_file("./images/unknown.jpg")...原创 2019-01-19 21:04:52 · 888 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 10 解析一个视频文件中的人脸
示例说明:输入一个MP4文件,准备两张已知的人脸PNG照片,一旦找到匹配,弹出识别出的人脸照片。 import face_recognitionimport cv2# This is a demo of running face recognition on a video file and saving the results to a new video file.## P...原创 2019-01-19 21:29:06 · 1708 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 11 识别出人脸并以矩形标记
图片库使用的还是PIL,用来highlight出识别的人脸。 import face_recognitionfrom PIL import Image, ImageDraw# This is an example of running face recognition on a single image# and drawing a box around each person th...原创 2019-01-19 21:30:36 · 1378 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 12 人脸图片1-N比对
示例说明:准备一张(或非)人脸图片,准备多张已知人脸图片数组。进行1-N比对。如果人脸存在,打印出人名;否则打印出没有找到人脸。例子中把路径写死了,真实应用可以考虑从远程获取人脸信息并生成临时目录进行比对。import face_recognition# Load the jpg files into numpy arraysbiden_image = face_recognition...原创 2019-01-19 21:34:29 · 2007 阅读 · 0 评论 -
ubuntu 配置opencv 3.4环境
ubuntu install opencv-3.4 cd ~/mkdir opencvcd ~/opencvsudo apt-get updatesudo apt-get install -y build-essential cmakesudo apt-get install -y qt5-default libvtk6-devsudo apt-get install -y zl...原创 2019-02-16 22:05:22 · 1279 阅读 · 0 评论 -
使用Python 训练OpenCV Cascade分类器 - 5
测试。本例使用了3个opencv的分类器:haarcascade_frontalface_alt和haarcascade_eye是自带的。分别识别人脸和人眼。还有一个是cascade,也就是自己训练出来的分类器。此处测试取决于在这一步传给OPENCV的图片参数,也就是你想要识别的特征图(本例为手表):opencv_createsamples.exe -img watch5050.jpg -b...原创 2019-01-19 22:02:13 · 3318 阅读 · 1 评论 -
使用Python 训练OpenCV Cascade分类器 - 4
创建positive和negative样本。import cv2import numpy as npimport osdef create_pos_n_neg(): for file_type in ['neg']: for img in os.listdir(file_type): if file_type == '...原创 2019-01-19 21:53:46 · 1193 阅读 · 0 评论 -
使用Python 训练OpenCV Cascade分类器 - 3
这一步是筛选掉不符合条件的图。 import cv2import numpy as npimport osdef find_uglies(): match = False for file_type in ['neg']: for img in os.listdir(file_type): for ugly in os.lis...原创 2019-01-19 21:52:49 · 907 阅读 · 0 评论 -
使用Python 训练OpenCV Cascade分类器 - 2
从imagenet下载测试图片。中间会使用cv2来处理图片大小。import urllib.requestimport cv2import numpy as npimport osdef store_raw_images():#http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n04194289 ...原创 2019-01-19 21:51:37 · 778 阅读 · 0 评论 -
使用Python 训练OpenCV Cascade分类器 - 1
当然前提是你已经匹配好了open cv。本文就不赘述了,推荐linux环境。0. image net urls : 下载图片样本的链接:http://image-net.org/download-imageurlshttp://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n041942891. create sampl...原创 2019-01-19 21:50:10 · 2130 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 14 创建人脸识别1-1比对web服务
本例是对前一篇的web服务进行的一个扩展:接受两张上传的图片,判断上传的照片是否为同一个人。实现:# this sample is to compare if the 2 input photo is the same personimport face_recognitionfrom flask import Flask, jsonify, request, redirect...原创 2019-01-19 21:41:16 · 590 阅读 · 0 评论 -
使用Python face_recognition 人脸识别 - 13 创建一个web 服务识别上传的图片是否包含人脸
本例使用的是轻量的web框架flask。制作web服务一个attribute 搞定。python3的安装: pip3 install flask实现代码:import face_recognitionfrom flask import Flask, jsonify, request, redirect# You can change this to any folder on...原创 2019-01-19 21:38:59 · 1185 阅读 · 1 评论 -
使用Python face_recognition 人脸识别 - 1
在ubuntu环境配置步骤:sudo apt-get updatesudo apt-get install build-essential cmakesudo apt-get install libopenblas-dev liblapack-dev sudo apt-get install libx11-dev libgtk-3-devsudo apt-get install py...原创 2019-01-19 21:02:21 · 521 阅读 · 0 评论 -
ubuntu 安装python3和open cv
sudo apt-get install libopencv-dev python-opencvsudo pip3 install opencv-python在windows(坑多,不推荐):python -m pip install opencv-python原创 2019-01-08 23:22:29 · 739 阅读 · 0 评论 -
ffmpeg CCTV方案4 - ffserver
ffmpeg还有一个开源项目是ffserver,可以接收ffmpeg输入流并转码为http输出。以下为具体步骤:1. sudo apt-get install ffmpeg2. etc/ffserver.conf config:...Port 8090# bind to all IPs aliased or notBindAddress 0.0.0.0# max number o...原创 2018-12-01 23:35:10 · 1542 阅读 · 0 评论 -
python ubuntu dlib 8- 输出人脸坐标
输入图片检测人脸,输出人脸坐标import sysimport dlibif len(sys.argv) < 1: print("need specify the image file") exit()image_file = sys.argv[1]img = dlib.load_rgb_image(image_file)# Locations of candidat...原创 2018-12-02 15:28:20 · 730 阅读 · 0 评论 -
python ubuntu lib7 -计算人脸特征向量
1. 检测人脸2.提取人脸3.计算人脸特征向量(用于1:N或1:1比对),使用的是shape predictorimport sysimport osimport dlibimport globif len(sys.argv) != 4: print( "Call this program like this:\n" " ./fa...原创 2018-12-02 15:21:47 · 2005 阅读 · 0 评论 -
python ubuntu dlib 6- 人脸检测并画出轮廓
对输入图片进行人脸检测,画出人脸轮廓import sysimport osimport dlibimport globif len(sys.argv) != 3: print( "Give the path to the trained shape predictor model as the first " "argument and th...原创 2018-12-02 15:18:20 · 2294 阅读 · 0 评论 -
python ubuntu dlib 5 -人脸识别并打分
1.检测并提取输入图片的人脸(坐标)2.对每张人脸质量进行评分import sysimport dlibdetector = dlib.get_frontal_face_detector()win = dlib.image_window()for f in sys.argv[1:]: print("Processing file: {}".format(f)) ...原创 2018-12-02 15:09:08 · 587 阅读 · 0 评论 -
python ubuntu dlib 4 人脸聚类
1.找出最大聚类2.将人脸存入最大聚类的文件夹 实现:import sysimport osimport dlibimport globif len(sys.argv) != 5: print( "Call this program like this:\n" " ./face_clustering.py shape_pred...原创 2018-12-02 15:06:27 · 741 阅读 · 0 评论 -
python ubuntu dlib人脸识别3-人脸对齐
人脸对齐主要用于提特征。其他作用可以自行研究。import sysimport dlibif len(sys.argv) != 3: print( "Call this program like this:\n" " ./face_alignment.py shape_predictor_5_face_landmarks.dat ../ex...原创 2018-12-02 15:00:30 · 1146 阅读 · 0 评论 -
python dlib ubuntu 人脸识别2 使用mmod_human_face_detector进行人脸检测
mmod_human_face_detector.dat是训练好的模型,可以从这里下载:http://dlib.net/files/mmod_human_face_detector.dat.bz2输入参数:1. 模型dat文件2.要检测的人脸图片import sysimport dlibif len(sys.argv) < 3: print( ...原创 2018-12-02 14:51:46 · 5350 阅读 · 0 评论 -
python ubuntu人脸识别 -1 SVM binary 分类器
环境搭建可以参考这篇文章:https://www.learnopencv.com/install-dlib-on-ubuntu/1.使用测试向量训练出简单的SVM分类器2.使用分类器3.pickle存储结果import dlibtry: import cPickle as pickleexcept ImportError: import picklex...原创 2018-12-02 14:47:09 · 474 阅读 · 0 评论 -
python Ubuntu dlib 人脸识别9-辅助函数
全局优化函数:import dlibfrom math import sin,cos,pi,exp,sqrt# This is a standard test function for these kinds of optimization problems.# It has a bunch of local minima, with the global minimum resul...原创 2018-12-02 15:38:24 · 563 阅读 · 0 评论 -
python ubuntu dlib 10- 生成自然语言向量
import sysimport dlib计算特征向量:def sentence_to_vectors(sentence): # Create an empty array of vectors vects = dlib.vectors() for word in sentence.split(): # Our vectors are very...原创 2018-12-02 15:48:29 · 519 阅读 · 0 评论 -
python ubuntu dlib 人脸识别11-物体追踪
1. 从文件夹中读取图片文件,这步可以结合ffmpeg来完成,将视频流切图命令为(但需要再写个脚本定期清理旧图片,比如10分钟前):ffmpeg -i myfile.avi -r 1000 -f image2 image-%07d.png2.读取图片并圈出识别出的物体:import osimport globimport dlib# Path to the video ...原创 2018-12-02 15:58:15 · 704 阅读 · 1 评论 -
C# OpenCV9 haarcascade+cuda发送图片到gpu完成人体识别
1. 定义识别接口,输入被灰度处理过的图片,返回识别的矩形2. 使用cuda的hog作为SVM识别器3. 使用cuda的Cascade分类器4. 将图片上传到GPU5. 进行图像识别6. 获取识别结果(矩形)UI逻辑已经在前几篇文章介绍了。这里是cuda调用的部分:可以对CudaHOG的第一个参数(图片大小)进行调优(摄像头拍摄的人体大小)来达到更好的识别效果:publ...原创 2018-12-01 23:14:15 · 2096 阅读 · 0 评论 -
C# OpenCV8 -HogDescriptor人体识别
1. 从内置摄像头获取识别图像2. 灰度处理图片3. 指定SVM分类器:使用HogDescriptor获取PeopleDetector4. 使用分类器进行人体识别5. 判断目标是否在指定区域内6. 绘制出目标边框public class ObjTestHog { private Capture _capture; priva...原创 2018-12-01 23:10:32 · 3470 阅读 · 1 评论 -
C# OpenCV7 -人体检测
1. 定义识别辅助类2. 对抓取图片进行灰度处理3. 使用haarcascade模型进行人体上半身识别4. 判断目标是否在目标区域5. 绘出目标边框 public class ObjTest { private CascadeClassifier _cascadeClassifier; private Capture _capture; ...原创 2018-12-01 23:09:16 · 3458 阅读 · 0 评论 -
C# OpenCV6 -车牌识别
1. 定义车牌识别器:2. 使用Tesseract作为ocr引擎3. 识别4. 噪音处理车牌识别类:/// <summary> /// A simple license plate detector /// </summary> public class LicensePlateDetector : DisposableObject ...原创 2018-12-01 23:08:15 · 8981 阅读 · 3 评论 -
C# OpenCV5 - 使用casecade分类器
1. 定义人脸测试类2. 获取图片数据并灰度处理3.使用cascade模型+Cascade分类器进行人脸检测人脸识别测试类:public class FRTest { private CascadeClassifier _cascadeClassifier; private Capture _capture; public F...原创 2018-12-01 23:06:25 · 1314 阅读 · 1 评论 -
C# OpenCV4 -EigenFaceRecognizer识别人脸2
1.使用EigenFaceRecognizer识别人脸2.如果识别成功,从人像库拉取人物数据public partial class Form1 : Form { public Form1() { InitializeComponent(); } private string PathPhot...原创 2018-12-01 23:04:33 · 2573 阅读 · 5 评论