gocator导出图片

news2024/11/25 13:44:46

想用3D扫描后的图片,但是系统自带的导出方法很麻烦,所以考虑通过sdk导出

首先需要设置点云亮度

 

这里是导出图片的关键代码

 case GoDataMessageType.SurfaceIntensity:
     {
         Debug.WriteLine("SurfaceIntensity  ");
         GoSurfaceIntensityMsg surfaceMsg = (GoSurfaceIntensityMsg)dataObj;
         long width = surfaceMsg.Width;
         long length = surfaceMsg.Length;
         long bufferSize = width * length;
         IntPtr bufferPointeri = surfaceMsg.Data;

         //Console.WriteLine("Surface Intensity received:");
         //Console.WriteLine(" Buffer width: {0}", width);
         //Console.WriteLine(" Buffer length: {0}", length);
         byte[] ranges = new byte[bufferSize];

         Marshal.Copy(bufferPointeri, ranges, 0, ranges.Length);

 

         Mat mat1 = new Mat((int)length, (int)width, MatType.CV_8UC1, bufferPointeri);

         //Mat mat = Cv2.ImDecode(ranges, ImreadModes.Grayscale);

         long UID = YitIdHelper.NextId();
         string GlueImageDir = LogsUtil.GetLogDir(LogsUtil.GlueImage);
         ImageFile = await FileHelper.SaveVisionImage1(mat1, GlueImageDir, $"Glue3Dimage_{gm.TireBarcode}_{UID}.png");

 
     }
     break;

using Camera3D.Models.Glue;
using Camera3D.Utils;
using FluentFTP;
using Google.Protobuf.WellKnownTypes;
using JHCamera3D.Helper.Python;
using JHCamera3D.Utils;

//using Intel.RealSense;
using LinkAsiaSmart.MyTask;
using Lmi3d.GoSdk;
using Lmi3d.GoSdk.Messages;
using OpenCvSharp;
using System.Collections;
using System.Drawing.Imaging;
using System.Threading;
using System.Windows.Forms;
using Yitter.IdGenerator;
using static Camera3D.Enum.LMI.ReceiveProfile;
using static Emgu.CV.WeChatQRCode;
using static Slapper.AutoMapper;

namespace Camera3D.Helper.TCP
{
    /// <summary>
    /// 
    /// </summary>
    public class Camera3DGlue
    {
        public delegate void OnDataType(KObject data);

        public static Camera3DGlue? Instance;

        public static bool isSaveDataToMySql = true;
        public static bool isGoLoad = false;
        public static bool isStart = false;
        public static bool isCanStatus = false;
        private static double TireInsideLength = 0;
        private static double EncoderResolution = 0;

        GoDataSet dataSet;
        static GoSystem system;
        static GoSensor sensor;
        static GoSurfaceGeneration surfacelength;

        public static Camera3DGlue GetInstance()
        {
            if (Instance == null)
            {
                Instance = new Camera3DGlue();
            }
            return Instance;
        }

        public bool GoLoad()//加载Gocator
        {
            string ip = SystemParams.Camera3D.LMI3DGlueCameraIP;                         // "192.168.1.10";
            uint SensorID = uint.Parse(SystemParams.Camera3D.LMI3DGlueCameraSensorID);   // "192.168.1.10";
            KApiLib.Construct();
            GoSdkLib.Construct();

            system = new GoSystem();
            dataSet = new GoDataSet();
            try
            {
                sensor = system.FindSensorById(SensorID);//指定传感器的ID连接 
                if (sensor.State == GoState.Running)
                {
                    sensor.Stop();
                    sensor.Disconnect();
                };
                sensor.Connect();

                //double encoder = sensor.Transform.EncoderResolution;
                EncoderResolution = sensor.Transform.EncoderResolution;
                TireInsideLength = sensor.Setup.GetSurfaceGeneration().FixedLengthLength;

                system.EnableData(true);//数据通道使能
                system.SetDataHandler(onData);//异步接受数据

                isGoLoad = true;
            }
            catch (Exception ex)
            {
                return false;
            }

            return true;
        }

        public static void Start()
        {
            try
            {
                if (sensor == null)
                {
                    return;
                }

                sensor.Stop();

                surfacelength = sensor.Setup.GetSurfaceGeneration();    

                sensor.Start();

                isStart = true;

                isCanStatus = true;
            }
            catch (Exception ex)
            {
                Log.Logger.Error($" 异常 {ex.Message}");
            }
        }

