SlideShare a Scribd company logo
1 of 51
@rizumita
OpenCV

         @rizumita
iOS

Twitter: @rizumita
       : http://tech.caph.jp
OpenCV
OpenCV




Willow Garage
OpenCV




BSD
OpenCV




         BSD
 SHIFT    SURF
OpenCV
2
+
-


          http://kmj.iis.u-tokyo.ac.jp/



    HOG
-
3
http://yokoya.naist.jp/paper/datas/653/glab.pdf
AR

Kinect


Oppai-Detect3
OpenCV
XML/YAML

etc.
etc.
GUI
Support vector machine (SVM)
SHIFT
                   SIFT,SURF
http://www.slideshare.net/lawmn/siftsurf

SURF
sample: find_obj.cpp


FAST
sample: http://opencv.jp/opencv2-x-samples/corner_detection
sample: motempl.c
Haar & LBP
  sample: facedetect.cpp

HOG
  sample: peopledetect.cpp
3

etc.
OpenCV
C/C++
Python

Java/.NET/etc.
OS

Windows
Mac
iOS
Linux Unix & Unix Like OS

Android
Mac



MacPorts

sudo port install opencv
sudo port install opencv+python27+tbb
iOS




iPhone OpenCV
http://niw.at/articles/2009/03/14/using-opencv-on-iphone/ja
Windows



http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.2/




http://opencv.jp/opencv2-x-tips/install-on-windowswindows32bit-64bit-visual-studio-opencv21
Linux




Debian/Ubuntu
Ubuntu

   http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.2/
 sudo apt-get install cmake
 sudo apt-get install cmake-qt-gui
 sudo apt-get install libgtk2.0-dev
 CMake GUI            Makefile

 make && sudo make install
GCC




gcc hoge.c `pkg-config --cflags opencv --libs opencv`
#include <stdio.h>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>

int main(int argc, char **argv)
{
     IplImage *sourceImage = cvLoadImage("lena.jpg", CV_LOAD_IMAGE_ANYDEPTH |
CV_LOAD_IMAGE_ANYCOLOR);
     IplImage *grayImage = cvCreateImage(cvGetSize(sourceImage), IPL_DEPTH_8U, 1);

    cvCvtColor(sourceImage, grayImage, CV_BGR2GRAY);
    int param[] = {CV_IMWRITE_JPEG_QUALITY, 95};
    cvSaveImage("lena_gray.jpg", grayImage, param);

    cvReleaseImage(&sourceImage);
    cvReleaseImage(&grayImage);

    return 0;
}
CvCapture *capture = NULL;

   IplImage *srcImage;

   int key;


   if ((capture = cvCreateCameraCapture(0)) == NULL) return -1;            //

   cvNamedWindow("Face Detection", CV_WINDOW_AUTOSIZE); //

   CvHaarClassifierCascade *cascade = (CvHaarClassifierCascade *)cvLoad("haarcascade_frontalface_alt2.xml", 0, 0, 0);         //

   if (cascade == NULL) return -1;

   CvMemStorage *storage = cvCreateMemStorage(0);                          //



   while(1) {

   
        srcImage = cvQueryFrame(capture);                         //

   
          if (srcImage == NULL) continue;


   
          IplImage *grayImage = cvCreateImage(cvGetSize(srcImage), IPL_DEPTH_8U, 1);

   
          cvCvtColor(srcImage, grayImage, CV_BGR2GRAY);

   
          cvEqualizeHist(grayImage, grayImage);
 //                      =

   
          cvClearMemStorage(storage);
      
        //

   
          CvSeq *faces = cvHaarDetectObjects(grayImage, cascade, storage, 1.1, 3, CV_HAAR_DO_CANNY_PRUNING, cvSize(0,0), cvSize(0,0));                  //



   
          int i;

   
          for (i = 0; i < (faces ? faces->total : 0); i++) {

   
          
         CvRect *rect = (CvRect *)cvGetSeqElem(faces, i);

   
          
         cvRectangle(srcImage, cvPoint(rect->x, rect->y), cvPoint(rect->x + rect->width, rect->y + rect->height), CV_RGB(255, 0, 0), 3, CV_AA, 0);

   
          }


   
          cvShowImage("Face Detection", srcImage);


   
          key = cvWaitKey(3);

   
          if (key == 'q') break;                           // q

   }     //
