C# + halcon 联合编程示例

C# + halcon 联合编程示例

实现功能

        1.加载图像

        2.画直线,画圆,画矩形, 画椭圆 ROI,可以调整大小和位置

        3.实现找边,找圆功能

效果

开发环境

        Visual Studio 2022

        .NET Framework 4.8

        halcondotnet.dll

查看帮助文档

项目结构

DLL引用

        要注意是 HALCON-17.12\dotnet35\halcondotnet.dll

界面控件

        用System.Windows.Forms.Panel 控件来显示 图片

        其他主要是按钮

代码

using HalconDotNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;

namespace CJH.Halcon.WinForms.App
{
    public partial class Form1 : Form
    {
        private HSmartWindowControl hwControl;
        private HWindow hw;
        private HImage ho_Image;
        private List<HDrawingObjectEx> drawObjs = new List<HDrawingObjectEx>();

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //创建Halcon控件对象,并添加到指定的容器中
            hwControl = new HSmartWindowControl();
            //var hwControlWpf = new HSmartWindowControlWPF();
            hwControl.MouseWheel += HwControl_MouseWheel;
            //通过Halcon控件获取对应Halcon窗口对象
            hw = hwControl.HalconWindow;
            //设置控件的填充方式
            hwControl.Dock = DockStyle.Fill;
            //把控件添加到显示区
            hw_container.Controls.Add(hwControl);
        }

        /// <summary>
        /// 鼠标滚轮移动时发生事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HwControl_MouseWheel(object sender, MouseEventArgs e)
        {
            hwControl.HSmartWindowControl_MouseWheel(sender, e);
        }