        public static void Stop()
        {
            try
            {
                sensor.Stop();

                isCanStatus = false;
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"Sensor Stop 异常 {ex.Message}");
            }
        }
        public static GoState GetStatus()
        {
            GoState state = GoState.Offline;// new GoState();
                                            //  state = GoState.Offline;
            if (isCanStatus)
            {
                try
                {
                    state = sensor.State.Value;
                }
                catch (Exception ex)
                {
                    Log.Logger.Error($"  异常 {ex.Message}");
                }
            }
   
            return state;
        }


        public static async void onData(KObject data)
        {
            int mb = 1024 * 1024;
            Process currentProcess = Process.GetCurrentProcess();
            long workingSet = currentProcess.WorkingSet64;
            Log.Logger.Debug($" 占用内存{workingSet / mb}MB");

            Random rdm = new Random(Guid.NewGuid().GetHashCode());

            GlueModel gm = new GlueModel();
            gm.DateTime = DateUtil.CurrentDate.ToString();
            gm.TireBarcode = PLCTag.GetTagValue(TagNameDesc.GlueTireBarcode, TagValueType.String);  // Work.PLC.Glue.GetGlueTireBarcode();

            string PLYName = $"Glue_{gm.TireBarcode}_{YitIdHelper.NextId()}";
            string ImageFile = "";
            GlueCompensationModel gcm = new GlueCompensationModel();

            float GlueTireInnerCircumference = float.Parse(PLCTag.GetTagValue(TagNameDesc.GlueTireInnerCircumference, TagValueType.Float));   // Work.PLC.TagValue.GetGlueTireInnerCircumference();
 

            Log.Logger.Debug($"接受到 3D  数据  ");
            try
            {
                DataContext context = new DataContext(); 
                GoDataSet dataSet = (GoDataSet)data;

                for (UInt32 i = 0; i < dataSet.Count; i++)
                {
                    GoDataMsg dataObj = (GoDataMsg)dataSet.Get(i);

                    // Debug.WriteLine($"GoDataMsg.MessageType:{dataObj.MessageType}");
                    Log.Logger.Debug($" GoDataMsg.MessageType : {dataObj.MessageType}  ");
                    switch (dataObj.MessageType)
                    {
                        case GoDataMessageType.Stamp:
                            {
                                GoStampMsg stampMsg = (GoStampMsg)dataObj;
                                for (UInt32 j = 0; j < stampMsg.Count; j++)
                                {
                                    GoStamp stamp = stampMsg.Get(j);
                                    //Debug.WriteLine("Frame Index = {0}", stamp.FrameIndex);
                                    //Debug.WriteLine("Time Stamp = {0}", stamp.Timestamp);
                                    //Debug.WriteLine("Encoder Value = {0}", stamp.Encoder);
                                    // Debug.WriteLine($"{i} -{j}  Index = {stamp.FrameIndex} time =  {stamp.Timestamp} value = {stamp.Encoder}");
                                    //Debug.WriteLine($"  {stampMsg.Count}  ");
                                    // LsData.Add(stamp.Encoder.ToString());
                                }
                                //
                            }
                            break;

                        case GoDataMessageType.UniformSurface:
                            {
                                try
                                {
                                    GoUniformSurfaceMsg surfaceMsg = (GoUniformSurfaceMsg)dataObj;
                                    long width = surfaceMsg.Width; //被测物体宽度
                                    long length = surfaceMsg.Length; //3D相机走过的长度
                                    long bufferSize = (width * length);
                                    IntPtr bufferPointer = surfaceMsg.Data;

                                    //获取缓存的宽高
                                    long surfaceBufferWidth = surfaceMsg.Width;
                                    long surfaceBufferLength = surfaceMsg.Length;
                                    float[] x = new float[surfaceBufferLength * surfaceBufferWidth];
                                    float[] y = new float[surfaceBufferLength * surfaceBufferWidth];
                                    float[] z = new float[surfaceBufferLength * surfaceBufferWidth];
                                    // byte[] intensity = new byte[surfaceBufferLength * surfaceBufferWidth];

                                    SurfacePoint[] surfaceBuffer = new SurfacePoint[surfaceBufferLength * surfaceBufferWidth];
                                    List<SurfacePoint> ListSurface = new List<SurfacePoint>();

                                    short[] ranges = new short[bufferSize];
                                    Marshal.Copy(bufferPointer, ranges, 0, ranges.Length);

                                    // Marshal.Copy(bufferPointer, intensity, 0, ranges.Length);

                                    //string rangesStr = string.Join(",", ranges);
                                    Log.Logger.Debug($"Surface Width = {width} length = {length} bufferSize = {bufferSize} ");

                                    double xResolution = (double)surfaceMsg.XResolution / 1000000;
                                    double yResolution = (double)surfaceMsg.YResolution / 1000000;
                                    double zResolution = (double)surfaceMsg.ZResolution / 1000000;

                                   // YDotPitch = yResolution;

                                    context.xResolution = (float)surfaceMsg.XResolution / 1000000;
                                    context.yResolution = (float)surfaceMsg.YResolution / 1000000;
                                    context.zResolution = (float)surfaceMsg.ZResolution / 1000000;
                                    context.xOffset = (float)surfaceMsg.XOffset / 1000;
                                    context.yOffset = (float)surfaceMsg.YOffset / 1000;
                                    context.zOffset = (float)surfaceMsg.ZOffset / 1000;
                                    long surfacePointCount = surfaceMsg.Width * surfaceMsg.Length;

                                    for (int j = 0; j < length; j++)
                                    {
                                        for (int k = 0; k < width; k++)
                                        {
                                            y[width * j + k] = (float)(k * context.xResolution + context.xOffset);
                                            x[width * j + k] = (float)(j * context.yResolution + context.yOffset);
                                            short tmp = ranges[width * j + k];
                                            z[width * j + k] = tmp == -32768 ? -32768 : (float)(tmp * context.zResolution + context.zOffset);

                                            //  intensity[width * j + k]= context.
                                            //if (tmp == -32768)
                                            //{
                                            //    z[width * j + k] = -32768;
                                            //}
                                            //else
                                            //{
                                            //    z[width * j + k] = (float)(tmp * context.zResolution + context.zOffset);
                                            //}

                                            surfaceBuffer[width * j + k].x = x[width * j + k];
                                            surfaceBuffer[width * j + k].y = y[width * j + k];
                                            surfaceBuffer[width * j + k].z = z[width * j + k];
                                        }
                                    }

                                    //Mat mat = Cv2.ImDecode(intensity, ImreadModes.Color);

                                    //long UID = YitIdHelper.NextId();
                                    //FileHelper.SaveVisionImage1(mat, $"Glue3Dimage_{UID}.png");

                                    Log.Logger.Debug($"接收到相机点云数量 = {surfacePointCount} ");
                                    ListSurface = surfaceBuffer.Where(a => a.z >= -10000).ToList();
                                    //PointCloudUtil.SavePointCloudToPLY(No, x, y, z);
                                    string PLYFile = await PointCloudUtil.SavePointCloudToPLY(PLYName, ListSurface.ToArray(), LogsUtil.GluePLY);
                                    //PointCloudUtil.SavePointCloudToPLY(No, x, y, z);
                                    DateTime startTime = DateTime.Now;
                                    while (!File.Exists(PLYFile))
                                    {
                                        if (DateTime.Now - startTime > TimeSpan.FromSeconds(10))
                                        {
                                            break;
                                        }
                                        await Task.Delay(200);
                                    }
                                    if (File.Exists(PLYFile))
                                    {
                                        ProcessPLYGlueStrip(PLYFile, gcm);
                                    }
                                    else
                                    {
                                        Log.Logger.Error($" 未找到ply文件 {PLYFile}");
                                    }

                                    x = null;
                                    y = null;
                                    z = null;
                                    ranges = null;
                                    surfaceBuffer = null;
                                    ListSurface.Clear();
                                    ListSurface = null;
                                    bufferPointer = IntPtr.Zero;
                                }
                                catch (Exception e)
                                {
                                    Log.Logger.Error($" GoDataMessageType.Surface 数据处理异常 = {e.Message} {e.StackTrace} ");
                                }
                            }
                            break;


                        case GoDataMessageType.SurfacePointCloud:
                            {
                                GoSurfacePointCloudMsg surfaceMsg = (GoSurfacePointCloudMsg)dataObj;
                                context.xResolution = (double)surfaceMsg.XResolution / 1000000;
                                context.yResolution = (double)surfaceMsg.YResolution / 1000000;
                                context.zResolution = (double)surfaceMsg.ZResolution / 1000000;
                                context.xOffset = (double)surfaceMsg.XOffset / 1000;
                                context.yOffset = (double)surfaceMsg.YOffset / 1000;
                                context.zOffset = (double)surfaceMsg.ZOffset / 1000;
                                long surfacePointCount = surfaceMsg.Width * surfaceMsg.Length;
                                Console.WriteLine("Surface Point Cloud received:");
                                Console.WriteLine(" Buffer width: {0}", surfaceMsg.Width);
                                Console.WriteLine(" Buffer length: {0}", surfaceMsg.Length);
                                GoPoints[] points = new GoPoints[surfacePointCount];
                                SurfacePoint[] surfaceBuffer = new SurfacePoint[surfacePointCount];
                                int structSize = Marshal.SizeOf(typeof(GoPoints));
                                IntPtr pointsPtr = surfaceMsg.Data;
                                for (UInt32 array = 0; array < surfacePointCount; ++array)
                                {
                                    IntPtr incPtr = new IntPtr(pointsPtr.ToInt64() + array * structSize);
                                    points[array] = (GoPoints)Marshal.PtrToStructure(incPtr, typeof(GoPoints));
                                }
                                for (UInt32 arrayIndex = 0; arrayIndex < surfacePointCount; ++arrayIndex)
                                {
                                    if (points[arrayIndex].x != -32768)
                                    {
                                        surfaceBuffer[arrayIndex].x = context.xOffset + context.xResolution * points[arrayIndex].x;
                                        surfaceBuffer[arrayIndex].y = context.yOffset + context.yResolution * points[arrayIndex].y;
                                        surfaceBuffer[arrayIndex].z = context.zOffset + context.zResolution * points[arrayIndex].z;
                                    }
                                    else
                                    {
                                        surfaceBuffer[arrayIndex].x = -32768;
                                        surfaceBuffer[arrayIndex].y = -32768;
                                        surfaceBuffer[arrayIndex].z = -32768;
                                    }
                                }
                            }
                            break;

                        case GoDataMessageType.SurfaceIntensity:
                            {
                                Debug.WriteLine("SurfaceIntensity  ");
                                GoSurfaceIntensityMsg surfaceMsg = (GoSurfaceIntensityMsg)dataObj;
                                long width = surfaceMsg.Width;
                                long length = surfaceMsg.Length;
                                long bufferSize = width * length;
                                IntPtr bufferPointeri = surfaceMsg.Data;

                                //Console.WriteLine("Surface Intensity received:");
                                //Console.WriteLine(" Buffer width: {0}", width);
                                //Console.WriteLine(" Buffer length: {0}", length);
                                byte[] ranges = new byte[bufferSize];

                                Marshal.Copy(bufferPointeri, ranges, 0, ranges.Length);

   

                                Mat mat1 = new Mat((int)length, (int)width, MatType.CV_8UC1, bufferPointeri);

                                //Mat mat = Cv2.ImDecode(ranges, ImreadModes.Grayscale);

                                long UID = YitIdHelper.NextId();
                                string GlueImageDir = LogsUtil.GetLogDir(LogsUtil.GlueImage);
                                ImageFile = await FileHelper.SaveVisionImage1(mat1, GlueImageDir, $"Glue3Dimage_{gm.TireBarcode}_{UID}.png");
 
                            }
                            break;
                    }
                } 

                Log.Logger.Debug($"完成3D相机的数据"); 
 
                Download3DImage(ImageFile);
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"Camera3D  Error {ex.Message}");
            }

