SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
Militarizing Your
 Backyard With Python:
Computer Vision and the Squirrel
            Hordes



                       Kurt Grandis
                       PyCon 2012
Overview
● Background & Goals
● OpenCV
  ○ Working with Python
● Detecting Squirrels
  ○ SVMs
  ○ Squirrely features
● Shooting Squirrels
● Wet Squirrels
● Next Steps
The Great Backyard Bird Count




http://www.birdsource.org/gbbc/
Squirrels...
Sentry Water Gun




                   http://wiki.teamfortress.com/wiki/Sentry_Gun
System


Sensor (Camera)   Blob Detection

                                          Targeting   Shoot the Squirrel


                     Squirrel Detection
OpenCV
Open Source Computer Vision
● Image Processing
● Video Analysis
● Feature Detectors
● Object Detection

C, C++, Python Interfaces

http://opencv.willowgarage.com/wiki/
http://code.opencv.org
Python & OpenCV
● Support for native Python structures
● Works with numpy
● Efficient data sharing
Sensor : Webcam
OpenCV
         import cv

         cv.NamedWindow("camera raw", 1)
         capture = cv.CreateCameraCapture(0)
         img = cv.QueryFrame(capture)
         cv.ShowImage("camera raw", img)




         # Convert to Gray Scale
         gray = cv.CreateImage(cv.GetSize(img),
                          cv.IPL_DEPTH_8U, 1)
         cv.CvtColor(img, gray, cv.CV_BGR2GRAY)


         # Canny Edge Filter
         cv.Canny(gray, edges, 50, 200, 3)
Blob Detection
How do I find regions of interest (i.e. Blobs)?
● Birds
● Squirrels
● Neighbor Children


cvBlobsLib http://opencv.willowgarage.com/wiki/cvBlobsLib
cvFindContours (OpenCV function)
Background Subtraction
Foreground Segmentation

Noisy Background

Codebook Approach
Squirrel Detection
Support Vector Machines (SVMs)
Supervised Learning                                from svm import *

                                                   ...

Classification                                     c = my_trained_model.predict(vector)




Features


libsvm http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Squirrely Features




What is squirrel-ness?

● blob size
● histogram analysis of blob
● entropy of blob (texture)
Blob Size
Color Histogram
Entropy
          Measure of randomness

          Calculate entropy for regions of the blob

           ●   Overall Entropy
           ●   Stdev Entropy
           ●   Left Mean Entropy - Right Mean Entropy




          h_prob = [ h / histo_sum for h in histogram ]

          entropy =   -sum( [p * math.log(p)
                                 for p in h_prob
                                 if p != 0] )
SVM & Classifing Blobs
● blob size
● color histograms
● entropy of blob (texture)

                   Classify!
Shoot the Squirrel
The Gun
The Turret
Python and Arduino
Arduino Uno

pyserial                                     import serial

                                             arduino = serial.Serial(device, BAUD_RATE)


                                             arduino.write("a")




Project Sentry Gun
https://sites.google.com/site/projectsentrygun/

Python-On-A-Chip
http://code.google.com/p/python-on-a-chip/
Results
●   Squirrels get wet
●   False positives extremely low
●   More satisfying if it camps the feeder
●   Need stronger firepower
●   Need larger water reservoir
●   Squirrels are extremely persistent...no really
Next Steps
● Better Optics
● Stronger Firepower
  ○ Laminar water jet
  ○ Pressurized water pump
● Python-On-A-Chip

● Bird Classifier & Counter
Questions?
kgrandis@gmail.com
@kgrandis

http://kurtgrandis.com/


no animals were harmed in the development of
this project. Bird seed and other snacks were
provided to all participants free of charge.

Más contenido relacionado

La actualidad más candente

Image processing fundamentals
Image processing fundamentalsImage processing fundamentals
Image processing fundamentalsA B Shinde
 
DEEP LEARNING BASED BRAIN STROKE DETECTION
DEEP LEARNING BASED BRAIN STROKE DETECTIONDEEP LEARNING BASED BRAIN STROKE DETECTION
DEEP LEARNING BASED BRAIN STROKE DETECTIONIRJET Journal
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
 
Intelligent Video Surveillance System using Deep Learning
Intelligent Video Surveillance System using Deep LearningIntelligent Video Surveillance System using Deep Learning
Intelligent Video Surveillance System using Deep LearningIRJET Journal
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesDiwaker Pant
 
YOLO9000 - PR023
YOLO9000 - PR023YOLO9000 - PR023
YOLO9000 - PR023Jinwon Lee
 
