永年网站建设创建全国文明城市总结

news/2025/10/4 10:12:25/文章来源:
永年网站建设,创建全国文明城市总结,wordpress更换背景,网站的外链是什么1 rtsp 接入 我们使用unity UE 等三维渲染引擎中使用c编写插件来接入rtsp 视频。同时做融合的时候#xff0c;和背景的三维颜色要一致#xff0c;这就要使用视频融合修正技术。包括亮度#xff0c;对比度#xff0c;饱和度的修正。在单纯颜色上的修正可以简单使用rgb-…1 rtsp 接入 我们使用unity UE 等三维渲染引擎中使用c编写插件来接入rtsp 视频。同时做融合的时候和背景的三维颜色要一致这就要使用视频融合修正技术。包括亮度对比度饱和度的修正。在单纯颜色上的修正可以简单使用rgb-hsv去修改这里不做累赘说明了。 2 播放技术 使用unity 的纹理渲染来播放多路 视频视频接入最大可达到30路同时在untiy UE5 中渲染。播放后有很多视频的颜色不一致如何调整颜色成了一个问题 3 untiy 渲染过程 建立一个材质如命名为m2 将m2 赋值给我们的面片如pp 接下来创建一个shader控制渲染的亮度对比度饱和度分别是 Brightness, Saturation, Contrast, unity shader的基础不再啰嗦各位可以稍稍看一下不难。 Shader self/BrightnessSaturationAndContrast {Properties{_MainTex (Base(RGB, 2D) white {}//从脚本传递更好这里可以直接省略这些值的展示_Brightness (Brightness, float) 1_Saturation (Saturation, float) 1_Contrast (Contrast, float) 1}SubShader{Pass{//关闭深度写入//ZTest Always Cull Off Zwrite OffCGPROGRAM#pragma vertex vert#pragma fragment frag#include UnityCG.cginc//propertiessampler2D _MainTex;half _Brightness;half _Saturation;half _Contrast;struct v2f {float4 pos : SV_POSITION;half2 uv : TEXCOORD0; };//使用了内置的appdata_img结构体作为顶点着色器的输入v2f vert(appdata_img v) {v2f o;o.pos UnityObjectToClipPos(v.vertex);o.uv v.texcoord;return o;}fixed4 frag(v2f i) : SV_Target {//获得屏幕图像的采样fixed4 renderTex tex2D(_MainTex, i.uv);//亮度fixed3 finalColor renderTex.rgb * _Brightness;//饱和度fixed luminance 0.2125 * renderTex.r 0.7154 * renderTex.g 0.0721 * renderTex.b; //计算该像素的亮度值fixed3 luminanceColor fixed3(luminance, luminance, luminance); //创建饱和度为0的颜色finalColor lerp(luminanceColor, finalColor, _Saturation);//contrastfixed3 avgColor fixed3(0.5, 0.5, 0.5);finalColor lerp(avgColor, finalColor, _Contrast);return fixed4(finalColor, renderTex.a);}ENDCG}}FallBack Off }写好shader以后 写一个脚本调入我们的c#脚本脚本一为控制我们的c插件二是可以修改,以下的插件脚本负责调入c 的插件插件会在线程里面启动获取图像赋值给面片。插件本身可以接入实时视频播放视频倒放视频支持国标gb28181和onvif协议可以支持矫正视频支持多组矫正参数同时增加三个变量改变亮度对比度饱和度便于在里面实时修改观察。 //author: 钱波 using System; using System.Text; using System.Threading; using System.Collections; using UnityEngine; using System.Runtime.InteropServices; using UnityEngine.UI; using System.Linq; using System.Collections.Generic; using Unity.VisualScripting; using System.IO;[StructLayout(LayoutKind.Sequential)] public struct FRAME {public int width;public int height;public int len;public IntPtr Frame;public IntPtr data;//public byte[] data;//[MarshalAs(UnmanagedType.LPArray)] } [StructLayout(LayoutKind.Sequential)] public struct PARAM {public double p1;public double p2;public double p3;public double p4;public double p5;public double p6;public double p7;public double p8;public double p9;public double c1;public double c2;public double c3;public double c4;public double c5; }public class rtspin : MonoBehaviour {[DllImport(rtspPlugin)]public static extern bool rtsp_test([MarshalAs(UnmanagedType.LPStr)] string url, int isnv12);[DllImport(rtspPlugin)]public static extern bool rtsp_test_data([MarshalAs(UnmanagedType.LPStr)] string url,[MarshalAs(UnmanagedType.LPArray)] byte[] data, ref FRAME frame);[DllImport(rtspPlugin)]public static extern bool rtsp_test_data_nv12([MarshalAs(UnmanagedType.LPStr)] string url,[MarshalAs(UnmanagedType.LPArray)] byte[] data0, [MarshalAs(UnmanagedType.LPArray)] byte[] data1);[DllImport(rtspPlugin)]public static extern void rtsp_test_stop([MarshalAs(UnmanagedType.LPStr)] string url);[DllImport(rtspPlugin)]public static extern void rtsp_test_setparam([MarshalAs(UnmanagedType.LPStr)] string url, ref PARAM param);static string[] stringArray {rtsp://127.0.0.1/front.mkv };static string[] stringPlanes { pp};//Texture2D[] texture2Ds;int w1 1920;int h1 1080;int number 1;[Range(0.0f, 3.0f)]public float brightness 1.0f;[Range(0.0f, 3.0f)]public float saturation 1.0f;[Range(0.0f, 3.0f)]public float contrast 1.0f;public Material briSatConMaterial;class cmd{public int v_w1 1920;public int v_h1 1080;public byte[] v_data;public Texture2D v_texture2Ds;public cmd(){v_data new byte[v_w1 * v_h1 * 3];v_texture2Ds new Texture2D(v_w1, v_h1, TextureFormat.RGB24, false);//RGB24}}PARAM v_param;//byte[][] v_datas;Dictionaryint, cmd hashMap_datas new Dictionaryint, cmd();//byte[][] hashMap_datas;void rtspThreading(string url){Debug.Log(url);rtsp_test(url, 1);}void Start(){//string path Application.dataPath /rtsp.txt;//path path.Replace(/, \\);//if (File.Exists(path))//{// Debug.Log(FileExists);// stringArray File.ReadAllLines(path);//}//else//{// Debug.Log(FileNotExists);// File.CreateText(path);//}stringArray[0] rtsp://127.0.0.1/front.mkv;for (int i 0; i number; i){cmd c1 new cmd();hashMap_datas.Add(i, c1);}v_param new PARAM();//v_param.p1 6.5746697810243404e002;//v_param.p2 0.0;//v_param.p3 3.1950000000000000e002;//v_param.p4 0.0;//v_param.p5 6.5746697810243404e002;//v_param.p6 2.3950000000000000e002;//v_param.p7 0.0;//v_param.p8 0.0;//v_param.p9 1.0;//v_param.c1 -0.5180232701824102559;//v_param.c2 0.5071524380583312119;//v_param.c3 0.0;//v_param.c4 0.0;//v_param.c5 -0.5784359684793970446;//1281.48 0 975.5 0 1997.48 0 0 0 1 -0.6 0.4 0.1 0 -0.198v_param.p1 1281.48;v_param.p2 0.0;v_param.p3 975.5;v_param.p4 0.0;v_param.p5 1997.48;v_param.p6 0.0;v_param.p7 0.0;v_param.p8 0.0;v_param.p9 1.0;v_param.c1 -0.6;v_param.c2 0.4;v_param.c3 0.1;v_param.c4 0.0;v_param.c5 -0.198;GameObject go GameObject.Find(pp);briSatConMaterial go.GetComponentMeshRenderer().material;}private void OnGUI(){if (GUI.Button(new Rect(120, 10, 80, 30), 开始线程)){Debug.Log(开始rtsp......);for (int i 0; i number; i){int currentIndex i;Thread rtspthread1 new Thread(() rtspThreading(stringArray[currentIndex]));rtspthread1.Start();Thread.Sleep(1);}}//绘制按钮以及按下断开连接按钮发送断开连接请求if (GUI.Button(new Rect(210, 10, 80, 30), 结束线程)){Debug.Log(结束rtsp......);for (int i 0; i number; i){int currentIndex i;rtsp_test_stop(stringArray[currentIndex]);}}}//float delta_x, delta_y, delta_z; //计算移动量//float distance 5;//float ZoomSpeed 5f; //拉近拉远速度//public bool isFar true;void Update(){FRAME frame new FRAME();if (briSatConMaterial ! null){briSatConMaterial.SetFloat(_Brightness, brightness);briSatConMaterial.SetFloat(_Saturation, saturation);briSatConMaterial.SetFloat(_Contrast, contrast);}for (int i 0; i number; i){if (rtsp_test_data(stringArray[i], hashMap_datas[i].v_data, ref frame)){rtsp_test_setparam(stringArray[i], ref v_param);//Texture2D original new Texture2D(w1, h1, TextureFormat.RGB24, false);//original.LoadRawTextureData(hashMap_datas[i].v_data);//FlipTexture(original, hashMap_datas[i].v_texture2Ds);hashMap_datas[i].v_texture2Ds.LoadRawTextureData(hashMap_datas[i].v_data);hashMap_datas[i].v_texture2Ds.Apply();GameObject go GameObject.Find(stringPlanes[i]);go.GetComponentMeshRenderer().material.mainTexture hashMap_datas[i].v_texture2Ds;}}}void OnDestroy(){Debug.Log(Destory, 结束rtsp......);for (int i 0; i number; i){int currentIndex i;rtsp_test_stop(stringArray[currentIndex]);}} }结果 点击开始播放rtsp线程开始播放inspector里面可以调整三个值可以直观地看到视频播放的亮度和对比度饱和度的改变。 修改一下亮度 同时修改三个参数的变化

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/927005.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