        /// <summary>
        /// 加载图像
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoadImage_Click(object sender, EventArgs e)
        {
            var fileDialog = new OpenFileDialog();
            fileDialog.Title = "打开图像资源";
            fileDialog.Filter = "图像资源|*.png;*.jpg;*.bmp";
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                var filePath = fileDialog.FileName;
                //创建halcon 图像对象
                ho_Image = new HImage(filePath);
                //把图像对象显示到Halcon窗口中
                hw.DispObj(ho_Image);
                //设置打开图像自动适应窗口的大小
                hwControl.SetFullImagePart();
            }
        }

        /// <summary>
        /// 画直线
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLine_Click(object sender, EventArgs e)
        {
            //drawObjs.Clear();
            //定义绘制线的开始和结束坐标   起点XY- 终点XY
            var lineTuple = new HTuple[] { 100, 300, 100, 100 };
            //创建线的对象
            var lineObj = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.LINE, lineTuple);
            //注册线拖拽事件
            lineObj.OnDrag(LineOnDragAction);
            lineObj.OnResize(LineonResizeAction);
            //保存线对象
            drawObjs.Add(new HDrawingObjectEx()
            {
                HObj = lineObj,
                HTuples = lineTuple
            });
            //把画出线放到Halcon窗口上面
            hw.AttachDrawingObjectToWindow(lineObj);
        }

        /// <summary>
        /// 拖拽(移动)
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void LineOnDragAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectData(drawid);
        }

        /// <summary>
        /// 改变大小,长度
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void LineonResizeAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectData(drawid);
        }

        /// <summary>
        /// 更新线拖拽或改变大小的方法
        /// </summary>
        /// <param name="drawid"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void UpdateDrawingObjectData(HDrawingObject drawid)
        {
            //创建需要对象的属性元组
            var attrTuple = new HTuple("row1", "column1", "row2", "column2");
            //根据提供元组获取对应的属性值组元组
            var valueTuple = drawid.GetDrawingObjectParams(attrTuple);

            Debug.WriteLine($"row1:{valueTuple[0].D},column1:{valueTuple[1].D},row2:{valueTuple[2].D},column2:{valueTuple[3].D}");
            //构建一个数组值组成的元组数组
            var attrValues = new HTuple[] { valueTuple[0], valueTuple[1], valueTuple[2], valueTuple[3] };
            //更新当前拖拽对像的属性数据
            drawObjs[0].HTuples = attrValues;
        }

        /// <summary>
        /// 直线抓边
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLineBound_Click(object sender, EventArgs e)
        {
            //获取刚刚绘制直线对象的数据
            var lineTuple = drawObjs[0].HTuples;
            var hv_LineParam = new HTuple(lineTuple);

            //清理绘制的直线对象
            clearObject();

            //创建计算测量句柄
            HOperatorSet.CreateMetrologyModel(out HTuple hv_MetrologyHandle);

            //句柄关联测试的图坐标位置
            //设置测量对象图像的大小
            //参数:
            //    MeasureHandle:输入测量模型的句柄;
            //    Width:输出图像宽;
            //    Height:输出图像高;
            //HOperatorSet.SetMetrologyModelImageSize(hv_MetrologyHandle, hv_Width, hv_Height);

            //添加测量模型对象(此处是线)
            //将测量对象添加到测量模型中
            //算子参数:
            //    MeasureHandle:输入测量模型的句柄;
            //    Shape:输入要测量对象的类型;默认值:‘circle’,参考值:‘circle’圆,‘ellipse’椭圆,‘line’线,‘rectangle2’矩形,长方形;
            //    ShapeParam:要添加的测量对象的参数。
            //    MeasureLength1:输入垂直于边界的测量区域的一半长度(卡尺长度);默认值:20,参考值:10,20,30;最小增量:1.0;建议增量:10.0
            //    MeasureLength2:输入与边界相切的测量区域的一半长度(卡尺宽度);默认值:5,参考值:3,5,10;最小增量:1.0;建议增量:10.0
            //    MeasureSigma:输入用于平滑的高斯函数的sigma;默认值:1,参考值:0.4,0.6,0.8,1.0,1.5,2.0,3.0,4.0,5.0,7.0,10.0;最小增量:0.01;建议增量:0.1;限制:(0.4 <= MeasureSigma)&&(MeasureSigma <= 100)
            //    MeasureThreshold:输入测量阈值/最小边缘幅度;默认值:30,参考值:5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0;最小增量:0.5;建议增量:2;
            //    GenParamName:输入参数名称;参考: ‘distance_threshold’, ‘end_phi’, ‘instances_outside_measure_regions’, ‘max_num_iterations’, ‘measure_distance’, ‘measure_interpolation’, ‘measure_select’, ‘measure_transition’, ‘min_score’, ‘num_instances’, ‘num_measures’, ‘point_order’, ‘rand_seed’, ‘start_phi’;
            //    GenParamValue:输入参数值;参考:1, 2, 3, 4, 5, 10, 20, ‘all’, ‘true’, ‘false’, ‘first’, ‘last’, ‘positive’, ‘negative’, ‘uniform’, ‘nearest_neighbor’, ‘bilinear’, ‘bicubic’;
            //    Index:输出创建测量对象的索引值;
            HOperatorSet.AddMetrologyObjectGeneric(hv_MetrologyHandle, "line", hv_LineParam,
                50, 5, 1, 30, new HTuple(), new HTuple(), out HTuple hv_Index);

            //为测量模型的测量对象设置参数 set_metrology_object_param
            //根据需求设置测量的参数
            //设置找线的方式(positive,negative,all)从黑到白,从白到黑
            //算子参数:
            //    MeasureHandle:输入测量模型的句柄;
            //    Index:指定测量对象,为all时所有计量对象的参数都被设置(‘all’);
            //    GenParamName:输入参数名称;默认:‘num_instances’,参考:
            //           'measure_length1':区域,垂直于边界的测量区域的一半长度
            //           'measure_length2':区域,相切于边界的测量区域的一半长度
            //           'measure_distance':区域,两个测量区域中心之间的距离
            //           'num_measures':区域,测量区域数
            //           'measure_sigma':测量,用于平滑的高斯函数的 Sigma
            //           'measure_threshold':测量,最小边缘幅度阈值
            //           'measure_select':测量,边缘端点的选择('last'、'first')
            //           'measure_transition':测量,方向('all'、'negative'、 'positive')
            //           'measure_interpolation':测量,插值类型
            //           'min_score':拟合,最小分数
            //           'num_instances':拟合,成功拟合实例的最大数量
            //           'distance_threshold':拟合,距离阈值

            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "measure_transition",
                "all");

            //预期测量的区域个数
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "num_instances",
                12);

            //拟合数
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "num_instances",
                6);

            //高斯平滑系数,值越大,唯一的边缘越清晰
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "measure_sigma",
                5);

            //区域,垂直与边界的测量区域的一半长度
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "measure_length1",
                80);

            //区域,相切于边缘的测量区域的一半长度
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "measure_length2",
                10);

            //最小边缘幅度越大,要求找到的边缘越锐利(灰度变换明显),反而不容易找到边缘
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "measure_threshold",
                20);

            //测量双立方插入值,区别与bilinear双线性
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "measure_interpolation",
                "bicubic");

            //取值 all,first,best,last
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "measure_select",
                "all");

            //设置最小分数0.7
            HOperatorSet.SetMetrologyObjectParam(hv_MetrologyHandle, "all", "min_score",
                0.7);

            //开始找边缘
            HOperatorSet.ApplyMetrologyModel(ho_Image, hv_MetrologyHandle);

            //获取测量区域找到的边缘坐标集合
            HOperatorSet.GetMetrologyObjectMeasures(out HObject ho_Contours, hv_MetrologyHandle,
                "all", "all", out HTuple hv_Row, out HTuple hv_Column);
            //设置卡尺颜色
            HOperatorSet.SetColor(hw, "cyan");
            //显示卡尺
            HOperatorSet.DispObj(ho_Contours, hw);

            //把找到的点通过十字叉来显示
            //HOperatorSet.GenCrossContourXld(out HObject ho_Cross, hv_Row, hv_Column, 6, 0.785398);
            //HOperatorSet.DispObj(ho_Cross, hw);
            //得到线的起点坐标并显示出来
            HOperatorSet.GetMetrologyObjectResult(hv_MetrologyHandle, 0, "all", "result_type",
                "all_param", out HTuple hv_Parameter);

            //获取计量模型的计量结果轮廓
            HOperatorSet.GetMetrologyObjectResultContour(out HObject ho_Contour, hv_MetrologyHandle,
                0, "all", 1.5);
            //设置轮廓颜色
            HOperatorSet.SetColor(hw, "green");
            HOperatorSet.SetLineWidth(hw, 3);
            //显示轮廓
            HOperatorSet.DispObj(ho_Contour, hw);
            //清除句柄
            HOperatorSet.ClearMetrologyModel(hv_MetrologyHandle);
        }

        /// <summary>
        /// 清理绘制的直线对象
        /// </summary>
        private void clearObject()
        {
            foreach (var item in drawObjs)
            {
                var hDrawingObject = item.HObj;
                //把这个对象从Halcon窗口中移除
                hw.DetachDrawingObjectFromWindow(hDrawingObject);
                hDrawingObject.Dispose();
            }
            drawObjs.Clear();
        }

        /// <summary>
        /// 找  圆
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFindCircle_Click(object sender, EventArgs e)
        {
            //获取圆形对象的位置与半径
            var circle = drawObjs[0].HTuples;

            //创建测量模型
            HOperatorSet.CreateMetrologyModel(out HTuple hv_MetrologyHandle);

            //添加找圆工具,给定参数,显示过程卡尺
            //50 卡尺长度
            //5 卡尺宽度
            HOperatorSet.AddMetrologyObjectCircleMeasure(hv_MetrologyHandle, circle[0].D, circle[1].D,
                circle[2].D, 50, 5, 1, 30, new HTuple(), new HTuple(), out HTuple hv_Index);

            HOperatorSet.GetMetrologyObjectModelContour(out HObject ho_Contour, hv_MetrologyHandle,
                0, 1.5);

            HOperatorSet.GetMetrologyObjectMeasures(out HObject ho_Contours, hv_MetrologyHandle,
                "all", "all", out HTuple hv_Row1, out HTuple hv_Column1);
            HOperatorSet.SetColor(hw, "cyan");
            HOperatorSet.DispObj(ho_Contour, hw);
            HOperatorSet.DispObj(ho_Contours, hw);
            //执行找圆并显示结果
            HOperatorSet.ApplyMetrologyModel(ho_Image, hv_MetrologyHandle);
            HOperatorSet.GetMetrologyObjectResult(hv_MetrologyHandle, 0, "all", "result_type",
                "all_param", out HTuple hv_Parameter);

            HOperatorSet.GetMetrologyObjectResultContour(out HObject ho_Contour1, hv_MetrologyHandle,
                0, "all", 1.5);
            HOperatorSet.SetLineWidth(hw, 2);
            HOperatorSet.SetColor(hw, "green");
            HOperatorSet.DispObj(ho_Contour1, hw);
            HOperatorSet.ClearMetrologyModel(hv_MetrologyHandle);
        }

        /// <summary>
        /// 拖拽(移动)
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void circOnDragAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectDataCirc(drawid);
        }

        /// <summary>
        /// 改变大小,长度
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void circResizeAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectDataCirc(drawid);
        }

        /// <summary>
        /// (圆)更新线拖拽或改变大小的方法
        /// </summary>
        /// <param name="drawid"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void UpdateDrawingObjectDataCirc(HDrawingObject drawid)
        {
            //创建需要对象的属性元组
            var attrTuple = new HTuple("row", "column", "radius");
            //根据提供元组获取对应的属性值组元组
            var valueTuple = drawid.GetDrawingObjectParams(attrTuple);

            Debug.WriteLine($"row:{valueTuple[0].D},column:{valueTuple[1].D},radius:{valueTuple[2].D}");
            //构建一个数组值组成的元组数组
            var attrValues = new HTuple[] { valueTuple[0], valueTuple[1], valueTuple[2] };
            //更新当前拖拽对像的属性数据
            drawObjs[0].HTuples = attrValues;
        }

        /// <summary>
        /// 画圆
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCircle_Click(object sender, EventArgs e)
        {
            var circleHtuple = new HTuple[] { 100, 100, 100 };
            var circleObj = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.CIRCLE, circleHtuple);
            //注册线拖拽事件
            circleObj.OnDrag(circOnDragAction);
            circleObj.OnResize(circResizeAction);
            //保存线对象
            drawObjs.Add(new HDrawingObjectEx()
            {
                HObj = circleObj,
                HTuples = circleHtuple
            });
            //把画出圆放到Halcon窗口上面
            hw.AttachDrawingObjectToWindow(circleObj);
        }

        /// <summary>
        /// 画矩形
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRectangle1_Click(object sender, EventArgs e)
        {
            var rectangle1Htuple = new HTuple[] { 100, 100, 200, 200 };
            //矩形
            var rectangle1Obj = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.RECTANGLE1, rectangle1Htuple);
            //注册线拖拽事件
            rectangle1Obj.OnDrag(rectangle1OnDragAction);
            rectangle1Obj.OnResize(rectangle1ResizeAction);
            //保存线对象
            drawObjs.Add(new HDrawingObjectEx()
            {
                HObj = rectangle1Obj,
                HTuples = rectangle1Htuple
            });
            //把画出圆放到Halcon窗口上面
            hw.AttachDrawingObjectToWindow(rectangle1Obj);
        }

        /// <summary>
        /// (矩形)拖拽(移动)
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void rectangle1OnDragAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectDataRectangle1(drawid);
        }

        /// <summary>
        /// (矩形)改变大小,长度
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void rectangle1ResizeAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectDataRectangle1(drawid);
        }

        /// <summary>
        /// (矩形)更新线拖拽或改变大小的方法
        /// </summary>
        /// <param name="drawid"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void UpdateDrawingObjectDataRectangle1(HDrawingObject drawid)
        {
            //创建需要对象的属性元组
            var attrTuple = new HTuple("row1", "column1", "row2", "column2");
            //根据提供元组获取对应的属性值组元组
            var valueTuple = drawid.GetDrawingObjectParams(attrTuple);

            Debug.WriteLine($"row1:{valueTuple[0].D},column1:{valueTuple[1].D},row2:{valueTuple[2].D},column2:{valueTuple[3].D}");
            //构建一个数组值组成的元组数组
            var attrValues = new HTuple[] { valueTuple[0], valueTuple[1], valueTuple[2], valueTuple[3] };
            //更新当前拖拽对像的属性数据
            drawObjs[0].HTuples = attrValues;
        }

        /// <summary>
        /// 画椭圆
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEllipse_Click(object sender, EventArgs e)
        {
            var ellipseHtuple = new HTuple[] { 100, 100, 50, 50, 50 };
            //椭圆
            var ellipseObj = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.ELLIPSE, ellipseHtuple);
            //注册线拖拽事件
            ellipseObj.OnDrag(ellipseOnDragAction);
            ellipseObj.OnResize(ellipseResizeAction);
            //保存线对象
            drawObjs.Add(new HDrawingObjectEx()
            {
                HObj = ellipseObj,
                HTuples = ellipseHtuple
            });
            //把画出圆放到Halcon窗口上面
            hw.AttachDrawingObjectToWindow(ellipseObj);
        }

        /// <summary>
        /// (椭圆)拖拽(移动)
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void ellipseOnDragAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectDataEllipse(drawid);
        }

        /// <summary>
        /// (椭圆)改变大小,长度
        /// </summary>
        /// <param name="drawid"></param>
        /// <param name="window"></param>
        /// <param name="type"></param>
        private void ellipseResizeAction(HDrawingObject drawid, HWindow window, string type)
        {
            UpdateDrawingObjectDataEllipse(drawid);
        }

        /// <summary>
        /// (椭圆)更新线拖拽或改变大小的方法
        /// </summary>
        /// <param name="drawid"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void UpdateDrawingObjectDataEllipse(HDrawingObject drawid)
        {
            //创建需要对象的属性元组
            //phi 以弧度表示的前半轴的方向
            //radius1 前半轴
            //radius2 后半轴
            var attrTuple = new HTuple("row", "column", "phi", "radius1", "radius2");
            //根据提供元组获取对应的属性值组元组
            var valueTuple = drawid.GetDrawingObjectParams(attrTuple);

            Debug.WriteLine($"row:{valueTuple[0].D},column:{valueTuple[1].D},phi:{valueTuple[2].D},radius1:{valueTuple[3].D},radius2:{valueTuple[4].D}");
            //构建一个数组值组成的元组数组
            var attrValues = new HTuple[] { valueTuple[0], valueTuple[1], valueTuple[2], valueTuple[3], valueTuple[4] };
            //更新当前拖拽对像的属性数据
            drawObjs[0].HTuples = attrValues;
        }
    }

    /// <summary>
    /// HDrawingObject 扩展类 ,主要包含拖拽对象和对象属性数据
    /// </summary>
    public class HDrawingObjectEx
    {
        public HDrawingObject HObj { get; set; }

        public HTuple[] HTuples { get; set; }
    }
}

