You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
124 lines
4.3 KiB
124 lines
4.3 KiB
/* |
|
* stereo.h |
|
* |
|
* History: |
|
* 2018/09/17 - [Xu Liang] created file |
|
* |
|
* Copyright (c) 2018 Ambarella, Inc. |
|
* |
|
* This file and its contents ("Software") are protected by intellectual |
|
* property rights including, without limitation, U.S. and/or foreign |
|
* copyrights. This Software is also the confidential and proprietary |
|
* information of Ambarella, Inc. and its licensors. You may not use, reproduce, |
|
* disclose, distribute, modify, or otherwise prepare derivative works of this |
|
* Software or any portion thereof except pursuant to a signed license agreement |
|
* or nondisclosure agreement with Ambarella, Inc. or its authorized affiliates. |
|
* In the absence of such an agreement, you agree to promptly notify and return |
|
* this Software to Ambarella, Inc. |
|
* |
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, |
|
* MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
* IN NO EVENT SHALL AMBARELLA, INC. OR ITS AFFILIATES BE LIABLE FOR ANY DIRECT, |
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
* LOSS OF USE, DATA, OR PROFITS; COMPUTER FAILURE OR MALFUNCTION; OR BUSINESS |
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
* POSSIBILITY OF SUCH DAMAGE. |
|
* |
|
*/ |
|
|
|
#ifndef __STEREO_H__ |
|
#define __STEREO_H__ |
|
|
|
/*! @file stereo.h |
|
* @brief This file defines stereo message type. |
|
*/ |
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
|
#include <stdint.h> |
|
|
|
/*! @addtogroup stereo-helper |
|
* @{ |
|
*/ |
|
/*! @macros MAX_OBJECT_NUMBER |
|
* @brief define max object detection number. |
|
*/ |
|
#define MAX_OBJECT_NUMBER (32) |
|
|
|
/*! @macros BBOX_POINT_NUMBER |
|
* @brief define 3d BBOX point number. |
|
*/ |
|
#define BBOX_POINT_NUMBER (8) |
|
|
|
/*! @macros SPU_OUTPUT_SERVER |
|
* @brief define spu socket server. |
|
*/ |
|
#define SPU_OUTPUT_SERVER "/tmp/spu_output.server" |
|
/*! @} */ /* End of stereo-helper */ |
|
|
|
/*! @addtogroup stereo-struct |
|
* @{ |
|
*/ |
|
typedef struct pinhole_camera_t { |
|
uint32_t id; /*!< input number into arm vo task. */ |
|
uint32_t width; /*!< image width */ |
|
uint32_t height; /*!< image height */ |
|
float ku; /*!< horizontal scale factor [px] */ |
|
float kv; /*!< vertical scale factor [px] */ |
|
float u0; /*!< x coord of principal point [px] */ |
|
float v0; /*!< y coord of principal point [px] */ |
|
float baseline; /*!< baseline for stereo views, 0.0f for monocular [m] */ |
|
float camera_to_body_orientation[4]; /*!< a quaternion representing the camera orientation expressed in the body reference system */ |
|
float camera_to_body_position[3]; /*!< a vector representing the camera position expressed in the body reference system [m] */ |
|
} pinhole_camera_t; |
|
|
|
typedef struct visual_point2d_s { |
|
uint16_t u; /*!< x coordinate */ |
|
uint16_t v; /*!< y coordinate */ |
|
} visual_point2d_t; |
|
|
|
typedef struct visual_object_s { |
|
uint32_t object_id; /*!< object id */ |
|
visual_point2d_t bbox[BBOX_POINT_NUMBER]; /*!< coordinate[pixel] */ |
|
uint16_t width; /*!< object width[cm] */ |
|
uint16_t height; /*!< object height[cm] */ |
|
uint16_t depth; /*!< object depth[cm] */ |
|
uint16_t distance; /*!< object distance[cm] */ |
|
uint16_t distance_from_gnd; /*!< object distance from ground[cm] */ |
|
uint16_t is_positive; /*!< 1-true, 0-false */ |
|
} visual_object_t; |
|
|
|
typedef struct visual_format_s { |
|
uint32_t object_cnt; /*!< object number */ |
|
pinhole_camera_t pinhole_camera; /*!< pinhole camera information*/ |
|
visual_object_t visual_object[MAX_OBJECT_NUMBER]; /*!< object information */ |
|
} visual_format_t; |
|
|
|
typedef struct dsi_info_s { |
|
uint32_t img_width; /*!< dsi width */ |
|
uint32_t img_pitch; /*!< dsi pitch */ |
|
uint32_t img_height; /*!< dsi height */ |
|
uint32_t dsi_offset; /*!< dsi offset */ |
|
} dsi_info_t; |
|
|
|
typedef struct spu_output_msg_s { |
|
dsi_info_t dsi_info; /*!< dsi information */ |
|
visual_format_t visual_format; /*!< visual format */ |
|
dsi_info_t msb_stream_info; /*!< MSB5p3 stream info */ |
|
dsi_info_t lsb_stream_info; /*!< LSB5p3 stream info */ |
|
dsi_info_t stream_me1_info; /*!< me1 info for above two streams */ |
|
dsi_info_t stream_me0_info; /*!< me0 info for above two streams */ |
|
} spu_output_msg_t; |
|
|
|
/*! @} */ /* End of stereo-struct */ |
|
|
|
#ifdef __cplusplus |
|
} |
|
#endif |
|
|
|
#endif
|
|
|