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视频采集卡的驱动开发,回想起调试过程,记得最清楚的就是过无数次的计算机蓝屏重启....今天第一天来到新公司,老大就说你 ...
随机推荐
- jenkins2 Jenkinsfile
推荐使用Jenkinsfile代替将groovy脚本直接写在jenkins job里. 文章来自:http://www.ciandcd.com文中的代码来自可以从github下载: https://g ...
- 【Android】进入Material Design时代
由于本文引用了大量官方文档.图片资源,以及开源社区的Lib和相关图片资源,因此在转载的时候,务必注明来源,如果使用资源请注明资源的出处,尊重版权,尊重别人的劳动成果,谢谢! Material Desi ...
- Atitit .html5刮刮卡的gui实现总结
Atitit .html5刮刮卡的gui实现总结 #----两个案例canvas或者wScratchPad-1.4.4 1 #----1.添加panel ,这个十mask div.....posti ...
- java生成竖排文字图片
package com.kadang.designer.web.action;import java.awt.Color;import java.awt.Font;import java.awt.Fo ...
- js解析格式化json日期
代码: function jsonDateFormat(jsonDate) {//json日期格式转换为正常格式 try { var date = new Date(parseIn ...
- javaweb学习总结(二十一)——JavaWeb的两种开发模式
SUN公司推出JSP技术后,同时也推荐了两种web应用程序的开发模式,一种是JSP+JavaBean模式,一种是Servlet+JSP+JavaBean模式. 一.JSP+JavaBean开发模式 1 ...
- 重学JAVA基础(八):锁的基本知识
1.线程状态 如上图,当我们新建一个线程,并start后,其实不一定会马上执行,因为只有操作系统调度了我们的线程,才能真正进行执行,而操作系统也随时可以运行其他线程,这时线程又回到可运行状态.这个过程 ...
- 关于 ‘--exec’ 参数( find 命令)及介绍 ‘xargs ’命令区别(新版)
前言: find 命令一直都是系统管理员的常用命令之一, 其参数中 "-exec" 尤其实用.而 "xargs" 命令,针对查询也有属于自己的见解.本文着重讲解 ...
- Windows中搭建已存在的Octopress环境
// 当我们需要在不同的电脑上来对同一个Octopress博客进行维护的时候就需要针对已存在的Octopress来设置环境了, 安装相应的软件 Git:http://msysgit.googlecod ...
- Parallel的陷阱
,).ToArray(); ; Parallel.For<int>( fromInclusive: , toExclusive: nums.Length, /* 陷阱 */ localIn ...