项目源码下载地址

https://download.csdn.net/download/cjh16606260986/89497706

END

        

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

MT3056 交换序列

思路&#xff1a; 与题目 MT3055 交换排列 类似 代码&#xff1a; #include <bits/stdc.h> using namespace std; const int N 1e4 10; int n, fa[N], b[N], d[N]; void init(int n) {for (int i 1; i < n; i)fa[i] i; } int find(int x) {return x fa[x] ?…

在Visutal Studio 2022中完成D3D12初始化

在Visutal Studio 2022中完成DirectX设备初始化 1 DirectX121.1 DirectX 简介1.2 DirectX SDK安装2 D3D12初始化2.1 创建Windwos桌面项目2.2 修改符合模式2.3 下载d3dx12.h文件2.4 创建一个异常类D3DException,定义抛出异常实例的宏ThrowIfFailed3 D3D12的初始化步骤3.1 初始化…

聊一聊中小企业如何开展持续交付

持续交付的定义&#xff1a; 持续交付&#xff08;Continuous Delivery&#xff0c;简称CD&#xff09;是一种软件工程实践&#xff0c;旨在让软件产品的产出过程在一个短周期内完成&#xff0c;以保证软件可以稳定、持续地保持在随时可以发布的状况。它的核心目标在于加快软件…