            GlobalConst.Common.SharedLock = false;

            workingSet = currentProcess.WorkingSet64;
            Log.Logger.Debug($"接收3D相机数据后 占用内存{workingSet / mb}MB");
        }

        public float GetLength()
        {
            return (float)TireInsideLength;
        }

        public string SetLength(double length)
        {
            string result = "";
            try
            {
                Stop();
                surfacelength = sensor.Setup.GetSurfaceGeneration();
                //surfacelength.FixedLengthTriggerExternalInputIndex = length;
                surfacelength.FixedLengthLength = length;

                Log.Logger.Debug($"设置 3D相机触发轮胎内周长 PLC = [{length}] OK");
                Start();
                result = "OK";
                TireInsideLength = length;
            }
            catch (Exception ex)
            {
                result = "ERROR";
                Log.Logger.Error($"设置 3D相机触发长度异常 {ex.Message}");
            }
            return result;
        }

        public string SetEncoderResolution(double value)
        {
            string result = "";
            if (value <= 0)
            {
                return result;
            }
            try
            {
                Stop();
                // sensor.Setup.EncoderSpacing = value;
                sensor.Transform.EncoderResolution = value;
                Log.Logger.Debug($"设置 3D相机分辨率OK {value}");
                Start();
                result = "OK";
            }
            catch (Exception ex)
            {
                result = "ERROR";
                Log.Logger.Error($"设置 3D相机分辨率异常 value={value} msg={ex.Message}");
            }
            return result;
        }

        public string GetEncoder()
        {
            string result = "";
            try
            {
                if (isCanStatus)
                {
                    if (sensor.State.Value == GoState.Running)
                    {
                        result = sensor.Encoder().ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"读取 3D相机编码器数值异常 value = {result} {sensor.State} msg = {ex.Message}");
            }
            return result;
        } 

        public static string Download3DImage(string ImageFile)
        {
            string result = "";
            Task.Run(async () =>
            { 
                try
                {
 

                    EncoderResolution = sensor.Transform.EncoderResolution;
                    TireInsideLength = sensor.Setup.GetSurfaceGeneration().FixedLengthLength;
 
                    result = "OK";


                    string JPGImageFile = await ConvertToJPG(ImageFile);

                    SignalRClient.GetInstance().SendMsg(GlobalConst.SignalRUser.Glue.Camera3DGlueImage, JPGImageFile); 
                }
                catch (Exception ex)
                {
                    Log.Logger.Error($" 3D相机 图片出现异常 {ex.Message}");
                    result = "Error";
                }
            });
            return result;
        }

        public static async Task<string> ConvertToJPG(string ImageFile)
        {
            DateTime startTime = DateTime.Now;
            while (!File.Exists(ImageFile))
            {
                if (DateTime.Now - startTime > TimeSpan.FromSeconds(10))
                {
                    break;
                }
                await Task.Delay(200);
            }
            Log.Logger.Debug($"PNG转JPG文件 [{ImageFile}]");
            string extension = Path.GetExtension(ImageFile);
            Log.Logger.Debug($"PNG转JPG文件 [{extension}]");
            string JpgImageFile = ImageFile.Replace(extension, ".jpg");
            //string result = "";
            //int x = 0;
            await Task.Run(async () =>
            {
                try
                {
                    using (Image image = Image.FromFile(ImageFile))
                    {
                        image.Save(JpgImageFile, ImageFormat.Jpeg);
                    }
                }
                catch (Exception ex)
                {
                    Log.Logger.Error($"PNG转JPG异常 {ex.Message}");
                    // result = "Error";
                }
            });
            return JpgImageFile;
        }

 

        public static async Task<string> ProcessPLYGlueStrip(string PLYFile, GlueCompensationModel gcm)
        {
            string result = "";
            string No = "Glue" + DateUtil.CurrentDateID;
            string ScriptFile = AppSettingsHelper.Configuration["PythonScript:GlueScriptFile"];
            Log.Logger.Debug($" Open3D 测量  脚本 {ScriptFile}");
            string PlyResultDir = LogsUtil.GetLogDir(LogsUtil.GlueResultPLY);
            string str = RunPythonHelper.ExecPythonTireGlue(ScriptFile, PLYFile, PlyResultDir);
            Log.Logger.Debug($" Open3D 计算结果 {str}");

            string[] JsonStrResult = str.Split("~~");
            try
            {
                if (JsonStrResult[2].Trim().Length > 1)
                {
                    Log.Logger.Error($" errMsg = {JsonStrResult[2]}");
        
                }
                else
                {
                    GluePlyResultModel gprm = JsonConvert.DeserializeObject<GluePlyResultModel>(JsonStrResult[1]);
                    gprm.Barcode = PLCTag.GetTagValue(TagNameDesc.GlueTireBarcode, TagValueType.String); 
                    gprm.DateTime = DateUtil.CurrentDate.ToString();

                    gprm = GetCompensationResult(gprm, gcm);
                    string jsonStr = JsonConvert.SerializeObject(gprm);

                    SignalRClient.GetInstance().SendMsg(GlobalConst.SignalRUser.Glue.Glue3DResult, jsonStr);
           

   
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"处理 Open3D 计算结果异常 {ex.Message}");
              
            } 

            return result;
        }
 


    }
}

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

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

