资源预览内容
第1页 / 共12页
第2页 / 共12页
第3页 / 共12页
第4页 / 共12页
第5页 / 共12页
第6页 / 共12页
第7页 / 共12页
第8页 / 共12页
第9页 / 共12页
第10页 / 共12页
亲,该文档总共12页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Open NI introduction 个人学习整理OpenNI Data Structures Supported platforms #define ONI_PLATFORM_WIN32 1 #define ONI_PLATFORM_LINUX_X86 2 #define ONI_PLATFORM_LINUX_ARM 3 #define ONI_PLATFORM_MACOSX 4 #define ONI_PLATFORM_ANDROID_ARM 5 Callback definitions #define ONI_STDCALL _stdcall #define ONI_C_DECL #define ONI_API_EXPORT _attribute_ (visibility(“default“) #ifdef _cplusplus #define ONI_C extern “C“ #define ONI_C_API_EXPORT ONI_C ONI_API_EXPORT #define ONI_C_API_IMPORT ONI_C ONI_API_IMPORT #define ONI_CPP_API_EXPORT ONI_API_EXPORT #define ONI_CPP_API_IMPORT ONI_API_IMPORT #else 就不用添加extern “C”了typedef structchar uriONI_MAX_STR;char vendorONI_MAX_STR;char nameONI_MAX_STR;uint16_t usbVendorId;uint16_t usbProductId; OniDeviceInfo;typedef structOniPixelFormat pixelFormat;int resolutionX;int resolutionY;int fps; OniVideoMode;typedef enum/ Depth ONI_PIXEL_FORMAT_DEPTH_1_MM = 100, ONI_PIXEL_FORMAT_DEPTH_100_UM = 101, ONI_PIXEL_FORMAT_SHIFT_9_2 = 102, ONI_PIXEL_FORMAT_SHIFT_9_3 = 103, / Color ONI_PIXEL_FORMAT_RGB888 = 200, ONI_PIXEL_FORMAT_YUV422 = 201, ONI_PIXEL_FORMAT_GRAY8 = 202, ONI_PIXEL_FORMAT_GRAY16 = 203, ONI_PIXEL_FORMAT_JPEG = 204, OniPixelFormat;typedef structOniSensorType sensorType;int numSupportedVideoModes;OniVideoMode *pSupportedVideoModes; OniSensorInfo;typedef enumONI_SENSOR_IR = 1,ONI_SENSOR_COLOR = 2,ONI_SENSOR_DEPTH = 3, OniSensorType;typedef structint dataSize;void* data;OniSensorType sensorType;uint64_t timestamp;int frameIndex;int width;int height;OniVideoMode videoMode;OniBool croppingEnabled;int cropOriginX;int cropOriginY;int stride; OniFrame;typedef struct OniDeviceInfoCallback deviceConnected; OniDeviceInfoCallback deviceDisconnected; OniDeviceStateCallback deviceStateChanged; OniDeviceCallbacks;struct _OniDevice; typedef _OniDevice* OniDeviceHandle; struct _OniStream; typedef _OniStream* OniStreamHandle; struct _OniRecorder; typedef _OniRecorder* OniRecorderHandle;OpenNI C interfaces General APIs OniStatus oniInitialize(int apiVersion); OniStatus oniGetDeviceList(OniDeviceInfo* pDevices, int* pNumDevices); OniStatus oniRegisterDeviceCallbacks(OniDeviceCallbacks* pCallbacks, void* pCookie, OniCallbackHandle* pHandle); OniStatus oniWaitForAnyStream(OniStreamHandle* pStreams, int numStreams, int* pStreamIndex, int timeout); Device APIs OniStatus oniDeviceOpen(const char* uri, OniDeviceHandle* pDevice); const OniSensorInfo* oniDeviceGetSensorInfo(OniDeviceHandle device, OniSensorType sensorType); OniStatus oniDeviceGetInfo(OniDeviceHandle device, OniDeviceInfo* pInfo); OniStatus oniDeviceCreateStream(OniDeviceHandle device, OniSensorType sensorType, OniStreamHandle* pStream); OniStatus oniDeviceEnableDepthColorSync(OniDeviceHandle device); 两者的采集时间差限 定在一定的范围内 OniStatus oniDeviceSetProperty(OniDeviceHandle device, int propertyId, const void* data, int dataSize); OniBool oniDeviceIsPropertySupported(OniDeviceHandle device, int propertyId); OniStatus oniDeviceInvoke(OniDeviceHandle device, int commandId, const void* data, int dataSize); /* Invoke an internal functionality of the device. */ OniBool oniDeviceIsCommandSupported(OniDeviceHandle device, int commandId); OniBool oniDeviceIsImageRegistrationModeSupported(OniDeviceHandle device, OniImageRegistrationMode mode); /不同位置的camera图像叠加OpenNI C interfaces2 Stream APIsconst OniSensorInfo* oniStreamGetSensorInfo(OniStreamHandle stream); OniStatus oniStreamStart(OniStreamHandle stream); OniStatus oniStreamReadFrame(OniStreamHandle stream, OniFrame* pFrame); oniStreamRegisterNewFrameCallback(OniStreamHandle stream, OniNewFrameCallback handler, void* pCookie, OniCallbackHandle* pHandle); OniStatus oniStreamSetProperty(OniStreamHandle stream, int propertyId, const void* data, int dataSize); OniBool oniStreamIsPropertySupported(OniStreamHandle stream, int propertyId); OniStatus oniStreamInvoke(OniStreamHandle stream, int commandId, const void* data, int dataSize); OniBool oniStreamIsCommandSupported(OniStreamHandle stream, int commandId); void oniFrameAddRef(OniFrame* pFrame); /* Mark another user of the frame. */ Record Stream APIS: 录制到文件OniStatus oniCreateRecorder(const char* fileName, OniRecorderHandle* pRecorder); OniStatus oniRecorderAttachStream( OniRecorderHandle recorder, OniStreamHandle stream, OniBool allowLossyCompression); OniStatus oniRecorderStart(OniRecorderHandle recorder); 坐标转换 OniStatus oniCoordinateConverterDepthToWorld(OniStreamHandle depthStream, float depthX, float depthY, float depthZ, float* pWorldX, float* pWorldY, float* pWorldZ); OniStatus oniCoordinateConverterWorldToDepth(OniStreamHandle depthStream, float worldX, float worldY, float worldZ, float* pDepthX, float* pDepthY, float* pDepthZ); OniStatus oniCoordinateConverterDepthToColor(OniStreamHandle depthStream, OniStreamHandle colorStream, int depthX, int depthY, OniDepthPixel depthZ, int* pColorX, int* pColorY);OpenNI C+ interfaces class VideoMode : pr
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号