C++函数调用运算符、函数调用对象和包装器详细介绍与总结

函数调用运算符 A.What&#xff08;函数对象&#xff09; 如果类定义了函数调用运算符&#xff0c;则该类的对象称为函数对象 B.Which&#xff08;有哪些可调用函数对象&#xff09; 函数 函数指针 lambd函数对象 bind创建的对象 重载了函数调用符的类对象 C.函数对象lambda l…

NVIDIA良心给显卡免费升级,只为挨更多的骂

起猛了&#xff0c;还真的以为 NVIDIA 良心发现了。 众所周知&#xff0c;英伟达对于咱们普通游戏玩家向来不屑一顾。只因为游戏业务在 NVIDIA 收入中占比较少。 在最新的 40 系显卡 RTX 4070 Ti Super 显卡中&#xff0c;NVIDIA悄悄给它来了一次核心「升级」&#xff0c;将原…

PLC数据采集网关的具体使用说明-天拓四方

PLC数据采集网关通过以太网、串口等通信接口与PLC设备连接&#xff0c;实现数据的实时采集。网关内置数据处理模块&#xff0c;可以对采集到的数据进行清洗、转换和存储&#xff0c;以满足不同应用场景的需求。同时&#xff0c;PLC数据采集网关支持多种通信协议&#xff0c;如M…

