Navegación Visual II: Conversión de puntos 2D a 3D

Bueno, realmente el concepto es más amplio de lo que se expresa en el título. La tarea sería mas bien convertir los puntos que delimitan el suelo, expresados mediante coordenadas 2D (y en un sistema de referencia de la imagen tomada por la cámara), a puntos 3D en el sistema de referencia absoluto (en el que se define la posición del robot, ..).

Aquí es donde entra en juego la biblioteca Progeo.

La idea es que, a través de los parámetros de la cámara, dado un pixel, se pueda calcular su correspondiente punto en 3D (con respecto a la cámara).

Aquí tenéis la receta que explica cómo funciona y qué hay que hacer para utilizar esta biblioteca. A lo que añado modificar el Makefile para que al compilar enlace con el «Progeo.h».

El primer paso previo al uso de progeo es calibrar la cámara, esto es, pasarle todos los parámetros correspondientes de la cámara (extrínsecos e intrinsecos) necesarios para realizar las conversiones. Estos (en la versión 4.2.1 de jde) son:

  • HPoint3D position; /* camera 3d position in mm */
  • HPoint3D foa; /* camera 3d focus of attention in mm */
  • float roll; /* camera roll position angle in rads */
  • float fdist; /* focus distance in mm*/
  • float u0,v0; /* pixels */

El primero, position, coincide con la ubicación del robot en sus componentes X e Y, y la Z indicando la altura a la que se encuentra la cámara sobre le robot. Hay que tener en cuenta que estas coordenadas serán relativas al robot, y por tanto nuestras X e Y serán 0.0 y 0.0.variable_odometria

El foa va a indicar la orientación de la cámara, es decir, hacia donde está mirando. Para ello hay que indicarle un punto 3D. En nuestro caso, la cámara mira hacia delante del robot y por ello un punto válido podría ser (100.0 0.0 200.0), o cualquier punto que se encuentre delante de él. roll será 0, dado que la cámara no estará inclinada con respecto a la vertical.

Por último, para calcular fdist, u0 y v0, seguiremos lo expuesto en la receta anterior de progeo.

Para aplicar todos estos parámetros tendremos que utilizar la función update_camera_matrix, y con esto ya estamos preparados para utilizar progeo.

Como podéis comprobar, esta biblioteca se compone principalmente de dos funciones: project y backproject. En nuestro caso nos interesa la segunda, backproject, con la que, proporcionándole un punto de la imagen (un pixel en 2D) obtendremos la proyección en 3D de este.

Previamente, el punto 2D perteneciente al pixel de la imagen tendremos que convertirlo de gráfico a óptico (Xóptica=239-Ygráfica e  Yóptica=Xgráfica).

Project trabaja en el sistema de referencia solidario al robot (relativo). Esto es importante a tener en cuenta, dado que el punto que obtengamos tendrá como origen de coordenadas la posición del robot.tecnica

Una vez que obtenemos el punto con el backproject tendremos que construir el rayo proyectado (recta formada por la posición de la cámara y el punto obtenido) y calcular su intersección con el suelo (el plano con la componente Z=0).

Por último, traduciremos el punto obtenido (sistema de referencia relativo al robot) al sistema de referencia absoluto del mundo, para lo cual utilizaremos la función «relativas2absolutas».

Con todo esto habremos calculado, para cada pixel «frontera» de la imagen (aquellos que nos representan el suelo) su correspondiente punto en el mundo y estaremos preparados para comenzar a segmentar…

8 pensamientos en “Navegación Visual II: Conversión de puntos 2D a 3D

  1. With great extras that come standard, including innovative
    storage options, Cancer Treatment takes high quality gun safes to the next stage.
    As he runs through three fields, you can afford to purchase a gun,
    buying a gun safe is especially constructed to effectively seal and protect its contents
    against fire and heat. If he is so generous with being good, then she wants to deserve.

  2. These Malaga paphos car hire companies are included for consideration.
    The last of all was a special liquor that is made by Aston
    Martin, comfortis also important especially during birthday paphos
    car hire. Good news, you can enjoy the tour to Agra is also home to
    amazing animals such as albatross birds and whales.
    There are many charter flights into the airport
    and by coincidence I rented a car there for four days in March 2013.
    This is actually the case for English.

  3. Before choosing a stove, it is important you should look at handful particulars.
    Inspiring than success love food item baked than the sack.
    One easy path to start building ones own parabolic
    pv tandoor is to try a fabulous ready-made satellite direct tv tank (granted, play one a thief maintains thrown
    away). Deleted this particular efficiency raise making use of street fighting techniques or simply wire-stripping package.

  4. As the capital city of China, Beijing is the center of national politics and culture, and a hub of Chinese international interaction.
    Alongside Xian, Luoyang, Kaifeng, Nanjing and Hangzhou,
    Beijing is one of the Six Ancient Cities in China.
    In addition, Beijing was the host city of the 2008 Summer Olympics.
    With a population of about 17 million people, Beijing contains 18 districts and counties, which are further
    subdivided into 273 lower (third)-level administrative units at the township level.

    Situated at the northwest edge of the North China Plain, Beijing City is next to Tianjin City, to its southeast.
    The landform of this city basically falls away from northwest to
    southeast. Beijing was also known as Peking by the Western world before 1949.

    It is one of the famed ancient cities in the world.
    With more than two-thousand years of history, Beijing City is a place of military importance.
    It had consistently been the capital of the Liao, Jin, Yuan, Ming and Qing
    dynasties. In the early nineteen-twenties, Beijing became the cradle of Chinese new democratic revolution.
    The May Fourth Movement against imperialism and feudalism began here in 1919.
    And in Oct. 1, 1949, Beijing became the capital city of the PRC, which opened a new page in this ancient city.
    Beijing boasts abundant tourist resources; ancient architecture,
    royal gardens, mansions, towers, temples, palaces, and modern structures, including the world-class Forbidden City,
    Temple of Heaven, Summer Palace and the Great Wall
    at Badaling. With such a mature ability in receiving tourists, Beijing will
    be an ideal tour destination to get more of an idea of China as a country,
    and moreover as a cultural gathering place for artists and musicians.

    Airlines connect Beijing with more than 110 cities at home and abroad, while the city boasts a
    fine railroad and highway system for local travelers.
    Urban construction has brought new changes to Beijing, resulting in a
    unique combination of ancient civilization and modern metropolis.

  5. Thanks for a marvelous posting! I seriously enjoyed reading it, you could be a great author.
    I will be sure to bookmark your blog and will eventually come back from now on.
    I want to encourage you to continue your great job,
    have a nice weekend!

  6. I’m really inspired together with your way with words-at all plus together with the format inside your website. Is it your compensated matter or do you customize that yourself? In either case keep within the excellent high quality producing, it’s uncommon to see an incredible weblog like this one as of late.

Replica a Find Free People Cancelar la respuesta