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视频采集卡的驱动开发,回想起调试过程,记得最清楚的就是过无数次的计算机蓝屏重启....今天第一天来到新公司,老大就说你 ...
随机推荐
- HTML5 canvas globalCompositeOperation绘图类型讲解
我们总是将一个图形画在另一个之上,大多数情况下,这样是不够的.比如说,它这样受制于图形的绘制顺序.不过,我们可以利用 globalCompositeOperation 属性来改变这些做法.global ...
- atitit.导航的实现最佳实践and声明式编程
atitit.导航的实现最佳实践and声明式编程 1. 顶部水平栏导航 1 2. 竖直/侧边栏导航 1 3. 选项卡导航 1 4. 面包屑导航 1 5. 标签导航 1 6. 搜索导航 2 7. 分面/ ...
- paip.c++ 转换 java 解决方案
paip.c++ 转换 java 解决方案 作者Attilax 艾龙, EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:http://blog.csdn.net/a ...
- super和this区别
* super()和this()类似,区别是,super()从子类中调用父类的构造方法,this()在同一类内调用其它方法. 4.super和this的异同: 1)super(参数):调用基类中的某一 ...
- PHP常用函数封装
//二分查找function bin_sch($array, $low, $high, $k){ if ($low <= $high) { $mid = intval(($l ...
- 纯css制作带三角border篇(兼容所有浏览器)
今天帅哥给你们介绍下,如何用 border 来制作三角. html 代码如下: 复制代码 代码如下: <div class="arrow-up"></div> ...
- PlaceholderImageView
PlaceholderImageView 说明 1. PlaceHolderImageView基于SDWebImage编写 2. 给定一个图片的urlString,以及一个placeholderIma ...
- 多功能表单填报系统V1.2.1-适用于在线报名系统、调查、数据收集等
多功能表单系统V1.2.1 前台:http://www.schoolms.net/mysoft/biaodan/index.asp 后台:http://www.schoolms.net/myso ...
- BigDecimal除法运算出现java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result的解决办法
BigDecimal除法运算出现java.lang.ArithmeticException: Non-terminating decimal expansion; no exact represent ...
- Windows共享内存示例
共享内存主要是通过映射机制实现的. Windows 下进程的地址空间在逻辑上是相互隔离的,但在物理上却是重叠的.所谓的重叠是指同一块内存区域可能被多个进程同时使用.当调用 CreateFileMapp ...