伦敦银看盘一般看什么 这3样东西不能缺少

伦敦银看盘&#xff0c;是指伦敦银市场开市之后&#xff0c;投资者打开走势图表&#xff0c;观察盘面行情和盘口信息的过程。一般来说&#xff0c;懂得看盘的人可能会被贴上专业的标签&#xff0c;我们在各种影视作品中看到&#xff0c;那些华尔街的交易员坐在电脑面前&#xf…

【密码学】大整数分解问题和离散对数问题

公钥密码体制的主要思想是通过一种非对称性&#xff0c;即正向计算简单&#xff0c;逆向计算复杂的加密算法设计&#xff0c;来解决安全通信。本文介绍两种在密码学领域内最为人所熟知、应用最为广泛的数学难题——大整数分解问题与离散对数问题 一、大整数分解问题 &#xf…

《算法笔记》总结No.6——贪心

一.简单贪心 贪心法是求解一类最优化问题的方法&#xff0c;它总是考虑在当前状态下局部最优(或较优)之后&#xff0c;来使全局的结果达到最优(或较优)的策略。显然&#xff0c;如果采取较优而非最优的策略(最优策略可能不存在或是不易想到)&#xff0c;得到的全局结果也无法是…

体验完这款售价29999元起苹果新品,我大受震撼