Audio Steganography java project
Audio Steganography java projectAudio Steganography java project
Audio Steganography java projectTutorial Learners
 
Computer vision lane line detection
Computer vision lane line detectionComputer vision lane line detection
Computer vision lane line detectionJonathan Mitchell
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median FiltersAmnaakhaan
 
3D Image visualization
3D Image visualization3D Image visualization
3D Image visualizationalok ray
 
Fuzzy Logic Ppt
Fuzzy Logic PptFuzzy Logic Ppt
Fuzzy Logic Pptrafi
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processingVARUN KUMAR
 
Camera model ‫‬
Camera model ‫‬Camera model ‫‬
Camera model ‫‬Fatima Radi
 
Object classification using CNN & VGG16 Model (Keras and Tensorflow)
Object classification using CNN & VGG16 Model (Keras and Tensorflow) Object classification using CNN & VGG16 Model (Keras and Tensorflow)
Object classification using CNN & VGG16 Model (Keras and Tensorflow) Lalit Jain
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point ProcessingGayathri31093
 

La actualidad más candente (20)

Image processing fundamentals
Image processing fundamentalsImage processing fundamentals
Image processing fundamentals
 
DEEP LEARNING BASED BRAIN STROKE DETECTION
DEEP LEARNING BASED BRAIN STROKE DETECTIONDEEP LEARNING BASED BRAIN STROKE DETECTION
DEEP LEARNING BASED BRAIN STROKE DETECTION
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Intelligent Video Surveillance System using Deep Learning
Intelligent Video Surveillance System using Deep LearningIntelligent Video Surveillance System using Deep Learning
Intelligent Video Surveillance System using Deep Learning
 
Unsupervised learning networks
Unsupervised learning networksUnsupervised learning networks
Unsupervised learning networks
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
 
Iv defuzzification methods
Iv defuzzification methodsIv defuzzification methods
Iv defuzzification methods
 
YOLO9000 - PR023
YOLO9000 - PR023YOLO9000 - PR023
YOLO9000 - PR023
 
Audio Steganography java project
Audio Steganography java projectAudio Steganography java project
Audio Steganography java project
 
Computer vision lane line detection
Computer vision lane line detectionComputer vision lane line detection
Computer vision lane line detection
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
 
Dip Image Segmentation
Dip Image SegmentationDip Image Segmentation
Dip Image Segmentation
 
3D Image visualization
3D Image visualization3D Image visualization
3D Image visualization
 
Fuzzy Logic Ppt
Fuzzy Logic PptFuzzy Logic Ppt
Fuzzy Logic Ppt
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processing
 
Image pyramid
Image pyramidImage pyramid
Image pyramid
 
Camera model ‫‬
Camera model ‫‬Camera model ‫‬
Camera model ‫‬
 
Object classification using CNN & VGG16 Model (Keras and Tensorflow)
Object classification using CNN & VGG16 Model (Keras and Tensorflow) Object classification using CNN & VGG16 Model (Keras and Tensorflow)
Object classification using CNN & VGG16 Model (Keras and Tensorflow)
 
Unit3 dip
Unit3 dipUnit3 dip
Unit3 dip
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
 

Destacado

Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic WebLuigi De Russis
 
Introduction to OpenCV (with Java)
Introduction to OpenCV (with Java)Introduction to OpenCV (with Java)
Introduction to OpenCV (with Java)Luigi De Russis
 
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)Luigi De Russis
 
Semantic Web - Ontology 101
Semantic Web - Ontology 101Semantic Web - Ontology 101
Semantic Web - Ontology 101Luigi De Russis
 
Face Recognition using OpenCV
Face Recognition using OpenCVFace Recognition using OpenCV
Face Recognition using OpenCVVasile Chelban
 
Face Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learnFace Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learnShiqiao Du
 

Destacado (8)

Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic Web
 
Introduction to OpenCV (with Java)
Introduction to OpenCV (with Java)Introduction to OpenCV (with Java)
Introduction to OpenCV (with Java)
 
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)
 
Semantic Web - Ontology 101
Semantic Web - Ontology 101Semantic Web - Ontology 101
Semantic Web - Ontology 101
 
Face Recognition using OpenCV
Face Recognition using OpenCVFace Recognition using OpenCV
Face Recognition using OpenCV
 
Face Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learnFace Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learn
 
Java and OWL
Java and OWLJava and OWL
Java and OWL
 
Jena Programming
Jena ProgrammingJena Programming
Jena Programming
 