楚雄自助建站系统地税城市维护建设税网站是什么

Azure 提供了几种托管网站的方式:Azure 应用服务、虚拟机、Service Fabric 和云服务。 本文可帮助你了解这几种方式,并针对 Web 应用程序做出正确的选择。 Azure 应用服务是大多数 Web 应用的最佳选择。 部署和管理都已集成到平台,站点可以快…

济南php网站开发使用element做的网站

Mars 是一个并行和分布式 Python 框架,能轻松把单机大家耳熟能详的的 numpy、pandas、scikit-learn 等库,以及 Python 函数利用多核或者多机加速。这其中,并行和分布式 Python 函数主要利用 Mars Remote API。 启动 Mars 分布式环境可以参考…

柳市网站优化昌江县住房和城乡建设局网站

网上排出此错误方法的很多,但是 都不简洁,找不到根本原因 主要排查两点: 1.代码中jdbc链接的编码规则 urljdbc:mysql://localhost:3306/title?useUnicodetrue&characterEncodingutf8 将characterEncoding设置为utf8 2.设置mysq…

网站备案中是什么意思新能源汽车车型及报价

给出两个正整数&#xff0c;判断他们的大小。 输入格式&#xff1a; 两个正整数。 输出格式&#xff1a; 若前者大&#xff0c;输出>&#xff1b; 若后者大&#xff0c;输出<&#xff1b; 若一样大&#xff0c;输出。 输入&#xff1a; 1412894619244619891 23762842…