讲道理&#xff0c;数码圈已经很久没有出现过让人耳目一新的产品了。 整个圈子近些年各家新品逻辑给我的一种感觉是普遍主打循规循距&#xff0c;用高情商话来说那叫稳扎稳打不易出错&#xff0c;而低情商嘛&#xff0c;说白了叫创新精神严重缺失。 「科技最后以换皮为准」这…

客户案例|某大型证券公司数据库运维场景数据安全实践

证券行业涉及股票、债券、基金等金融产品的发行、交易和监管&#xff0c;业务具有数据规模大、数据价值高、数据应用场景复杂的显著特点&#xff0c;其中高速流转的业务系统中含有海量的客户个人信息、交易、行情、咨询等高敏感高价值信息。由于证券期货业务场景所具有的特殊性…

光伏仿真系统:智能踏勘与专业设计

在当今全球能源转型的大背景下&#xff0c;光伏行业作为绿色能源的重要组成部分&#xff0c;其智能化、数字化的发展显得尤为关键。鹧鸪云智能光伏业务管理系统&#xff0c;以其强大的智能踏勘与专业设计功能&#xff0c;为光伏项目的开发与管理提供了全面的解决方案&#xff0…

1.10编程基础之简单排序--02:奇数单增序列

OpenJudge - 02:奇数单增序列http://noi.openjudge.cn/ch0110/02/ 描述 给定一个长度为N(不大于500)的正整数序列,请将其中的所有奇数取出,并按升序输出。 输入 共2行: 第1行为 N; 第2行为 N 个正整数,其间用空格间隔。 输出 增序输出的奇数序列,数据之间以逗号间隔。数…

