30
RoboticaEuropa.org OpenCV a tu alcance ¿Cómo nos ven las máquinas? 23 Noviembre 2016

How do machine see us? Getting started with OpenCV

Embed Size (px)

Citation preview

Page 1: How do machine see us? Getting started with OpenCV

RoboticaEuropa.org

OpenCV a tu alcance

¿Cómo nos ven las máquinas?

23 Noviembre 2016

Page 2: How do machine see us? Getting started with OpenCV

OpenCV

. Conceptos de Visión Artificial

. ¿Por qué Open Source?

. Instalación en Ubuntu Linux

. Toma de imágenes y video

. Detección de personas y objetos

Page 3: How do machine see us? Getting started with OpenCV

1Visión Artificial

Page 4: How do machine see us? Getting started with OpenCV

Suavizado

Page 5: How do machine see us? Getting started with OpenCV

Erosión <-> Dilatación

Page 6: How do machine see us? Getting started with OpenCV

Detección de bordes

Page 7: How do machine see us? Getting started with OpenCV

Detección de figuras

Transformada de Hough

Page 8: How do machine see us? Getting started with OpenCV

Detección de caras

Page 9: How do machine see us? Getting started with OpenCV

Una imagen es

una MATRIZ

Page 10: How do machine see us? Getting started with OpenCV

Una imagen en color

Tiene 3 MATRICES

R: rojo

G: verde

B: azul

Page 11: How do machine see us? Getting started with OpenCV

Imagen en color

Descomposición

Page 12: How do machine see us? Getting started with OpenCV

2Por qué Open Source

y aplicaciones

Page 13: How do machine see us? Getting started with OpenCV

Abriendo la tecnología es como realmente se aprende

Proyectos nuevos a partir del trabajo previo de otros

Crear comunidad

Page 14: How do machine see us? Getting started with OpenCV

¿Qué podemos hacer con OpenCV?

Page 15: How do machine see us? Getting started with OpenCV

Arquitectura

Page 16: How do machine see us? Getting started with OpenCV

Deconvolución Movimiento conocido

Page 17: How do machine see us? Getting started with OpenCV

DeconvoluciónCorrección de foco

Page 18: How do machine see us? Getting started with OpenCV

Ecualización Corrección del histograma

Page 19: How do machine see us? Getting started with OpenCV

Los ojos de

JUS siguen el

movimiento

de las

personas

Robótica personal

Page 20: How do machine see us? Getting started with OpenCV

If a topic is marked as latched when it is

advertised, subscribers automatically get

the last message sent when they subscribe

to the topic

Publicación de mapas

Navegación remota

pub = rospy. Publisher('map' , nav_msgs/OccupancyGrid, latched=True)

publish once

Page 21: How do machine see us? Getting started with OpenCV

3Instalación en Ubuntu

Page 22: How do machine see us? Getting started with OpenCV

http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install build-essential cmake pkg-config

sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-

devsudo apt-get install libxvidcore-dev libx264-dev

sudo apt-get install libgtk2.0-dev

sudo apt-get install libatlas-base-dev gfortran

sudo apt-get install python2.7-dev python3-dev

pip install numpy

Dependencias

Page 23: How do machine see us? Getting started with OpenCV

cd ~

wget -O opencv_contrib.zip

https://github.com/opencv/opencv_contrib/archive/3.1.0.zip

unzip opencv_contrib.zip

cd ~/opencv-3.1.0/

mkdir build

cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \

-D CMAKE_INSTALL_PREFIX=/usr/local \

-D INSTALL_PYTHON_EXAMPLES=ON \

-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \

-D BUILD_EXAMPLES=ON ..

Código fuente C++

Page 24: How do machine see us? Getting started with OpenCV

make -j4 #Use the 4 cores

sudo make install

sudo ldconfig

Compilación

$ python

>>> import cv2

>>> cv2.__version__

'3.1.0'

Test de funcionamiento:

find_package(HDF5)

include_directories(${HDF5_INCLUDE_DIRS})

opencv-3.1.0/modules/ python/common.cmake

Page 25: How do machine see us? Getting started with OpenCV

git clone https://github.com/roboticaeuropa/cv_open

Page 26: How do machine see us? Getting started with OpenCV

4Toma de imágenesy video

Page 27: How do machine see us? Getting started with OpenCV
Page 28: How do machine see us? Getting started with OpenCV

5Detección de personas y objetos

Page 29: How do machine see us? Getting started with OpenCV

5

• Detección de personas y objetos

Page 30: How do machine see us? Getting started with OpenCV