相关文章

C++ 中的 lambda 表达式

1.概念 lambda表达式实际上是一个匿名类的成员函数&#xff0c;该类由编译器为lambda创建&#xff0c;该函数被隐式地定义为内联。因此&#xff0c;调用lambda表达式相当于直接调用匿名类的operator()函数&#xff0c;这个函数可以被编译器内联优化&#xff08;建议&#xff0…

BGP第二篇(bgp邻居状态及影响邻居建立的因素)

1、bgp邻居状态 BGP对等体的交互过程中存在6种状态机&#xff1a; 空闲&#xff08;Idle&#xff09; 连接&#xff08;Connect&#xff09; 活跃 &#xff08;Active&#xff09; Open报文已发送&#xff08;OpenSent&#xff09; Open报文已确认&#xff08;OpenConfirm&…

Redis 源码安装和入门介绍

Linux下的redis源码安装 redis介绍 Redis 是一个开源&#xff08;BSD许可&#xff09;的&#xff0c;内存中的数据结构存储系统&#xff0c;它可以用作数据库、缓存和消息中间件。它支持多种类型的数据结构&#xff0c;如 字符串&#xff08;strings&#xff09;&#xff0c;…

医疗图像处理2023年CVPR:Label-Free Liver Tumor Segmentation-无标签肝肿瘤分割

