Baumer工业相机堡盟相机如何使用ROI感兴趣区域功能( PARTIAL SCAN ROI功能的优点和行业应用)(C#)

news2024/12/28 5:10:43

 项目场景

Baumer工业相机堡盟相机是一种高性能、高质量的工业相机,可用于各种应用场景,如物体检测、计数和识别、运动分析和图像处理。  

Baumer的万兆网相机拥有出色的图像处理性能,可以实时传输高分辨率图像。此外,该相机还具有快速数据传输、低功耗、易于集成以及高度可扩展性等特点。  

Baumer工业相机堡盟相机中ROI功能是一种可以直接设置在图像芯片中进行区域设置感兴趣的区域的功能,然后在相机内部对图像进行部分扫描的剪切然后再传输到处理器中,可以在一定程度上提供工业相机的的采集帧率。


技术背景

Baumer工业相机中的ROI(感兴趣区域)功能允许用户选择图像中他们想重点分析或处理的特定部分。这可以提高图像处理系统的效率,因为它可以排除多余的或不必要的数据。

ROI功能的工作原理是在较大的图像框架内选择一个矩形区域。然后相机只对这个较小的区域应用所有后续的图像处理算法。这可以提高图像分析的速度和准确性,因为它减少了需要处理的数据量。

总的来说,Baumer工业相机的ROI功能可以减少处理时间,提高图像分析的准确性,使其成为各种工业应用中的有用工具。


代码分析

Baumer工业相机堡盟相机SDK示例中004_PartialScan_ExternalBuffer.cs详细介绍了在C#的环境中如何配置相机的ROI功能。

软件SDK示例地址如下所示:Baumer_GAPI_SDK_2.12.0_win_x86_64_cs\examples\src\0_Common\004_PartialScan_ExternalBuffer\004_PartialScan_ExternalBuffer.cs

/*
  This example describes the FIRST STEPS of handling Baumer-GAPI SDK.
  The given source code applies to handling one system, one camera and twenty images.
  Please see "Baumer-GAPI SDK Programmer's Guide" chapter 5.4.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices; // Marshal.Copy()

namespace _004_PartialScan_ExternalBuffer
{
    class Program
    {
        static int Main(string[] args)
        {
            //DECLARATIONS OF VARIABLES
            BGAPI2.SystemList systemList = null;
            BGAPI2.System mSystem = null;
            string sSystemID = "";

            BGAPI2.InterfaceList interfaceList = null;
            BGAPI2.Interface mInterface = null;
            string sInterfaceID = "";

            BGAPI2.DeviceList deviceList = null;
            BGAPI2.Device mDevice = null;
            string sDeviceID = "";

            BGAPI2.DataStreamList datastreamList = null;
            BGAPI2.DataStream mDataStream = null;
            string sDataStreamID = "";

            BGAPI2.BufferList bufferList = null;
            BGAPI2.Buffer mBuffer = null;
            int returnCode = 0;

            //external buffer
            List<IntPtr> LUserBuffer = new List<IntPtr>();

            System.Console.Write("\r\n");
            System.Console.Write("################################################################\r\n");
            System.Console.Write("# PROGRAMMER'S GUIDE Example 004_PartialScan_ExternalBuffer.cs #\r\n");
            System.Console.Write("################################################################\r\n");
            System.Console.Write("\r\n\r\n");


            System.Console.Write("SYSTEM LIST\r\n");
            System.Console.Write("###########\r\n\r\n");

            //COUNTING AVAILABLE SYSTEMS (TL producers)
            try
            {
                systemList = BGAPI2.SystemList.Instance;
                systemList.Refresh();
                System.Console.Write("5.1.2   Detected systems:  {0}\r\n", systemList.Count);

                //SYSTEM DEVICE INFORMATION
                foreach (KeyValuePair<string, BGAPI2.System> sys_pair in BGAPI2.SystemList.Instance)
                {
                    System.Console.Write("  5.2.1   System Name:     {0}\r\n", sys_pair.Value.FileName);
                    System.Console.Write("          System Type:     {0}\r\n", sys_pair.Value.TLType);
                    System.Console.Write("          System Version:  {0}\r\n", sys_pair.Value.Version);
                    System.Console.Write("          System PathName: {0}\r\n\r\n", sys_pair.Value.PathName);
                }
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }


            //OPEN THE FIRST SYSTEM IN THE LIST WITH A CAMERA CONNECTED
            try
            {
                foreach (KeyValuePair<string, BGAPI2.System> sys_pair in BGAPI2.SystemList.Instance)
                {
                    System.Console.Write("SYSTEM\r\n");
                    System.Console.Write("######\r\n\r\n");

                    try
                    {
                        sys_pair.Value.Open();
                        System.Console.Write("5.1.3   Open next system \r\n");
                        System.Console.Write("  5.2.1   System Name:     {0}\r\n", sys_pair.Value.FileName);
                        System.Console.Write("          System Type:     {0}\r\n", sys_pair.Value.TLType);
                        System.Console.Write("          System Version:  {0}\r\n", sys_pair.Value.Version);
                        System.Console.Write("          System PathName: {0}\r\n\r\n", sys_pair.Value.PathName);
                        sSystemID = sys_pair.Key;
                        System.Console.Write("        Opened system - NodeList Information \r\n");
                        System.Console.Write("          GenTL Version:   {0}.{1}\r\n\r\n", (long)sys_pair.Value.NodeList["GenTLVersionMajor"].Value, (long)sys_pair.Value.NodeList["GenTLVersionMinor"].Value);


                        System.Console.Write("INTERFACE LIST\r\n");
                        System.Console.Write("##############\r\n\r\n");

                        try
                        {
                            interfaceList = sys_pair.Value.Interfaces;
                            //COUNT AVAILABLE INTERFACES
                            interfaceList.Refresh(100); // timeout of 100 msec
                            System.Console.Write("5.1.4   Detected interfaces: {0}\r\n", interfaceList.Count);

                            //INTERFACE INFORMATION
                            foreach (KeyValuePair<string, BGAPI2.Interface> ifc_pair in interfaceList)
                            {
                                System.Console.Write("  5.2.2   Interface ID:      {0}\r\n", ifc_pair.Value.Id);
                                System.Console.Write("          Interface Type:    {0}\r\n", ifc_pair.Value.TLType);
                                System.Console.Write("          Interface Name:    {0}\r\n\r\n", ifc_pair.Value.DisplayName);
                            }
                        }
                        catch (BGAPI2.Exceptions.IException ex)
                        {
                            returnCode = (0 == returnCode) ? 1 : returnCode;
                            System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                            System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                            System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
                        }


                        System.Console.Write("INTERFACE\r\n");
                        System.Console.Write("#########\r\n\r\n");

                        //OPEN THE NEXT INTERFACE IN THE LIST
                        try
                        {
                            foreach (KeyValuePair<string, BGAPI2.Interface> ifc_pair in interfaceList)
                            {
                                try
                                {
                                    System.Console.Write("5.1.5   Open interface \r\n");
                                    System.Console.Write("  5.2.2   Interface ID:      {0}\r\n", ifc_pair.Key);
                                    System.Console.Write("          Interface Type:    {0}\r\n", ifc_pair.Value.TLType);
                                    System.Console.Write("          Interface Name:    {0}\r\n", ifc_pair.Value.DisplayName);
                                    ifc_pair.Value.Open();
                                    //search for any camera is connetced to this interface
                                    deviceList = ifc_pair.Value.Devices;
                                    deviceList.Refresh(100);
                                    if (deviceList.Count == 0)
                                    {
                                        System.Console.Write("5.1.13   Close interface ({0} cameras found) \r\n\r\n", deviceList.Count);
                                        ifc_pair.Value.Close();
                                    }
                                    else
                                    {
                                        sInterfaceID = ifc_pair.Key;
                                        System.Console.Write("  \r\n");
                                        System.Console.Write("        Opened interface - NodeList Information \r\n");
                                        if (ifc_pair.Value.TLType == "GEV")
                                        {
                                            long iIPAddress = (long)ifc_pair.Value.NodeList["GevInterfaceSubnetIPAddress"].Value;
                                            System.Console.Write("          GevInterfaceSubnetIPAddress: {0}.{1}.{2}.{3}\r\n", (iIPAddress & 0xff000000) >> 24,
                                                                                                                            (iIPAddress & 0x00ff0000) >> 16,
                                                                                                                            (iIPAddress & 0x0000ff00) >> 8,
                                                                                                                            (iIPAddress & 0x000000ff));
                                            long iSubnetMask = (long)ifc_pair.Value.NodeList["GevInterfaceSubnetMask"].Value;
                                            System.Console.Write("          GevInterfaceSubnetMask:      {0}.{1}.{2}.{3}\r\n", (iSubnetMask & 0xff000000) >> 24,
                                                                                                                            (iSubnetMask & 0x00ff0000) >> 16,
                                                                                                                            (iSubnetMask & 0x0000ff00) >> 8,
                                                                                                                            (iSubnetMask & 0x000000ff));
                                        }
                                        if (ifc_pair.Value.TLType == "U3V")
                                        {
                                            //System.Console.Write("          NodeListCount:               {0}\r\n", ifc_pair.Value.NodeList.Count);
                                        }
                                        System.Console.Write("  \r\n");
                                        break;
                                    }
                                }
                                catch (BGAPI2.Exceptions.ResourceInUseException ex)
                                {
                                    returnCode = (0 == returnCode) ? 1 : returnCode;
                                    System.Console.Write(" Interface {0} already opened \r\n", ifc_pair.Key);
                                    System.Console.Write(" ResourceInUseException {0} \r\n", ex.GetErrorDescription());
                                }
                            }
                        }
                        catch (BGAPI2.Exceptions.IException ex)
                        {
                            returnCode = (0 == returnCode) ? 1 : returnCode;
                            System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                            System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                            System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
                        }

                        //if a camera is connected to the system interface then leave the system loop
                        if (sInterfaceID != "")
                        {
                            break;
                        }
                    }
                    catch (BGAPI2.Exceptions.ResourceInUseException ex)
                    {
                        returnCode = (0 == returnCode) ? 1 : returnCode;
                        System.Console.Write(" System {0} already opened \r\n", sys_pair.Key);
                        System.Console.Write(" ResourceInUseException {0} \r\n", ex.GetErrorDescription());
                    }
                }
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            if (sSystemID == "")
            {
                System.Console.Write(" No System found \r\n");
                System.Console.Write(" Input any number to close the program:\r\n");
                Console.Read();
                return returnCode;
            }
            else
            {
                mSystem = systemList[sSystemID];
            }


            if (sInterfaceID == "")
            {
                System.Console.Write(" No Interface of TLType 'GEV' found \r\n");
                System.Console.Write("\r\nEnd\r\nInput any number to close the program:\r\n");
                Console.Read();
                mSystem.Close();
                return returnCode;
            }
            else
            {
                mInterface = interfaceList[sInterfaceID];
            }


            System.Console.Write("DEVICE LIST\r\n");
            System.Console.Write("###########\r\n\r\n");

            try
            {
                //COUNTING AVAILABLE CAMERAS
                deviceList = mInterface.Devices;
                deviceList.Refresh(100);
                System.Console.Write("5.1.6   Detected devices:         {0}\r\n", deviceList.Count);

                //DEVICE INFORMATION BEFORE OPENING
                foreach (KeyValuePair<string, BGAPI2.Device> dev_pair in deviceList)
                {
                    System.Console.Write("  5.2.3   Device DeviceID:        {0}\r\n", dev_pair.Key);
                    System.Console.Write("          Device Model:           {0}\r\n", dev_pair.Value.Model);
                    System.Console.Write("          Device SerialNumber:    {0}\r\n", dev_pair.Value.SerialNumber);
                    System.Console.Write("          Device Vendor:          {0}\r\n", dev_pair.Value.Vendor);
                    System.Console.Write("          Device TLType:          {0}\r\n", dev_pair.Value.TLType);
                    System.Console.Write("          Device AccessStatus:    {0}\r\n", dev_pair.Value.AccessStatus);
                    System.Console.Write("          Device UserID:          {0}\r\n\r\n", dev_pair.Value.DisplayName);
                }
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }


            System.Console.Write("DEVICE\r\n");
            System.Console.Write("######\r\n\r\n");

            //OPEN THE FIRST CAMERA IN THE LIST
            try
            {
                foreach (KeyValuePair<string, BGAPI2.Device> dev_pair in deviceList)
                {
                    try
                    {
                        System.Console.Write("5.1.7   Open first device \r\n");
                        System.Console.Write("          Device DeviceID:        {0}\r\n", dev_pair.Value.Id);
                        System.Console.Write("          Device Model:           {0}\r\n", dev_pair.Value.Model);
                        System.Console.Write("          Device SerialNumber:    {0}\r\n", dev_pair.Value.SerialNumber);
                        System.Console.Write("          Device Vendor:          {0}\r\n", dev_pair.Value.Vendor);
                        System.Console.Write("          Device TLType:          {0}\r\n", dev_pair.Value.TLType);
                        System.Console.Write("          Device AccessStatus:    {0}\r\n", dev_pair.Value.AccessStatus);
                        System.Console.Write("          Device UserID:          {0}\r\n\r\n", dev_pair.Value.DisplayName);
                        dev_pair.Value.Open();
                        sDeviceID = dev_pair.Key;
                        System.Console.Write("        Opened device - RemoteNodeList Information \r\n");
                        System.Console.Write("          Device AccessStatus:    {0}\r\n", dev_pair.Value.AccessStatus);

                        //SERIAL NUMBER
                        if (dev_pair.Value.RemoteNodeList.GetNodePresent("DeviceSerialNumber") == true)
                            System.Console.Write("          DeviceSerialNumber:     {0}\r\n", (string)dev_pair.Value.RemoteNodeList["DeviceSerialNumber"].Value);
                        else if (dev_pair.Value.RemoteNodeList.GetNodePresent("DeviceID") == true)
                            System.Console.Write("          DeviceID (SN):          {0}\r\n", (string)dev_pair.Value.RemoteNodeList["DeviceID"].Value);
                        else
                            System.Console.Write("          SerialNumber:           Not Available \r\n");

                        //DISPLAY DEVICEMANUFACTURERINFO
                        if (dev_pair.Value.RemoteNodeList.GetNodePresent("DeviceManufacturerInfo") == true)
                            System.Console.Write("          DeviceManufacturerInfo: {0}\r\n", (string)dev_pair.Value.RemoteNodeList["DeviceManufacturerInfo"].Value);

                        //DISPLAY DEVICEFIRMWAREVERSION OR DEVICEVERSION
                        if (dev_pair.Value.RemoteNodeList.GetNodePresent("DeviceFirmwareVersion") == true)
                            System.Console.Write("          DeviceFirmwareVersion:  {0}\r\n", (string)dev_pair.Value.RemoteNodeList["DeviceFirmwareVersion"].Value);
                        else if (dev_pair.Value.RemoteNodeList.GetNodePresent("DeviceVersion") == true)
                            System.Console.Write("          DeviceVersion:          {0}\r\n", (string)dev_pair.Value.RemoteNodeList["DeviceVersion"].Value);
                        else
                            System.Console.Write("          DeviceVersion:          Not Available \r\n");

                        if (dev_pair.Value.TLType == "GEV")
                        {
                            System.Console.Write("          GevCCP:                 {0}\r\n", (string)dev_pair.Value.RemoteNodeList["GevCCP"].Value);
                            System.Console.Write("          GevCurrentIPAddress:    {0}.{1}.{2}.{3}\r\n", ((long)dev_pair.Value.RemoteNodeList["GevCurrentIPAddress"].Value & 0xff000000) >> 24, ((long)dev_pair.Value.RemoteNodeList["GevCurrentIPAddress"].Value & 0x00ff0000) >> 16, ((long)dev_pair.Value.RemoteNodeList["GevCurrentIPAddress"].Value & 0x0000ff00) >> 8, ((long)dev_pair.Value.RemoteNodeList["GevCurrentIPAddress"].Value & 0x000000ff));
                            System.Console.Write("          GevCurrentSubnetMask:   {0}.{1}.{2}.{3}\r\n", ((long)dev_pair.Value.RemoteNodeList["GevCurrentSubnetMask"].Value & 0xff000000) >> 24, ((long)dev_pair.Value.RemoteNodeList["GevCurrentSubnetMask"].Value & 0x00ff0000) >> 16, ((long)dev_pair.Value.RemoteNodeList["GevCurrentSubnetMask"].Value & 0x0000ff00) >> 8, ((long)dev_pair.Value.RemoteNodeList["GevCurrentSubnetMask"].Value & 0x000000ff));
                        }
                        System.Console.Write("          \r\n");
                        break;
                    }
                    catch (BGAPI2.Exceptions.ResourceInUseException ex)
                    {
                        returnCode = (0 == returnCode) ? 1 : returnCode;
                        System.Console.Write(" Device {0} already opened \r\n", dev_pair.Key);
                        System.Console.Write(" ResourceInUseException {0} \r\n", ex.GetErrorDescription());
                    }
                    catch (BGAPI2.Exceptions.AccessDeniedException ex)
                    {
                        returnCode = (0 == returnCode) ? 1 : returnCode;
                        System.Console.Write(" Device {0} already opened \r\n", dev_pair.Key);
                        System.Console.Write(" AccessDeniedException {0} \r\n", ex.GetErrorDescription());
                    }
                }
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            if (sDeviceID == "")
            {
                System.Console.Write(" No Device found \r\n");
                System.Console.Write("\r\nEnd\r\nInput any number to close the program:\r\n");
                Console.Read();
                mInterface.Close();
                mSystem.Close();
                return returnCode;
            }
            else
            {
                mDevice = deviceList[sDeviceID];
            }


            System.Console.Write("DEVICE PARAMETER SETUP\r\n");
            System.Console.Write("######################\r\n\r\n");

            try
            {
                //SET TRIGGER MODE OFF (FreeRun)
                mDevice.RemoteNodeList["TriggerMode"].Value = "Off";
                System.Console.Write("        TriggerMode:              {0}\r\n", (string)mDevice.RemoteNodeList["TriggerMode"].Value);
                System.Console.Write("  \r\n");


                //SET A PARTIAL SCAN (ROI...REGION OF INTEREST) IN THE RIGHT BOTTOM AREA OF THE IMAGE
                //====================================================================================
                System.Console.Write("    Set ROI parameters to the right bottom quarter of the sensor\r\n\r\n");

                //IMAGE WIDTH
                //===========
                System.Console.Write("        Width\r\n", (string)mDevice.RemoteNodeList["Width"].Interface);
                System.Console.Write("          description:            {0}\r\n", (string)mDevice.RemoteNodeList["Width"].Description);
                System.Console.Write("          interface type:         {0}\r\n", (string)mDevice.RemoteNodeList["Width"].Interface);

                long iImageWidth = 0;
                long iImageWidthMin = 0;
                long iImageWidthMax = 0;
                long iImageWidthInc = 0;

                //get current value and limits
                iImageWidth = (long)mDevice.RemoteNodeList["Width"].Value;
                iImageWidthMin = (long)mDevice.RemoteNodeList["Width"].Min;
                iImageWidthMax = (long)mDevice.RemoteNodeList["Width"].Max;
                iImageWidthInc = (long)mDevice.RemoteNodeList["Width"].Inc;

                System.Console.Write("          current value:          {0}\r\n", iImageWidth);
                System.Console.Write("          possible value range:   {0} to {1} with increment of {2}\r\n", iImageWidthMin, iImageWidthMax, iImageWidthInc);

                //set new width value same to the half value of sensor width
                long widthvalue = (long)mDevice.RemoteNodeList["SensorWidth"].Value / 2 / iImageWidthInc * iImageWidthInc; // find number to match the increment

                // check new value is within range
                if (widthvalue < iImageWidthMin)
                    widthvalue = iImageWidthMin;

                if (widthvalue > iImageWidthMax)
                    widthvalue = iImageWidthMax;

                mDevice.RemoteNodeList["Width"].Value = widthvalue;

                //recheck new width is set
                System.Console.Write("          set value to:           {0} is half value of the sensor width: {1}\r\n\r\n", (long)mDevice.RemoteNodeList["Width"].Value, (long)mDevice.RemoteNodeList["SensorWidth"].Value);


                //IMAGE OFFSET X
                //==============
                System.Console.Write("        OffsetX\r\n");
                System.Console.Write("          description:            {0}\r\n", (string)mDevice.RemoteNodeList["OffsetX"].Description);
                System.Console.Write("          interface type:         {0}\r\n", (string)mDevice.RemoteNodeList["OffsetX"].Interface);
                long iImageOffsetX = 0;
                long iImageOffsetXMin = 0;
                long iImageOffsetXMax = 0;
                long iImageOffsetXInc = 0;

                //get current value and limits
                iImageOffsetX = (long)mDevice.RemoteNodeList["OffsetX"].Value;
                iImageOffsetXMin = (long)mDevice.RemoteNodeList["OffsetX"].Min;
                iImageOffsetXMax = (long)mDevice.RemoteNodeList["OffsetX"].Max;
                iImageOffsetXInc = (long)mDevice.RemoteNodeList["OffsetX"].Inc;

                System.Console.Write("          current value:          {0}\r\n", iImageOffsetX);
                System.Console.Write("          possible value range:   {0} to {1} with increment of {2}\r\n", iImageOffsetXMin, iImageOffsetXMax, iImageOffsetXInc);

                //set new OffsetX value same to the half value of sensor width
                long OffsetXvalue = (long)mDevice.RemoteNodeList["SensorWidth"].Value / 2 / iImageOffsetXInc * iImageOffsetXInc; // find number to match the increment

                // check new value is within range
                if (OffsetXvalue < iImageOffsetXMin)
                    OffsetXvalue = iImageOffsetXMin;

                if (OffsetXvalue > iImageOffsetXMax)
                    OffsetXvalue = iImageOffsetXMax;

                mDevice.RemoteNodeList["OffsetX"].Value = OffsetXvalue;

                //recheck new OffsetX is set
                System.Console.Write("          set value to:           {0} is half value of the sensor width: {1}\r\n\r\n", (long)mDevice.RemoteNodeList["OffsetX"].Value, (long)mDevice.RemoteNodeList["SensorWidth"].Value);


                //IMAGE HEIGHT
                //============
                System.Console.Write("        Height\r\n");
                System.Console.Write("          description:            {0}\r\n", (string)mDevice.RemoteNodeList["Height"].Description);
                System.Console.Write("          interface type:         {0}\r\n", (string)mDevice.RemoteNodeList["Height"].Interface);
                long iImageHeight = 0;
                long iImageHeightMin = 0;
                long iImageHeightMax = 0;
                long iImageHeightInc = 0;

                //get current value and limits
                iImageHeight = (long)mDevice.RemoteNodeList["Height"].Value;
                iImageHeightMin = (long)mDevice.RemoteNodeList["Height"].Min;
                iImageHeightMax = (long)mDevice.RemoteNodeList["Height"].Max;
                iImageHeightInc = (long)mDevice.RemoteNodeList["Height"].Inc;

                System.Console.Write("          current value:          {0}\r\n", iImageHeight);
                System.Console.Write("          possible value range:   {0} to {1} with increment of {2}\r\n", iImageHeightMin, iImageHeightMax, iImageHeightInc);

                //set new height value same to the half value of sensor height
                long heightvalue = (long)mDevice.RemoteNodeList["SensorHeight"].Value / 2 / iImageHeightInc * iImageHeightInc; // find number to match the increment

                // check new value is within range
                if (heightvalue < iImageHeightMin)
                    heightvalue = iImageHeightMin;

                if (heightvalue > iImageHeightMax)
                    heightvalue = iImageHeightMax;

                mDevice.RemoteNodeList["Height"].Value = heightvalue;

                //recheck new height is set
                System.Console.Write("          set value to:           {0} is half value of the sensor height: {1}\r\n\r\n", (long)mDevice.RemoteNodeList["Height"].Value, (long)mDevice.RemoteNodeList["SensorHeight"].Value);


                //IMAGE OFFSET Y
                //==============
                System.Console.Write("        OffsetY\r\n");
                System.Console.Write("          description:            {0}\r\n", (string)mDevice.RemoteNodeList["OffsetY"].Description);
                System.Console.Write("          interface type:         {0}\r\n", (string)mDevice.RemoteNodeList["OffsetY"].Interface);
                long iImageOffsetY = 0;
                long iImageOffsetYMin = 0;
                long iImageOffsetYMax = 0;
                long iImageOffsetYInc = 0;

                //get current value and limits
                iImageOffsetY = (long)mDevice.RemoteNodeList["OffsetY"].Value;
                iImageOffsetYMin = (long)mDevice.RemoteNodeList["OffsetY"].Min;
                iImageOffsetYMax = (long)mDevice.RemoteNodeList["OffsetY"].Max;
                iImageOffsetYInc = (long)mDevice.RemoteNodeList["OffsetY"].Inc;

                System.Console.Write("          current value:          {0}\r\n", iImageOffsetY);
                System.Console.Write("          possible value range:   {0} to {1} with increment of {2}\r\n", iImageOffsetYMin, iImageOffsetYMax, iImageOffsetYInc);

                //set new OffsetY value same to the half value of sensor height
                long OffsetYvalue = (long)mDevice.RemoteNodeList["SensorHeight"].Value / 2 / iImageOffsetYInc * iImageOffsetYInc; // find number to match the increment

                // check new value is within range
                if (OffsetYvalue < iImageOffsetYMin)
                    OffsetYvalue = iImageOffsetYMin;

                if (OffsetYvalue > iImageOffsetYMax)
                    OffsetYvalue = iImageOffsetYMax;

                mDevice.RemoteNodeList["OffsetY"].Value = OffsetYvalue;

                //recheck new OffsetY is set
                System.Console.Write("          set value to:           {0} is half value of the sensor height: {1}\r\n\r\n", (long)mDevice.RemoteNodeList["OffsetY"].Value, (long)mDevice.RemoteNodeList["SensorHeight"].Value);

            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }


            System.Console.Write("DATA STREAM LIST\r\n");
            System.Console.Write("################\r\n\r\n");

            try
            {
                //COUNTING AVAILABLE DATASTREAMS
                datastreamList = mDevice.DataStreams;
                datastreamList.Refresh();
                System.Console.Write("5.1.8   Detected datastreams:     {0}\r\n", datastreamList.Count);

                //DATASTREAM INFORMATION BEFORE OPENING
                foreach (KeyValuePair<string, BGAPI2.DataStream> dst_pair in datastreamList)
                {
                    System.Console.Write("  5.2.4   DataStream ID:          {0}\r\n\r\n", dst_pair.Key);
                }
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }


            System.Console.Write("DATA STREAM\r\n");
            System.Console.Write("###########\r\n\r\n");

            //OPEN THE FIRST DATASTREAM IN THE LIST
            try
            {
                foreach (KeyValuePair<string, BGAPI2.DataStream> dst_pair in datastreamList)
                {
                    System.Console.Write("5.1.9   Open first datastream \r\n");
                    System.Console.Write("          DataStream ID:          {0}\r\n\r\n", dst_pair.Key);
                    dst_pair.Value.Open();
                    sDataStreamID = dst_pair.Key;
                    System.Console.Write("        Opened datastream - NodeList Information \r\n");
                    System.Console.Write("          StreamAnnounceBufferMinimum:  {0}\r\n", dst_pair.Value.NodeList["StreamAnnounceBufferMinimum"].Value);
                    if (dst_pair.Value.TLType == "GEV")
                    {
                        System.Console.Write("          StreamDriverModel:            {0}\r\n", dst_pair.Value.NodeList["StreamDriverModel"].Value);
                    }
                    System.Console.Write("  \r\n");
                    break;
                }
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            if (sDataStreamID == "")
            {
                System.Console.Write(" No DataStream found \r\n");
                System.Console.Write("\r\nEnd\r\nInput any number to close the program:\r\n");
                Console.Read();
                mDevice.Close();
                mInterface.Close();
                mSystem.Close();
                return returnCode;
            }
            else
            {
                mDataStream = datastreamList[sDataStreamID];
            }


            System.Console.Write("BUFFER LIST\r\n");
            System.Console.Write("###########\r\n\r\n");

            try
            {
                //BufferList
                bufferList = mDataStream.BufferList;

                // 4 buffers using external buffer mode
                System.Console.Write("5.4.2   External buffers\r\n");

                long iDevicePayloadsize = (long)mDevice.RemoteNodeList["PayloadSize"].Value;
                System.Console.Write("         payloadsize required for external buffer [bytes]: {0}\r\n", iDevicePayloadsize);

                IntPtr mUserBuffer = new IntPtr(0);
                
                ulong uPayloadSize = mDataStream.IsDefinedPayloadSize ? mDataStream.PayloadSize : (ulong)iDevicePayloadsize;
                for (int i = 0; i < 4; i++) // 4 buffers using external allocated memory
                {
                    mUserBuffer = Marshal.AllocHGlobal((int)uPayloadSize); // use Marshal.FreeHGlobal(mUserBuffer) when releasing resources
                    LUserBuffer.Add(mUserBuffer);
                    IntPtr pUserObj = new IntPtr(0); // NULL pointer, not used
                    mBuffer = new BGAPI2.Buffer(mUserBuffer, uPayloadSize, pUserObj);
                    bufferList.Add(mBuffer);
                    System.Console.Write("         add external buffer [{0}]\r\n", i);
                }
                System.Console.Write("5.1.10   Announced buffers:       {0} using {1} [bytes]\r\n", bufferList.AnnouncedCount, mBuffer.MemSize * bufferList.AnnouncedCount);
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }


            try
            {
                foreach (KeyValuePair<string, BGAPI2.Buffer> buf_pair in bufferList)
                {
                    buf_pair.Value.QueueBuffer();
                }
                System.Console.Write("5.1.11   Queued buffers:          {0}\r\n", bufferList.QueuedCount);
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }
            System.Console.Write("\r\n");


            System.Console.Write("CAMERA START\r\n");
            System.Console.Write("############\r\n\r\n");

            //START DATASTREAM ACQUISITION
            try
            {
                mDataStream.StartAcquisition();
                System.Console.Write("5.1.12   DataStream started \r\n");
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            //START CAMERA
            try
            {
                mDevice.RemoteNodeList["AcquisitionStart"].Execute();
                System.Console.Write("5.1.12   {0} started\r\n", mDevice.Model);
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            //CAPTURE 20 IMAGES
            System.Console.Write("\r\n");
            System.Console.Write("CAPTURE 20 IMAGES BY IMAGE POLLING USING INTERNAL BUFFERS\r\n");
            System.Console.Write("#########################################################\r\n\r\n");

            BGAPI2.Buffer mBufferFilled = null;
            try
            {
                for (int i = 0; i < 20; i++)
                {
                    mBufferFilled = mDataStream.GetFilledBuffer(1000); // image polling timeout 1000 msec
                    if (mBufferFilled == null)
                    {
                        System.Console.Write("Error: Buffer Timeout after 1000 msec\r\n");
                    }
                    else if (mBuffer.IsIncomplete == true)
                    {
                        System.Console.Write("Error: Image is incomplete\r\n");
                        // queue buffer again
                        mBufferFilled.QueueBuffer();
                    }
                    else
                    {
                        System.Console.Write(" Image {0, 5:d} received in memory address {1:X}", mBufferFilled.FrameID, (ulong)mBufferFilled.MemPtr);
                        System.Console.Write(" size {0} [bytes]\r\n", (ulong)mBufferFilled.MemSize);
                        // queue buffer again
                        mBufferFilled.QueueBuffer();
                    }
                }
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }
            System.Console.Write("\r\n");


            System.Console.Write("CAMERA STOP\r\n");
            System.Console.Write("###########\r\n\r\n");

            String sExposureNodeName = "";
            if (mDevice.GetRemoteNodeList().GetNodePresent("ExposureTime"))
            {
                sExposureNodeName = "ExposureTime";
            }
            else if (mDevice.GetRemoteNodeList().GetNodePresent("ExposureTimeAbs"))
            {
                sExposureNodeName = "ExposureTimeAbs";
            }

            //STOP CAMERA
            try
            {
                if (mDevice.RemoteNodeList.GetNodePresent("AcquisitionAbort") == true)
                {
                    mDevice.RemoteNodeList["AcquisitionAbort"].Execute();
                    System.Console.Write("5.1.12   {0} aborted\r\n", mDevice.Model);
                }

                mDevice.RemoteNodeList["AcquisitionStop"].Execute();
                System.Console.Write("5.1.12   {0} stopped\r\n", mDevice.Model);
                System.Console.Write("\r\n");

                System.Console.Write("         ExposureTime:                   {0} [{1}]\r\n", (double)mDevice.RemoteNodeList[sExposureNodeName].Value, (string)mDevice.RemoteNodeList[sExposureNodeName].Unit);
                if (mDevice.TLType == "GEV")
                {
                    if (mDevice.RemoteNodeList.GetNodePresent("DeviceStreamChannelPacketSize") == true)
                        System.Console.Write("         DeviceStreamChannelPacketSize:  {0} [bytes]\r\n", (long)mDevice.RemoteNodeList["DeviceStreamChannelPacketSize"].Value);
                    else
                        System.Console.Write("         GevSCPSPacketSize:              {0} [bytes]\r\n", (long)mDevice.RemoteNodeList["GevSCPSPacketSize"].Value);
                    System.Console.Write("         GevSCPD (PacketDelay):          {0} [tics]\r\n", (long)mDevice.RemoteNodeList["GevSCPD"].Value);
                }
                System.Console.Write("\r\n");
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }


            //STOP DataStream acquisition & release buffers
            try
            {
                if (mDataStream.TLType == "GEV")
                {
                    //DataStream Statistics
                    System.Console.Write("         DataStream Statistics \r\n");
                    System.Console.Write("           DataBlockComplete:              {0}\r\n", (long)mDataStream.NodeList["DataBlockComplete"].Value);
                    System.Console.Write("           DataBlockInComplete:            {0}\r\n", (long)mDataStream.NodeList["DataBlockInComplete"].Value);
                    System.Console.Write("           DataBlockMissing:               {0}\r\n", (long)mDataStream.NodeList["DataBlockMissing"].Value);
                    System.Console.Write("           PacketResendRequestSingle:      {0}\r\n", (long)mDataStream.NodeList["PacketResendRequestSingle"].Value);
                    System.Console.Write("           PacketResendRequestRange:       {0}\r\n", (long)mDataStream.NodeList["PacketResendRequestRange"].Value);
                    System.Console.Write("           PacketResendReceive:            {0}\r\n", (long)mDataStream.NodeList["PacketResendReceive"].Value);
                    System.Console.Write("           DataBlockDroppedBufferUnderrun: {0}\r\n", (long)mDataStream.NodeList["DataBlockDroppedBufferUnderrun"].Value);
                    System.Console.Write("           Bitrate:                        {0}\r\n", (double)mDataStream.NodeList["Bitrate"].Value);
                    System.Console.Write("           Throughput:                     {0}\r\n", (double)mDataStream.NodeList["Throughput"].Value);
                    System.Console.Write("\r\n");
                }
                if (mDataStream.TLType == "U3V")
                {
                    //DataStream Statistics
                    System.Console.Write("         DataStream Statistics \r\n");
                    System.Console.Write("           GoodFrames:            {0}\r\n", (long)mDataStream.NodeList["GoodFrames"].Value);
                    System.Console.Write("           CorruptedFrames:       {0}\r\n", (long)mDataStream.NodeList["CorruptedFrames"].Value);
                    System.Console.Write("           LostFrames:            {0}\r\n", (long)mDataStream.NodeList["LostFrames"].Value);
                    System.Console.Write("\r\n");
                }
                mDataStream.StopAcquisition();
                System.Console.Write("5.1.12   DataStream stopped \r\n");
                bufferList.DiscardAllBuffers();
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0}.\r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0}.\r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }
            System.Console.Write("\r\n");


            System.Console.Write("RELEASE\r\n");
            System.Console.Write("#######\r\n\r\n");

            //Release buffers
            System.Console.Write("5.1.13   Releasing the resources\r\n");
            try
            {
                while (bufferList.Count > 0)
                {
                    mBuffer = (BGAPI2.Buffer)bufferList.Values.First();
                    bufferList.RevokeBuffer(mBuffer);
                }
                System.Console.Write("         buffers after revoke:    {0}\r\n", bufferList.Count);

                foreach (IntPtr mBufferPointer in LUserBuffer)
                {
                    Marshal.FreeHGlobal(mBufferPointer);
                }
                System.Console.WriteLine("5.4.2    memory blocks of external buffers deleted");
                mDataStream.Close();
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            //DEVICE PARAMETER RESET
            try
            {
                System.Console.Write("5.3.1    Reset ROI parameters\r\n");
                mDevice.RemoteNodeList["OffsetY"].Value = (long)mDevice.RemoteNodeList["OffsetY"].Min;
                mDevice.RemoteNodeList["Height"].Value = (long)mDevice.RemoteNodeList["Height"].Max;
                mDevice.RemoteNodeList["OffsetX"].Value = (long)mDevice.RemoteNodeList["OffsetX"].Min;
                mDevice.RemoteNodeList["Width"].Value = (long)mDevice.RemoteNodeList["Width"].Max;
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0} \r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0} \r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            try
            {
                mDevice.Close();
                mInterface.Close();
                mSystem.Close();
            }
            catch (BGAPI2.Exceptions.IException ex)
            {
                returnCode = (0 == returnCode) ? 1 : returnCode;
                System.Console.Write("ExceptionType:    {0}.\r\n", ex.GetType());
                System.Console.Write("ErrorDescription: {0}.\r\n", ex.GetErrorDescription());
                System.Console.Write("in function:      {0} \r\n", ex.GetFunctionName());
            }

            System.Console.Write("\r\nEnd\r\n\r\n");
            System.Console.Write("Input any number to close the program:\r\n");
            Console.Read();
            return returnCode;
        }
    }
}

 


工业相机ROI图像功能的优势

Baumer工业相机的ROI(感兴趣区域)功能具有显著的优势,包括。

1. 提高精度:通过突出图像中的特定感兴趣区域,ROI功能可以使测量和分析更加精确和准确。

2. 减少了处理时间。通过将处理能力集中在图像的特定区域,ROI功能减少了需要处理的数据量,从而使分析和处理时间更快。

3. 提高图像质量。ROI功能可用于裁剪掉图像中不需要的区域,从而获得更高的分辨率和更好的图像质量。

4. 增加灵活性。ROI功能允许用户实时定制感兴趣的区域,能够更有效地监测和分析感兴趣的特定区域。

5. 提高动态范围。ROI功能还可用于提高图像的动态范围,因为它使用户能够调整图像内特定区域的曝光设置。

总的来说,工业相机的ROI功能可以在广泛的工业应用中显著提高成像和分析的准确性、速度和效率。


工业相机ROI功能的行业应用

Baumer工业相机的ROI(感兴趣区域)功能可以有各种场景应用。下面是几个例子。

1. 质量控制和检查。ROI功能可用于聚焦于产品或样品中的某一感兴趣的区域,并捕获高质量的图像进行分析。

2. 机器视觉。在自动化制造过程中,ROI功能可以帮助识别生产线上的特定零件或部件,以便进行检查和分析。

3. 监视和安全。投资回报率功能可用于放大监控视频画面中的特定区域,确保高清晰度地捕捉到任何可疑的活动。

4. 科学研究。在生物技术或材料科学等领域,ROI功能可以帮助研究人员捕捉样品、细胞或材料的详细图像进行分析。

总的来说,ROI功能使工业相机能够捕捉和ROI的特定区域,使其成为各行业的宝贵工具。

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

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

相关文章

利用 ChatGPT4 回复的 markdown 文本生成 ppt

本篇博文不涉及账号以及基础网络知识&#xff0c;大伙可以自动搜索。 比如我最近要分享一篇关于 TCP 的分享&#xff0c;那么我可以设置如下 Prompt 我最近要做一篇关于 tcp 入门的 ppt 分享&#xff0c;帮我列出大纲以及需要注意的事项&#xff1f; 接下来就是 ChatGPT4 给…

RocketMQ的学习历程(3)----RocketMQ部署(docker版)

RocketMQ部署&#xff08;docker版&#xff09; 1. 部署开始前的准备 一台linux机器。(我这里使用的是阿里云的一个centos7的服务器)docker环境以及相关的简单知识。一些计算机网络的简单知识。&#xff08;可以帮你透彻了解为什么这么部署&#xff09; docker部署十分简单快捷…

JAVA85-135

JAVA85-135 字符集详解解码与编码方法 字符流FileWriter 拷贝文件夹字节缓冲流拷贝文件&#xff08;一次读写一个字节&#xff09;字节缓冲流拷贝文件&#xff08;一次读写一个字节数组&#xff09; 字符缓冲流控制软件运行次数 序列化流反序列化流/对象操作输入流打印流字节打…

macOS Monterey 12.6.5 (21G531) OC 0.9.1 / Cl 5151 / PE 三分区原版黑苹果镜像

苹果近期发布了 macOS Big Sur 11.7.6 和 macOS Monterey 12.6.5 更新&#xff0c;本次更新重点修复了标记为 CVE-2023-28206 的漏洞&#xff0c;在 macOS 13.3.1 更新中已修复&#xff0c;推荐大家安装升级。 镜像下载&#xff1a; macOS Monterey 12.6.5 (21G531) 三分区原版…

【面试】嵌入式C语言题目整理

【面试】嵌入式C语言题目整理 描述内存四区。 内存四区分为&#xff1a;代码区、静态区、堆区、栈区 代码区就是用来存放代码的。 静态区用来存放全局变量、静态变量、常量&#xff08;字符串常量、const修饰的全局变量&#xff09;。 堆区中的内存是由程序员自己申请和释放的&…

《高性能MySQL》读书笔记

《高性能MySQL》 第一章 MySQL架构与历史第二章 MySQL基准测试第三章 服务器性能剖析第四章 Schema与数据类型优化第五章 创建高性能的索引第六章 查询性能优化第七章 MySQL高级特性第八章 优化服务器设置第九章 操作系统与硬件优化第十章 复制第十一章 可扩展的MySQL第十二章 …

sed进阶之多行命令

shell脚本编程系列 前面使用sed编辑器的基础命令时&#xff0c;所有的命令都是针对单行数据执行操作的。在sed编辑器读取数据流时&#xff0c;它会根据换行符的位置将数据分成行。sed编辑器会根据定义好的脚本命令&#xff0c;一次处理一行数据&#xff0c;然后移到下一行重复这…

numpy稀疏矩阵拼接

今天我发现numpy中的array拼接时dense矩阵和sparse矩阵拼接使用的形式是不一样的&#xff0c;测试如下 普通矩阵拼接 import numpy as npaa np.random.randn(4,3) bb np.ones((4,3)) ccnp.c_[aa,bb] cc.shape结果如下 sparse矩阵拼接 from scipy.sparse import *row [1,1,…

DC-7通关详解

信息收集 漏洞发现 web提示我们说弱口令可能不会奏效 那么我们就先不考虑弱口令 searchsploit搜payload打打看,无果 看别人的wp知道了是通过web左下角的这个玩意去github搜 在这个仓库用户唯一的仓库中看config.php 发现账号密码 尝试后台和ssh登录 ssh登录成功 提权 当前…

一款免安装、多平台兼容的 拾色器(Color Picker)

文章目录 场景需求场景需求 Chrome Google DevTools 中的 拾色器 用法其他浏览器 场景需求 场景 我是一个前端开发人员&#xff0c;我写好的界面给老板过目。老板说有个地方颜色需要调整&#xff0c;然后发我一张图片指了指说就用这个位置这样的红色&#xff0c;我看挺合适。…

数字化时代 | 服务数字化创新和转型全景视图

本文我全面介绍一下数字化时代&#xff0c;服务将往何处去&#xff0c;将如何设计和推进数字化创新和转型。 Figure 1 服务创新和转型全景视图 如上图所示&#xff0c;在我CRM3.0理论体系中&#xff0c;服务创新和转型涉及到四个层面的内容&#xff1a; 服务定位和目标&#…

Python数据分析script必备知识(三)

Python数据分析script必备知识(三) 1.单个文件,双个文件,三个文件的读取方式 新建1.txt文件,2.txt文件,3.txt文件,效果如下 执行代码 """ 单文件,双文件,三文件的读取方式Python的读写 file.read() ———— 一次性读取整个文件内容,推荐使用re…

【信息安全案例】——系统软件安全(学习笔记)

&#x1f4d6; 前言&#xff1a;操作系统是管理系统资源、控制程序执行、提供良好人机界面和各种服务的一种系统软件&#xff0c;是连接计算机硬件与上层软件和用户之间的桥梁。因此&#xff0c;操作系统是其他系统软件、应用软件运行的基础&#xff0c;操作系统的安全性对于保…

React框架课时二认识项目的结构目录一

1react项目的目录的内容信息 ├── README.md 使用方法的文档 ├── node_modules 所有的依赖安装的目录 ├── package-lock.json 锁定安装时的包的版本号,保证团队的依赖能保证一致。 ├── package.json ├── public 静态公共目录 └── src 开发用的源代码目录 2 图…

英伟达Jetson NX,AI配置。安装SDK Components

目录 0.前言 1.准备 2.安装 3.检验 4.总结 0.前言 五一了&#xff0c;劳动节劳个动。推荐一首歌《花房姑娘》。 1.准备 接上篇博客英伟达Jetson NX套件刷机 算是完整配置英伟达这个Jetson AI。说来也是强&#xff0c;把GPU的能力用在了算力上&#xff0c;CUDA可以的。 查看…

SqlServer数据库中文乱码问题解决方法

这个问题在网上找了很多资料都没找到真正解决问题的办法&#xff0c;最终去了官网&#xff0c;终于找到问题的答案了&#xff0c;整理出来做个记录。 问题描述&#xff1a; 项目中遇到一个问题&#xff0c;sqlserver中的数据是ok的&#xff0c;结果保存到mysql中是乱码&#…

PostgreSQL数据库

0 安装 我使用的操作系统为Ubuntu。 安装命令&#xff1a; sudo apt-get update sudo apt-get install postgresql postgresql-client 进入postgres&#xff1a; sudo -i -u postgres psql 退出命令&#xff1a; \q PostgreSQL启动服务等&#xff1a; sudo /etc/init.d/postgr…

KalLinux安装burpsuite(超详细)

注意事项 1.注意linux位数 安装jdk之前先输出uname -a&#xff0c;看看kali linux是32位的还是64位&#xff0c;例如此处我的kali是32位的&#xff0c;因此需下载的是32位的jdk 2.jdk版本 jdk版本最好是oracle的&#xff0c;若使用的是openjdk很可能会出现burpsuite闪退现象…

还在因为指针的释放问题而烦恼吗?快来看下C++11智能指针shared_ptr

智能指针是这样一种类&#xff0c;即其对象的特征类似于指针。例如&#xff0c;智能指针可以存储new分配的内存地址&#xff0c;也可以被解除引用。 因为智能指针是一个类对象&#xff0c;因此它可以修改和扩充简单指针的行为。例如&#xff0c;智能指针可以建立引用技术&#…

读研读博不emo

文章目录 起因积极走出封闭的孤独经历一——去心理健康中心看看书 原因剖析解决思路 好久没更b站&#xff0c; 起因 起因是这样的&#xff0c;在自己读研的研一下学期。也遭遇到了年以来的第一次心态发生有点压抑的情况吧。其实第一学期因为我遇到了很好的导师&#xff0c;然后…