完整教程:AI时代如何高效学习Python:从零基础到项目实战de封神之路(2025升级版)

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

cannot resolve method add in T 及 T 泛型类型生成Excel文件,区别是数据Model不同

cannot resolve method add in T 及 T 泛型类型生成Excel文件,区别是数据Model不同cannot resolve method add in T 及 T 泛型类型生成Excel文件,区别是数据Model不同 1.通过继承父类来解决public void largeDataCre…

网站开发专员招聘企业网站需要多大带宽

1.继承派生的区别 继承&#xff1a;子继父业&#xff0c;就是子类完全继承父类的全部内容 派生&#xff1a;子类在父类的基础上发展 2.继承方式 1.public继承为原样继承 2.protected继承会把public继承改为protect继承 3.private继承会把public&#xff0c;protected继承改为pr…

备案中网站名称网站建设创客

*本文系SDNLAB编译自瞻博网络技术专家兼高级工程总监Sharada Yeluri领英 在路由器和交换机中&#xff0c;缓冲区至关重要&#xff0c;可以防止网络拥塞期间的数据丢失。缓冲区到底要多大&#xff1f;这个问题在学术界和工业界一直备受争议。本文探讨了高端路由器中数据包缓冲的…

MySQL慢查询深度解析:从诊断到优化的完整指南 - 实践

