c# C++接口封装 汽车模拟仿真
struct PinCamParIn//用户输入的针孔相机参数结构体
{
char CameraName[512];
float Offset[3];
float Angle[3];
float FocalLen;
float PixsSize;
int Resolution[2];
}
struct PinCamParOut//用于给南老师渲染图像的相机参数结构体
{
char CameraName[512];
float Offset[3];
float Angle[3];
float VerFOV;
float Aspect;
int Resolution[2];
}
struct FishCamPar//用户输入的鱼眼相机参数结构体
{
char CameraName[512];
float Offset[3];
float Angle[3];
float FocalLen;
float PixsSize;
int Resolution[2];
float MaxFOV;
}
struct ImagePar//输出图像性质结构体
{
unsigned char* ImagePtr;//图像数组指针
int Resolution[2];
}
struct EnvCamPar//用户输入包络线相机参数结构体
{
char CameraName[512];
int Flag;//用于储存切割集合体形状
float NearDist;
float FarDist;
float FOV[2];
}
struct EnvImPar//用户输入包络线图像参数结构体
{
float SecHeight;
float mPerBlock;
int MaxXBlockNum;
int MaxYBlockNum;
}
/*
用于将用户输入的针孔相机参数结构体转换为南老师渲染需要的针孔相机结构体。
函数参数说明:
struct PinCamParIn InputPinPar 用户输入的针孔相机参数
返回值说明:
struct PinCamParOut类型,用于给南老师渲染
*/
struct PinCamParOut CameraIOTransfer(struct PinCamParIn InputPinPar)
/*
用于根据用户输入的鱼眼相机参数计算得到合成图片用的5个针孔相机参数。
函数参数说明:
struct FishCamPar InputFishPar 用户输入的鱼眼相机参数
返回值说明:
struct PinCamParOut*类型指针,存储着5个鱼眼相机的渲染参数
*/
struct PinCamParOut* FisheyeParCal(struct FishCamPar InputFishPar)
/*
用于合成鱼眼镜头图像
函数参数说明:
struct FishCamPar InputFishPar 用户输入的鱼眼相机参数
ImagePar* FishPinImList 存储5张针孔图片内存的指针
返回值说明:
struct ImagePar 类型的结构体,存储鱼眼图像的指针和横纵像素数
*/
struct ImagePar FisheyeSyn(struct FishCamPar InputFishPar, struct ImagePar* FishPinImList)
/*
用于计算界面上包络线相机的缺省值参数
函数参数说明:
struct PinCamParIn InputPinPar 用户输入的针孔相机参数
返回值说明:
struct EnvCamPar 类型的结构体,存储界面上包络线相机参数的结构体
*/
struct EnvCamPar EnvCamParCal(struct PinCamParIn InputPinPar)
/*
用于生成包络线图片
函数参数说明:
int PinCamNum 针孔相机数量
float ShaftHeight 车辆前轴高度
struct PinCamParIn* InputPinParList 指向所有针孔相机参数结构体数组的指针
struct EnvCamPar* EnvParList 指向所有包络线相机参数结构体的指针
struct EnvImPar EnvImSet 存储用户设置的包络线图形参数的结构体
返回值说明:
struct ImagePar 类型的结构体,存储包络线图像的指针和横纵像素数
*/
struct ImagePar Envelope(int PinCamNum, float ShaftHeight, struct PinCamParIn* InputPinParList, struct EnvCamPar* EnvParList , struct EnvImPar EnvImSet)
// 给北京外包公司接口及结构体定义
struct PinCamParIn//用户输入的针孔相机参数结构体
{
char CameraName[512];
float Offset[3];
float Angle[3];
float FocalLen;
float PixsSize;
int Resolution[2];
}
struct PinCamParOut//用于给南老师渲染图像的相机参数结构体
{
char CameraName[512];
float Offset[3];
float Angle[3];
float VerFOV;
float Aspect;
int Resolution[2];
}
struct FishCamPar//用户输入的鱼眼相机参数结构体
{
char CameraName[512];
float Offset[3];
float Angle[3];
float FocalLen;
float PixsSize;
int Resolution[2];
float MaxFOV;
}
struct ImagePar//输出图像性质结构体
{
unsigned char* ImagePtr;//三维数组指针
int Resolution[2];
}
struct EnvCamPar//用户输入包络线相机参数结构体
{
char CameraName[512];
int Flag;//用于储存切割集合体形状
float NearDist;
float FarDist;
float FOV[2];
}
struct EnvImPar//用户输入包络线图像参数结构体
{
float SecHeight;
float mPerBlock;
int MaxXBlockNum;
int MaxYBlockNum;
}
// ------------------------------------------------------------------------------------------------
/*!
*
* 界面针孔相机参数转换为3D渲染相机参数的接口
*
* @param[in] PinCamParIn 用户输入界面相机参数
* return PinCamParOut 输出3D渲染相机参数
*/
struct PinCamParOut CameraIOTransfer(struct PinCamParIn InputPinPar)
// ------------------------------------------------------------------------------------------------
/*!
*
* 生成鱼眼图像接口
*
* @param[in] InputFishPar 用户输入鱼眼相机参数
* return PinCamParOut 输出3D渲染相机参数
*/
struct ImagePar FisheyeSyn(struct FishCamPar InputFishPar)
// ------------------------------------------------------------------------------------------------
/*!
*
* 包络线生成接口
*
* @param[in] PinCamNum 用户输入相机数量
* @param[in] EnvParList 用户输入包络线相机参数结构体指针
* @param[in] EnvImSet 用户输入包络线图像参数结构体
* return ImagePar 输出图像数据
*/
struct ImagePar Envelope(int PinCamNum, struct EnvCamPar* EnvParList, struct EnvImPar EnvImSet)
// -------------------------------------------------------------------------------------------------
c# 封装后-------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace PanoCam.Interface
{
/// <summary>
/// 相机接口
/// </summary>
public static class IPanoCamera
{
/// <summary>
/// 用户输入的针孔相机参数结构体
/// </summary>
public struct PinCamParIn
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string CameraName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] Offset;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] Angle;
public float FocalLen;
public float PixsSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public int[] Resolution;
}
/// <summary>
/// 用于给南老师渲染图像的相机参数结构体
/// </summary>
public struct PinCamParOut
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string CameraName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] Offset;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] Angle;
public float VerFOV;
public float Aspect;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public int[] Resolution;
}
/// <summary>
/// 用户输入的鱼眼相机参数结构体
/// </summary>
public struct FishCamPar
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string CameraName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] Offset;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public float[] Angle;
public float FocalLen;
public float PixsSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public int[] Resolution;
public float MaxFOV;
}
/// <summary>
/// 输出图像性质结构体
/// </summary>
public struct ImagePar
{
public IntPtr ImagePtr;//三维数组指针unsigned char*
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public int[] Resolution;
}
/// <summary>
/// 用户输入包络线相机参数结构体
/// </summary>
public struct EnvCamPar//
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string CameraName;
public int Flag;//用于储存切割集合体形状
public float NearDist;
public float FarDist;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public float[] FOV;
}
/// <summary>
/// 用户输入包络线图像参数结构体
/// </summary>
public struct EnvImPar//
{
public float SecHeight;
public float mPerBlock;
public int MaxXBlockNum;
public int MaxYBlockNum;
}
// ------------------------------------------------------------------------------------------------
/*!
*
* 界面针孔相机参数转换为3D渲染相机参数的接口
*
* @param[in] PinCamParIn 用户输入界面相机参数
* return PinCamParOut 输出3D渲染相机参数
*/
[DllImport("dllPort.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "CameraIOTransfer")]
public static extern IntPtr CameraIOTransfer(IntPtr InputPinPar);
// ------------------------------------------------------------------------------------------------
/*!
*
* 生成鱼眼图像接口
*
* @param[in] InputFishPar 用户输入鱼眼相机参数
* return ImagePar 输出图像数据
*/
[DllImport("dllPort.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "FisheyeSyn")]
public static extern IntPtr FisheyeSyn(IntPtr InputFishPar);
// ------------------------------------------------------------------------------------------------
/*!
*
* 包络线生成接口
*
* @param[in] PinCamNum 用户输入相机数量
* @param[in] EnvParList 用户输入包络线相机参数结构体指针
* @param[in] EnvImSet 用户输入包络线图像参数结构体
* return ImagePar 输出图像数据
*/
[DllImport("dllPort.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Envelope")]
public static extern IntPtr Envelope(int PinCamNum, IntPtr EnvParList, IntPtr EnvImSet);
// -------------------------------------------------------------------------------------------------
}
}
c# C++接口封装 汽车模拟仿真的更多相关文章
- Java微信公众平台接口封装源码分享
前言: 这篇博客是在三月初动手项目的时候准备写的,但是为了完成项目只好拖延时间写这篇博客,顺便也可以在项目中应用我自己总结的的一些经验.今天看来,这些方法的应用还是可以的,至少实现了我之前的 ...
- C++ Redis mset 二进制数据接口封装方案
C++ Redis mset 二进制数据接口封装方案 需求 C++中使用hiredis客户端接口访问redis: 需要使用mset一次设置多个二进制数据 以下给出三种封装实现方案: 简单拼接方案 在r ...
- hiredis异步接口封装并导出到Lua
hiredis异步接口封装并导出到Lua(金庆的专栏 2017.1)hiredis 不支持 Windows, Windows 下使用 wasppdotorg / hiredis-for-windows ...
- 基于Verilog的带FIFO输出缓冲的串口接收接口封装
一.模块框图及基本思路 rx_module:串口接收的核心模块,详细介绍请见“基于Verilog的串口接收实验” rx2fifo_module:rx_module与rx_fifo之间的控制模块,其功能 ...
- U3D模拟仿真实现
最近在做一个模拟仿真系统,数据源是一个实时数据库,场景中包含一些监测点.监测点给信号的方式是有物体到了监测点给上料信号,物体离开了监测点给下料信号:注意,如果有多个物体到达或离开监测点,那给信号的时间 ...
- vue2.0 + vux (五)api接口封装 及 首页 轮播图制作
1.安装 jquery 和 whatwg-fetch (优雅的异步请求API) npm install jquery --save npm install whatwg-fetch --save 2. ...
- 基于Zabbix API文档二次开发与java接口封装
(继续贴一篇之前工作期间写的经验案例) 一. 案例背景 我负责开发过一个平台的监控报警模块,基于zabbix实现,需要对zabbix进行二次开发. Zabbix官方提供了Rest ...
- 微信小程序“一劳永逸”的接口封装
前言 最近都在研究小程序了,我可以的! 需求 之前都是用vue来开发项目的,接口模块我特意封装了一下.感觉也可以记录一下 小程序的接口虽说简单,但是重复调用那么多,显得不专业(一本正经的胡说八道) 还 ...
- Plx9030通讯卡驱动开发与接口封装
在学校的时候,曾经采用DDK+Driverstudio+VC6.0环境做过9054视频采集卡的驱动开发,回想起调试过程,记得最清楚的就是过无数次的计算机蓝屏重启....今天第一天来到新公司,老大就说你 ...
随机推荐
- ASP.NET CheckBoxList Operations with jQuery
本文描述了如何通过jQuery来对ASP.NET CheckBoxList控件进行一些基本操作,如通过value/text/index check/uncheck CheckBoxList,最小/最大 ...
- QWidget 实现 打破布局 或者 当前窗体内的 弹窗 (借助伪造实现)
but = QtWidgets.QToolButton(Dialog2) but.setText('**') but.setAutoRaise(True) layout.addWidget(but) ...
- Jquery对Cookie的操作
第一步:先引用jQuery的插件jquery-1.9.1.min.js 第二步:引用jquery.cookie.js插件 下对cookie的操作: $.cookie("cookieName& ...
- java方法创建
一个方法public(作用域) void(void是不要返回值,String返回String类型,User(自定义的类型)返回User类型) test(方法名) (int a(参数)){ } stat ...
- 关于 ‘--exec’ 参数( find 命令)及介绍 ‘xargs ’命令区别(新版)
前言: find 命令一直都是系统管理员的常用命令之一, 其参数中 "-exec" 尤其实用.而 "xargs" 命令,针对查询也有属于自己的见解.本文着重讲解 ...
- 使用Nginx负载均衡搭建高性能.NETweb应用程序二
在文章<使用Nginx负载均衡搭建高性能.NETweb应用程序一>中,让我们对Nginx有了一个初步认识,下面我们将在windows平台下面使用Nginx演示集群部署我们的web应用. 一 ...
- 转:SDL2源代码分析
1:初始化(SDL_Init()) SDL简介 有关SDL的简介在<最简单的视音频播放示例7:SDL2播放RGB/YUV>以及<最简单的视音频播放示例9:SDL2播放PCM>中 ...
- 查看Exchange邮件队列(queue)
#加载Exchange管理模块 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.snapin get-queue #查看队列 get-mes ...
- 利用Android Studio、MAT对Android进行内存泄漏检测
利用Android Studio.MAT对Android进行内存泄漏检测 Android开发中难免会遇到各种内存泄漏,如果不及时发现处理,会导致出现内存越用越大,可能会因为内存泄漏导致出现各种奇怪的c ...
- LeetCode:Longest Substring Without Repeating Characters(最长不重复子串)
题目链接 Given a string, find the length of the longest substring without repeating characters. For exam ...