Giter Club home page Giter Club logo

imagerecognition_cv's Introduction

ImageRecognition_CV

Image recognition implemented through OpenCV library using a cascaded classifier model based on Haar features

基于Haar特征的级联分类器模型通过opencv库实现图像识别

算法实现主要框架:

1.加载官OpenCV官方提供的相应的基于Haar特征的级联分类器模型
xxx_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_xxx.xml')

2.加载原图像
img|video = cv2.imread('文件绝对路径')

3.转换为灰度图像
gray_img = cv2.cvtColor(img, cv2.COLORBGR2GRAY)

4.检测物体
xxx = xxx_cascade.detectMultiscale(gray, 1.1, 5, minSize = (50, 50))

5.标注识别框

for (x, y, w, h) in xxxs:
    cv2.rectangle(img, (x, y), (x+w, y+h ), (255, 255, 255), 2)
    注释识别框cv2.putText()

6.显示图像结果
cv2.imshow('result', img)

(6.1).保存图像结果
cv2.imwrite('output.jpg', img)

7.释放窗口及资源

cv2.waitKey(0)  
cv2.destoryAllWindows()

imagerecognition_cv's People

Contributors

aaronchannn avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.