MySQL慢查询深度解析:从诊断到优化的完整指南 - 实践pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas&qu…

手写MyBatis第88弹:从XML配置到可执行SQL的完整旅程 - 教程

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

测试环境elasticSearch数据泄露排查

测试环境elasticSearch数据泄露排查测试环境elasticSearch数据泄露排查 es中同一条会员 或者车辆或者交易 主要刷新一次 就会有一条被删除的文档所以几万测试数据 检查那边看到了几百万被删除是记录 以为几百万数据泄露…

深入解析:Spring boot中 限制 Mybatis SQL日志的大字段输出

深入解析:Spring boot中 限制 Mybatis SQL日志的大字段输出pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Conso…

郑州网站建设代运营制作网页动画的软件

这几天开始做毕业设计了&#xff0c;MPEG2解码的MIPS实现&#xff0c;代码啥的网上一大堆&#xff0c;最大的困难也许不是理解代码&#xff0c;而是搭建环境&#xff0c;也就是搭建mips-linux-gcc交叉编译的环境。网上铺天盖地的都是arm-linux-gcc工具链的教程&#xff0c;唯独…

网站制作网络推广方案佛山做外贸网站平台

本文我们将分享数学启蒙学什么&#xff1f;用几个字简单的归纳为集合、数、量、形、时间、空间。我们接下来会讲感知集合和分类&#xff0c;数概念&#xff0c;量的概念&#xff0c;形状包含平面图形和立体图形&#xff0c;空间方位和时间的初步概念。 家长们可以发现幼儿数学启…

【AI时代速通QT】第九节:揭秘Qt编译全流程-从.pro材料到可执行程序

【AI时代速通QT】第九节:揭秘Qt编译全流程-从.pro材料到可执行程序pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: &quo…

揭阳商城网站建设中国新闻社待遇

汇编怎么调用C函数 直接调用 BL main传参数 在arm中有个ATPCS规则&#xff08;ARM-THUMB procedure call standard&#xff09;&#xff08;ARM-Thumb过程调用标准&#xff09;。 约定r0-r15寄存器的用途&#xff1a; r0-r3&#xff1a;调用者和被调用者之间传递参数r4-r11…

网站建设理论依据网站建设布局结构

关于csgo/steam游戏搬砖项目的几大认知误区

考试心得5

2025/9/10 | 2025CSP-S模拟赛57 https://oj.gxyzh.com/d/hzoj/contest/68d921a11bde45b9248e2bb9/problems 国庆第一天训练。初三牲要死了。搬到机构里训练,效率几乎为零。 T1其实是简单题。但是考场上想了AB性质后就…

小型行业网站建设维护成本金泉网做网站电话

大型网络的拓扑结构一般会比较复杂&#xff0c;不同的部门&#xff0c;或者总部和分支可能处在不同的网络中&#xff0c;此时就需要使用路由器来连接不同的网络&#xff0c;实现网络之间的数据转发。 本章将介绍路由协议的基础知识、路由表的分类、静态路由基础与配置、VLAN间…

实用指南:Transformer模型:深度解析自然语言处理的革命性架构——从预训练范式到产业级实践

实用指南:Transformer模型:深度解析自然语言处理的革命性架构——从预训练范式到产业级实践pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !impo…