Similar a PyCon 2012: Militarizing Your Backyard: Computer Vision and the Squirrel Hordes

Simple APIs and innovative documentation
Simple APIs and innovative documentationSimple APIs and innovative documentation
Simple APIs and innovative documentationPyDataParis
 
Using Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansUsing Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansNilhcem
 
People detection in a video
People detection in a videoPeople detection in a video
People detection in a videoYonatan Katz
 
Seven waystouseturtle pycon2009
Seven waystouseturtle pycon2009Seven waystouseturtle pycon2009
Seven waystouseturtle pycon2009A Jorge Garcia
 
Python for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo CruzPython for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo Cruzrpmcruz
 
Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015Boey Pak Cheong
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Lviv Startup Club
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...Edge AI and Vision Alliance
 
COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsMark Billinghurst
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hoodRichardWarburton
 
20110220 computer vision_eruhimov_lecture02
20110220 computer vision_eruhimov_lecture0220110220 computer vision_eruhimov_lecture02
20110220 computer vision_eruhimov_lecture02Computer Science Club
 
Numba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPyNumba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPyTravis Oliphant
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CSteffen Wenz
 
Machine Learning on Code - SF meetup
Machine Learning on Code - SF meetupMachine Learning on Code - SF meetup
Machine Learning on Code - SF meetupsource{d}
 
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek GodlewskiPROIDEA
 
Anil Thomas - Object recognition
Anil Thomas - Object recognitionAnil Thomas - Object recognition
Anil Thomas - Object recognitionIntel Nervana
 
Python @ PiTech - March 2009
Python @ PiTech - March 2009Python @ PiTech - March 2009
Python @ PiTech - March 2009tudorprodan
 

Similar a PyCon 2012: Militarizing Your Backyard: Computer Vision and the Squirrel Hordes (20)

Simple APIs and innovative documentation
Simple APIs and innovative documentationSimple APIs and innovative documentation
Simple APIs and innovative documentation
 
Using Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansUsing Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate Reptilians
 
People detection in a video
People detection in a videoPeople detection in a video
People detection in a video
 
Seven waystouseturtle pycon2009
Seven waystouseturtle pycon2009Seven waystouseturtle pycon2009
Seven waystouseturtle pycon2009
 
Python for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo CruzPython for Scientific Computing -- Ricardo Cruz
Python for Scientific Computing -- Ricardo Cruz
 
Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
 
COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer Tools
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hood
 
20110220 computer vision_eruhimov_lecture02
20110220 computer vision_eruhimov_lecture0220110220 computer vision_eruhimov_lecture02
20110220 computer vision_eruhimov_lecture02
 
Numba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPyNumba: Array-oriented Python Compiler for NumPy
Numba: Array-oriented Python Compiler for NumPy
 
肉体言語 Tython
肉体言語 Tython肉体言語 Tython
肉体言語 Tython
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
Machine Learning on Code - SF meetup
Machine Learning on Code - SF meetupMachine Learning on Code - SF meetup
Machine Learning on Code - SF meetup
 
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
 
Anil Thomas - Object recognition
Anil Thomas - Object recognitionAnil Thomas - Object recognition
Anil Thomas - Object recognition
 
Python @ PiTech - March 2009
Python @ PiTech - March 2009Python @ PiTech - March 2009
Python @ PiTech - March 2009
 
Intro
IntroIntro
Intro
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 

Último

ppt on Myself, Occupation and my Interest
ppt on Myself, Occupation and my Interestppt on Myself, Occupation and my Interest
ppt on Myself, Occupation and my InterestNagaissenValaydum
 
( Sports training) All topic (MCQs).pptx
( Sports training) All topic (MCQs).pptx( Sports training) All topic (MCQs).pptx
( Sports training) All topic (MCQs).pptxParshotamGupta1
 
08448380779 Call Girls In IIT Women Seeking Men
08448380779 Call Girls In IIT Women Seeking Men08448380779 Call Girls In IIT Women Seeking Men
08448380779 Call Girls In IIT Women Seeking MenDelhi Call girls
 
大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改
大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改
大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改atducpo
 
Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...
Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...
Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...gurkirankumar98700
 
Dubai Call Girls Bikni O528786472 Call Girls Dubai Ebony
Dubai Call Girls Bikni O528786472 Call Girls Dubai EbonyDubai Call Girls Bikni O528786472 Call Girls Dubai Ebony
Dubai Call Girls Bikni O528786472 Call Girls Dubai Ebonyhf8803863
 
Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...
Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...
Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...Neil Horowitz
 