TBB
…
OpenCV
Web

OpenCV.jp
    http://opencv.jp/


    : OpenCV                    gihyo.jp

    http://gihyo.jp/dev/feature/01/opencv
                                OpenCV

Sourceforge
    http://sourceforge.net/projects/opencvlibrary/
OpenCV Wiki
    http://opencv.willowgarage.com/wiki/
    Willow Garage                   Wiki
OpenCV                                  OpenCV1.1


                                   OpenCV


   OpenCV


   Gary Bradski / Adrian Kaehler    -




   David A. Forsyth ( ), Jean Ponce ( ),            (   )

More Related Content

What's hot (6)

Open Cv 2005 Q4 Tutorial
Open Cv 2005 Q4 TutorialOpen Cv 2005 Q4 Tutorial
Open Cv 2005 Q4 Tutorial
 
Introduction to OpenCV (with Java)
Introduction to OpenCV (with Java)Introduction to OpenCV (with Java)
Introduction to OpenCV (with Java)
 
Getting started with open cv in raspberry pi
Getting started with open cv in raspberry piGetting started with open cv in raspberry pi
Getting started with open cv in raspberry pi
 
openCV and Java - Face Detection
openCV and Java - Face DetectionopenCV and Java - Face Detection
openCV and Java - Face Detection
 
Intro2 Cuda Moayad
Intro2 Cuda MoayadIntro2 Cuda Moayad
Intro2 Cuda Moayad
 
Introduction to OpenCV 3.x (with Java)
Introduction to OpenCV 3.x (with Java)Introduction to OpenCV 3.x (with Java)
Introduction to OpenCV 3.x (with Java)
 

Viewers also liked

OpenCVをAndroidで動かしてみた
OpenCVをAndroidで動かしてみたOpenCVをAndroidで動かしてみた
OpenCVをAndroidで動かしてみた
徹 上野山
 

Viewers also liked (20)

OpenCVをAndroidで動かしてみた
OpenCVをAndroidで動かしてみたOpenCVをAndroidで動かしてみた
OpenCVをAndroidで動かしてみた
 
OpenCV 3.0 on iOS
OpenCV 3.0 on iOSOpenCV 3.0 on iOS
OpenCV 3.0 on iOS
 
画像処理ライブラリ OpenCV で 出来ること・出来ないこと
画像処理ライブラリ OpenCV で 出来ること・出来ないこと画像処理ライブラリ OpenCV で 出来ること・出来ないこと
画像処理ライブラリ OpenCV で 出来ること・出来ないこと
 
コンピュータビジョンの最新ソフトウェア開発環境 SSII2015 チュートリアル hayashi
コンピュータビジョンの最新ソフトウェア開発環境 SSII2015 チュートリアル hayashiコンピュータビジョンの最新ソフトウェア開発環境 SSII2015 チュートリアル hayashi
コンピュータビジョンの最新ソフトウェア開発環境 SSII2015 チュートリアル hayashi
 
Deflate
DeflateDeflate
Deflate
 
単一物体追跡論文のサーベイ
単一物体追跡論文のサーベイ単一物体追跡論文のサーベイ
単一物体追跡論文のサーベイ
 
Deep learningの軽い紹介
Deep learningの軽い紹介Deep learningの軽い紹介
Deep learningの軽い紹介
 
負荷試験、どうしてる?(公開版)
負荷試験、どうしてる?(公開版)負荷試験、どうしてる?(公開版)
負荷試験、どうしてる?(公開版)
 
センサー・VR・MR 基本とオススメ
センサー・VR・MR 基本とオススメセンサー・VR・MR 基本とオススメ
センサー・VR・MR 基本とオススメ
 
