Difference between revisions of "Objects recognition and position calculation (webcam)"

From robotica.unileon.es
Jump to: navigation, search
(Utilization of a new OpenCV library in ROS Electric)
(Installation of OpenCV)
Line 21: Line 21:
 
====Installation of OpenCV====
 
====Installation of OpenCV====
  
First we will [http://opencv.org/downloads.html download] the [http://opencv.org/ OpenCV] version 2.4.3 by the official web.  
+
First we will [http://opencv.org/downloads.html download] the [http://opencv.org/ OpenCV] version 2.4.3 by the official web. We will extract the content of the downloaded file in the personal folder. We will execute the next commands in a terminal in order to update the [http://www.ubuntu.com/ ubuntu] ''packages'':
 
 
<!--
 
 
 
Lo primero vamos a [http://opencv.org/downloads.html Descargar] la versión 2.4.3 de [http://opencv.org/ OpenCV] de la página oficial. Descomprimiremos el archivo descargado y situaremos el contenido en el emplazemiento que más nos guste. Los primero que vamos a realizar  es una actualización de los paquetes de [http://www.ubuntu.com/ ubuntu], para lo que ejecutaremos en un terminal los siguientes comandos:
 
  
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 31: Line 27:
 
sudo apt-get upgrade
 
sudo apt-get upgrade
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
<!--
  
 
Realizada la actualización vamos a continuar compilando [http://opencv.org/ OpenCV]. Para esto, desde un terminal, vamos a situarnos dentro del directorio "OpenCV-2.4.3", carpeta por defecto al descomprimir el archivo con [http://opencv.org/ OpenCV]. Una vez situados en el directorio que contiene [http://opencv.org/ OpenCV] vamos a ejecutar los siguientes comandos en un terminal:
 
Realizada la actualización vamos a continuar compilando [http://opencv.org/ OpenCV]. Para esto, desde un terminal, vamos a situarnos dentro del directorio "OpenCV-2.4.3", carpeta por defecto al descomprimir el archivo con [http://opencv.org/ OpenCV]. Una vez situados en el directorio que contiene [http://opencv.org/ OpenCV] vamos a ejecutar los siguientes comandos en un terminal:

Revision as of 16:54, 30 December 2013

< go back to main

Objects recognition

We have used the package find_object_2d which has been develop by Mathieu Labbé (Université de Sherbrooke). The program can recognizes objects in the scene using an image of the object. The program has a graphical user interface which allow to capture an image of the scene and save it.

Screenshot find_object_2d

In the screenshot that is shown above, we can see how the recognized object is within a boundary box which coincide with the corners of the object image.

The program provides several data of each found object in the scene. We will use the next data:

  • Width of the object image (number of pixels).
  • Height of the object image (number of pixels).
  • Position of the corners of the object image in the scene.

Utilization of a new OpenCV version in ROS Electric

The previous package needs in order to compile the OpenCV version 2.4.3 or higher, but ROS Electric has the OpenCV version 2.3.1. We will install the OpenCV version 2.4.3, configure the package cv_bridge and modify the package find_object_2d.

Installation of OpenCV

First we will download the OpenCV version 2.4.3 by the official web. We will extract the content of the downloaded file in the personal folder. We will execute the next commands in a terminal in order to update the ubuntu packages:

sudo apt-get update
sudo apt-get upgrade


< go back to main