Albania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docx
Albania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docxAlbania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docx
Albania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docxWorld Wide Tickets And Hospitality
 
08448380779 Call Girls In Karol Bagh Women Seeking Men
08448380779 Call Girls In Karol Bagh Women Seeking Men08448380779 Call Girls In Karol Bagh Women Seeking Men
08448380779 Call Girls In Karol Bagh Women Seeking MenDelhi Call girls
 
Chennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
🔝|97111༒99012🔝 Call Girls In {Delhi} Cr Park ₹5.5k Cash Payment With Room De...
🔝|97111༒99012🔝 Call Girls In  {Delhi} Cr Park ₹5.5k Cash Payment With Room De...🔝|97111༒99012🔝 Call Girls In  {Delhi} Cr Park ₹5.5k Cash Payment With Room De...
🔝|97111༒99012🔝 Call Girls In {Delhi} Cr Park ₹5.5k Cash Payment With Room De...Diya Sharma
 
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...World Wide Tickets And Hospitality
 
Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...
Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...
Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...Eticketing.co
 
Tableaux 9ème étape circuit fédéral 2024
Tableaux 9ème étape circuit fédéral 2024Tableaux 9ème étape circuit fédéral 2024
Tableaux 9ème étape circuit fédéral 2024HechemLaameri
 
Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...
Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...
Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...Eticketing.co
 
08448380779 Call Girls In Lajpat Nagar Women Seeking Men
08448380779 Call Girls In Lajpat Nagar Women Seeking Men08448380779 Call Girls In Lajpat Nagar Women Seeking Men
08448380779 Call Girls In Lajpat Nagar Women Seeking MenDelhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual serviceanilsa9823
 
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdfJORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdfArturo Pacheco Alvarez
 

Último (20)

ppt on Myself, Occupation and my Interest
ppt on Myself, Occupation and my Interestppt on Myself, Occupation and my Interest
ppt on Myself, Occupation and my Interest
 
( Sports training) All topic (MCQs).pptx
( Sports training) All topic (MCQs).pptx( Sports training) All topic (MCQs).pptx
( Sports training) All topic (MCQs).pptx
 
08448380779 Call Girls In IIT Women Seeking Men
08448380779 Call Girls In IIT Women Seeking Men08448380779 Call Girls In IIT Women Seeking Men
08448380779 Call Girls In IIT Women Seeking Men
 
Call Girls 🫤 Paharganj ➡️ 9999965857 ➡️ Delhi 🫦 Russian Escorts FULL ENJOY
Call Girls 🫤 Paharganj ➡️ 9999965857  ➡️ Delhi 🫦  Russian Escorts FULL ENJOYCall Girls 🫤 Paharganj ➡️ 9999965857  ➡️ Delhi 🫦  Russian Escorts FULL ENJOY
Call Girls 🫤 Paharganj ➡️ 9999965857 ➡️ Delhi 🫦 Russian Escorts FULL ENJOY
 
大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改
大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改
大学学位办理《原版美国USD学位证书》圣地亚哥大学毕业证制作成绩单修改
 
Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...
Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...
Jankipuram / Call Girls Lucknow | Whatsapp No 🫗 8923113531 🎳 VIP Escorts Serv...
 
Dubai Call Girls Bikni O528786472 Call Girls Dubai Ebony
Dubai Call Girls Bikni O528786472 Call Girls Dubai EbonyDubai Call Girls Bikni O528786472 Call Girls Dubai Ebony
Dubai Call Girls Bikni O528786472 Call Girls Dubai Ebony
 
Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...
Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...
Atlanta Dream Exec Dan Gadd on Driving Fan Engagement and Growth, Serving the...
 
Albania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docx
Albania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docxAlbania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docx
Albania Vs Spain Albania is Loaded with Defensive Talent on their Roster.docx
 
08448380779 Call Girls In Karol Bagh Women Seeking Men
08448380779 Call Girls In Karol Bagh Women Seeking Men08448380779 Call Girls In Karol Bagh Women Seeking Men
08448380779 Call Girls In Karol Bagh Women Seeking Men
 
Chennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Anna Nagar Phone 🍆 8250192130 👅 celebrity escorts service
 
Call Girls In RK Puram 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In RK Puram 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In RK Puram 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In RK Puram 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
🔝|97111༒99012🔝 Call Girls In {Delhi} Cr Park ₹5.5k Cash Payment With Room De...
🔝|97111༒99012🔝 Call Girls In  {Delhi} Cr Park ₹5.5k Cash Payment With Room De...🔝|97111༒99012🔝 Call Girls In  {Delhi} Cr Park ₹5.5k Cash Payment With Room De...
🔝|97111༒99012🔝 Call Girls In {Delhi} Cr Park ₹5.5k Cash Payment With Room De...
 
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
 
Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...
Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...
Italy vs Albania Tickets: Italy's Quest for Euro Cup Germany History, Defendi...
 