悪意ないユーザに配慮した不正クライアントの排除
悪意ないユーザに配慮した不正クライアントの排除悪意ないユーザに配慮した不正クライアントの排除
悪意ないユーザに配慮した不正クライアントの排除
 
ARもVRもMRもまとめてドーン
ARもVRもMRもまとめてドーンARもVRもMRもまとめてドーン
ARもVRもMRもまとめてドーン
 
Golangにおける端末制御 リッチなターミナルUIの実現方法
Golangにおける端末制御 リッチなターミナルUIの実現方法Golangにおける端末制御 リッチなターミナルUIの実現方法
Golangにおける端末制御 リッチなターミナルUIの実現方法
 
Raspberry piと.net coreのstandardな関係
Raspberry piと.net coreのstandardな関係Raspberry piと.net coreのstandardな関係
Raspberry piと.net coreのstandardな関係
 
FPGAって、何?
FPGAって、何?FPGAって、何?
FPGAって、何?
 
Compact ordered dict__k_lab_meeting_
Compact ordered dict__k_lab_meeting_Compact ordered dict__k_lab_meeting_
Compact ordered dict__k_lab_meeting_
 
勉強会資料 Distribution
勉強会資料 Distribution勉強会資料 Distribution
勉強会資料 Distribution
 
MS COCO Dataset Introduction
MS COCO Dataset IntroductionMS COCO Dataset Introduction
MS COCO Dataset Introduction
 
ARもVRもMRもまとめてドドンドーン!
ARもVRもMRもまとめてドドンドーン!ARもVRもMRもまとめてドドンドーン!
ARもVRもMRもまとめてドドンドーン!
 
Pythonによる機械学習入門 ~Deep Learningに挑戦~
Pythonによる機械学習入門 ~Deep Learningに挑戦~Pythonによる機械学習入門 ~Deep Learningに挑戦~
Pythonによる機械学習入門 ~Deep Learningに挑戦~
 
一般向けのDeep Learning
一般向けのDeep Learning一般向けのDeep Learning
一般向けのDeep Learning
 

Similar to OpenCVの基礎

Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
Remy Sharp
 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
PL dream
 
A Brief Overview of OpenCV
A Brief Overview of OpenCVA Brief Overview of OpenCV
A Brief Overview of OpenCV
techmonkey4u
 

Similar to OpenCVの基礎 (20)

The Death of a Mouse
The Death of a MouseThe Death of a Mouse
The Death of a Mouse
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
 
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ -  Automated Malware AnalysisIstSec'14 - İbrahim BALİÇ -  Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
Message in a bottle
Message in a bottleMessage in a bottle
Message in a bottle
 
Marat-Slides
Marat-SlidesMarat-Slides
Marat-Slides
 
3
33
3
 
Hello, Is That FreeSWITCH? Then We're Coming to Check You!
Hello, Is That FreeSWITCH? Then We're Coming to Check You!Hello, Is That FreeSWITCH? Then We're Coming to Check You!
Hello, Is That FreeSWITCH? Then We're Coming to Check You!
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
 
A Brief Overview of OpenCV
A Brief Overview of OpenCVA Brief Overview of OpenCV
A Brief Overview of OpenCV
 
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is FineCocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
 
jQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapjQuery Mobile & PhoneGap
jQuery Mobile & PhoneGap
 
PVS-Studio Meets Octave
PVS-Studio Meets Octave PVS-Studio Meets Octave
PVS-Studio Meets Octave
 
How to Write Node.js Module
How to Write Node.js ModuleHow to Write Node.js Module
How to Write Node.js Module
 
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
OWASP Poland Day 2018 - Pedro Fortuna - Are your Java Script based protection...
 
Android Camera Architecture
Android Camera ArchitectureAndroid Camera Architecture
Android Camera Architecture
 
lecture5
lecture5lecture5
lecture5
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

OpenCVの基礎