目录 一、摘要 二、介绍 三、相关工作 四、网络框架 1.位置选择 2.纹理处理 3.形状生成 4.后处理 5.参数设计 五、实验 1.数据集&#xff1a; 2.评价指标&#xff1a; 3.实现&#xff1a; 4.结果&#xff1a; 六、结论 一、摘要 通过在CT扫描中使用合成肿瘤&am…

秋招算法刷题10(栈和队列)

0509 232.用栈实现队列 class MyQueue {Deque<Integer> inStack;Deque<Integer> outStack;public MyQueue() {inStack new ArrayDeque<Integer>();outStack new ArrayDeque<Integer>();}public void push(int x) {inStack.push(x);}public int pop…

【计算机网络】计算机网络概述、计算机网络性能指标 习题1

0 1. 计算机网络可被理解为( )。 A.执行计算机数据处理的软件模块 B. 由自治的计算机互连起来的集合体 C.多个处理器通过共享内存实现的紧耦合系统 D. 用于共同完成一项任务的分布式系统 0 2.计算机网络最基本的功能是( )。 A.数据通信 B. 资源共享 C. 分布式处理 D. 信息综合…

关于一致性,你该知道的事儿(上)

关于一致性&#xff0c;你该知道的事儿&#xff08;上&#xff09; 前言一、缓存一致性二、内存模型一致性三、事务一致性四、分布式事务一致性4.1 分布式系统的一些挑战4.2 关于副本的一些概念4.3 分布式事务之共识问题4. 3.1 PC(two-phase commit, 2PC)4.3.2 Raft 三、后记参…

[240512] x-cmd 发布 v0.3.6: (se,wkp,ddgo...)x( kimi,gemini,gpt...)

目录 x-cmd 发布 v0.3.6新增了 jina 模块新增了 ddgo 模块新增了 se 模块wkp 模块新增了 writer 模块cosmo 模块 x-cmd 发布 v0.3.6 本次版本的最新引入的功能都是目的为了进一步探索 LLM 的使用。 本版本的改进分为两类&#xff1a;资讯类模块&#xff08;Wikipedia&#xf…

现代制造之Solidworks三维建模篇

现代制造 有现代技术支撑的制造业&#xff0c;即无论是制造还是服务行业&#xff0c;添了现代两个字不过是因为有了现代科学技术的支撑&#xff0c;如发达的通信方式&#xff0c;不断发展的互联网&#xff0c;信息化程度加强了&#xff0c;因此可以为这两个行业增加了不少优势…

【matlab基础知识代码】(十八)无约束最优化问题

min下面的x称为优化向量或者是决策变量 匿名函数法 >> f(x)(x(1)^2-2*x(1))*exp(-x(1)^2-x(2)^2-x(1)*x(2)); x0[0; 0]; [x,b,c,d]fminsearch(f,x0), x 0.6111 -0.3056 b -0.6414 c 1 d 包含以下字段的 struct: iterations: 72 funcCount: 137 algor…

【JavaEE 初阶(五)】文件操作和IO

❣博主主页: 33的博客❣ ▶️文章专栏分类:JavaEE◀️ &#x1f69a;我的代码仓库: 33的代码仓库&#x1f69a; &#x1faf5;&#x1faf5;&#x1faf5;关注我带你了解更多文件操作 目录 1.前言2.认识文件3.文件操作3.1File 属性3.2构造方法3.3File类方法 4.文件内容操作4.1R…

python内置类memoryview()详解

memoryview() Python 的一个内置class&#xff0c;可直接使用。它返回给定参数的“内存视图”对象。内存视图对象是一个对支持缓冲区协议&#xff08;如 bytes 或 bytearray&#xff09;的数据的“窗口”或“视图”&#xff0c;它允许你在不复制数据的情况下操作内存中的数据。…

【机器学习】 技术栈和开发环境搭建

各位大佬好 &#xff0c;这里是阿川的博客 &#xff0c; 祝您变得更强 个人主页&#xff1a;在线OJ的阿川 大佬的支持和鼓励&#xff0c;将是我成长路上最大的动力 阿川水平有限&#xff0c;如有错误&#xff0c;欢迎大佬指正 博客目录 技术栈编程语言库框架编辑器项目IDE …

数据分析需要注意哪些法律法规

数据分析 前言一、数据处理过程二、数据收集阶段的法律规则数据收集应具备合法、正当、透明原则数据收集应坚持最小必要原则数据收集应遵守知情-同意规则数据收集应遵守目的明确性要求 三、数据储存的法律规则四、数据使用与处理的阶段的法律规则数据安全保护义务按照数据分级分…

Linux:文件IO

Linux&#xff1a;文件IO C语言 文件IOfopen Linux 文件IOopen接口close接口write接口read接口 内存文件管理struct filestruct files_struct文件描述符 fd 缓冲区 C语言 文件IO 在正式讲解Linux中是如何对文件进行IO前&#xff0c;我们先简单回顾以下C语言中&#xff0c;是如…

【牛客】SQL206 获取每个部门中当前员工薪水最高的相关信息

1、描述 有一个员工表dept_emp简况如下&#xff1a; 有一个薪水表salaries简况如下&#xff1a; 获取每个部门中当前员工薪水最高的相关信息&#xff0c;给出dept_no, emp_no以及其对应的salary&#xff0c;按照部门编号dept_no升序排列&#xff0c;以上例子输出如下: 2、题目…

项目1:STM32+DHT11+FreeRTOS+emwin+LCD

第一部分&#xff01;&#xff01;&#xff01;&#xff01;&#xff01;&#xff01;&#xff01;************ 【屏幕显示DHT11数据】 面向对象的思想编写硬件驱动程序&#xff0c;DHT11采集环境中的温湿度数据。使用FreeRTOS提供的任务间通信、同步、互斥&#xff0c;将DHT…

【Linux】AlmaLinux 9.4版本发布

AlmaLinux 9.4 正式版发布&#xff0c;该版本基于 Redhat Enterprise 9.4&#xff0c;内核版本号&#xff1a; 5.14.0-427.13.1.el9_4.x86_64 相对于Rocky Linux&#xff0c; AlmaLinux更加的稳定&#xff0c;生产环境建议使用AlmaLinux来替代CentOS 7.x AlmaLinux 9.4版本系统…

MIPI DPHY HS传输模式SoT和EoT的传输值

目录 1. 高速传输模式的传输序列 2. SoT传输序列 3. EoT传输序列 1. 高速传输模式的传输序列 Mipi DPHY的高速数据传输&#xff08;HST&#xff1a;High Speed Transmission&#xff09;以突发&#xff08;Burst&#xff09;方式发生。 为了帮助接收机同步&#xff1a; (1) …

Python-VBA函数之旅-str函数

目录 一、str函数的常见应用场景 二、str函数使用注意事项 三、如何用好str函数&#xff1f; 1、str函数&#xff1a; 1-1、Python&#xff1a; 1-2、VBA&#xff1a; 2、推荐阅读&#xff1a; 个人主页&#xff1a; https://myelsa1024.blog.csdn.net/ 一、str函数的常…