Tableaux 9ème étape circuit fédéral 2024
Tableaux 9ème étape circuit fédéral 2024Tableaux 9ème étape circuit fédéral 2024
Tableaux 9ème étape circuit fédéral 2024
 
Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...
Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...
Croatia vs Albania Clash of Euro Cup 2024 Squad Preparations and Euro Cup Dre...
 
08448380779 Call Girls In Lajpat Nagar Women Seeking Men
08448380779 Call Girls In Lajpat Nagar Women Seeking Men08448380779 Call Girls In Lajpat Nagar Women Seeking Men
08448380779 Call Girls In Lajpat Nagar Women Seeking Men
 
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service
 
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdfJORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
 

PyCon 2012: Militarizing Your Backyard: Computer Vision and the Squirrel Hordes

  • 1. Militarizing Your Backyard With Python: Computer Vision and the Squirrel Hordes Kurt Grandis PyCon 2012
  • 2. Overview ● Background & Goals ● OpenCV ○ Working with Python ● Detecting Squirrels ○ SVMs ○ Squirrely features ● Shooting Squirrels ● Wet Squirrels ● Next Steps
  • 3. The Great Backyard Bird Count http://www.birdsource.org/gbbc/
  • 5. Sentry Water Gun http://wiki.teamfortress.com/wiki/Sentry_Gun
  • 6. System Sensor (Camera) Blob Detection Targeting Shoot the Squirrel Squirrel Detection
  • 7. OpenCV Open Source Computer Vision ● Image Processing ● Video Analysis ● Feature Detectors ● Object Detection C, C++, Python Interfaces http://opencv.willowgarage.com/wiki/ http://code.opencv.org
  • 8. Python & OpenCV ● Support for native Python structures ● Works with numpy ● Efficient data sharing
  • 10. OpenCV import cv cv.NamedWindow("camera raw", 1) capture = cv.CreateCameraCapture(0) img = cv.QueryFrame(capture) cv.ShowImage("camera raw", img) # Convert to Gray Scale gray = cv.CreateImage(cv.GetSize(img), cv.IPL_DEPTH_8U, 1) cv.CvtColor(img, gray, cv.CV_BGR2GRAY) # Canny Edge Filter cv.Canny(gray, edges, 50, 200, 3)
  • 11. Blob Detection How do I find regions of interest (i.e. Blobs)? ● Birds ● Squirrels ● Neighbor Children cvBlobsLib http://opencv.willowgarage.com/wiki/cvBlobsLib cvFindContours (OpenCV function)
  • 14. Support Vector Machines (SVMs) Supervised Learning from svm import * ... Classification c = my_trained_model.predict(vector) Features libsvm http://www.csie.ntu.edu.tw/~cjlin/libsvm/
  • 15. Squirrely Features What is squirrel-ness? ● blob size ● histogram analysis of blob ● entropy of blob (texture)
  • 18. Entropy Measure of randomness Calculate entropy for regions of the blob ● Overall Entropy ● Stdev Entropy ● Left Mean Entropy - Right Mean Entropy h_prob = [ h / histo_sum for h in histogram ] entropy = -sum( [p * math.log(p) for p in h_prob if p != 0] )
  • 19. SVM & Classifing Blobs ● blob size ● color histograms ● entropy of blob (texture) Classify!
  • 23. Python and Arduino Arduino Uno pyserial import serial arduino = serial.Serial(device, BAUD_RATE) arduino.write("a") Project Sentry Gun https://sites.google.com/site/projectsentrygun/ Python-On-A-Chip http://code.google.com/p/python-on-a-chip/
  • 24. Results ● Squirrels get wet ● False positives extremely low ● More satisfying if it camps the feeder ● Need stronger firepower ● Need larger water reservoir ● Squirrels are extremely persistent...no really
  • 25.
  • 26. Next Steps ● Better Optics ● Stronger Firepower ○ Laminar water jet ○ Pressurized water pump ● Python-On-A-Chip ● Bird Classifier & Counter
  • 27. Questions? kgrandis@gmail.com @kgrandis http://kurtgrandis.com/ no animals were harmed in the development of this project. Bird seed and other snacks were provided to all participants free of charge.