Spring Cloud LoadBalancer 入门与实战

一、什么是 LoadBalancer? LoadBalancer(负载均衡器) 是一种网络设备或软件机制&#xff0c;用于分发传入的网络流量负载&#xff08;请求&#xff09;到多个后端目标服务器上&#xff0c;从而实现系统资源的均衡利用和提高系统的可用性和新能。 1.1 负载均衡分类 负载均衡…

解决打印PDF文本不清楚的处理办法

之前打印PDF格式的电子书&#xff0c;不清晰&#xff0c;影响看书的心情&#xff0c;有时看到打印的书的质量&#xff0c;根本不想看&#xff0c;今天在打印一本页数不多&#xff0c;但PDF格式的书感觉也不太清楚&#xff0c;我想应该有办法解决&#xff0c;我使用的是解决福昕…

FPGA程序设计

在设计FPGA时&#xff0c;多运用模块化的思想取设计模块&#xff0c;将某一功能设计成module。 设计之前要先画一下模块设计图&#xff0c;列出输入输出接口&#xff0c;再进一步设计内部功能。 状态机要画图&#xff0c;确定每个状态和状态之间怎么切换。状态用localparam定…

东方通Tongweb发布vue前端

一、前端包中添加文件 1、解压vue打包文件 以dist.zip为例&#xff0c;解压之后得到dist文件夹&#xff0c;进入dist文件夹&#xff0c;新建WEB-INF文件夹&#xff0c;进入WEB-INF文件夹&#xff0c;新建web.xml文件&#xff0c; 打开web.xml文件&#xff0c;输入以下内容 …

开启HIVE中分区表支持中文字段

进入hive表&#xff1a; use hive; #修改hive database编码 alter database hive default character set utf8; #修改table编码 alter table PARTITIONS default character set utf8; alter table PARTITION_KEY_VALS default character set utf8; alter table SDS default cha…

泛型

背景 优点 类型绝对安全避免强制类型转换 泛型类 定义 使用 举例 泛型类 // 泛型类 T就是类型参数 public class Generic<T>{// key这个成员变量的类型为T,T的类型由外部指定private T t;public void set(T t){this.t t;}public T get(){return t;} }使用 // 创建一个泛…

前端JS特效第28集:JQuery电影选座插件

JQuery电影选座插件&#xff0c;先来看看效果&#xff1a; 部分核心的代码如下(全部代码在文章末尾)&#xff1a; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">&l…