当前位置: 首页 > news >正文

Baumer工业相机堡盟相机如何使用偏振功能(偏振相机优点和行业应用)(C#)

 项目场景:

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

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

Baumer相机系列中偏振相机的特殊功能有助于在一些特殊应用场合使用。


技术背景

偏光工业相机相机旨在捕捉偏光,以提高图像质量,减少各种工业应用中的眩光。

这些相机的镜头中集成了偏振滤光片,可以帮助改善图像对比度,提高色彩饱和度,并减少闪亮表面的反射。

偏光工业相机的一些关键特征可能包括高分辨率、快速帧率、适用于工业环境的坚固设计,以及与不同照明条件的兼容性。

此外,它们可能具有触发、曝光控制和图像处理能力等功能,有助于为检查和分析目的捕获清晰和详细的图像。

  

  


代码分析

Baumer工业相机堡盟相机SDK示例中020_Polarized.cpp详细介绍了如何配置相机偏振功能。

软件SDK示例地址如下所示:Baumer_GAPI_SDK_2.9.2_win_x86_64_cpp\examples\src\0_Common\020_Polarized_SinglePart\020_Polarized_SinglePart.cpp

Baumer工业相机系列中VCXU-50MP和VCXG-50MP为偏振工业相机。 

Model

Resolution

Sensor

Frame rate           GigE          USB3

VCXG-50MP

5 MP

2448 × 2048

Sony IMX250MZR (2/3″, 3.45 µm)

35|24

-

VCXU-50MP

5 MP

2448 × 2048

Sony IMX250MZR (2/3″, 3.45 µm)

-

77

该示例描述了如何使用所提供的堡盟GAPI API功能来配置相机并计算所需的偏振数据(AOL、DOP、ADOLP、Intensity)

下面的例子描述了如何从VCXU-50MP 和 VCXG-50MP 获得偏振数据。

描述了所有如何使用提供的 Baumer GAPI API 功能来配置相机和计算所需的偏振数据(AOL,DOP,ADOLP,亮度)如果需要多于一种可用的偏振数据格式,使用多部分图像进行计算会更有效。

这在示例021 _ Polalization _ MultiPart 中进行了描述

代码整体结构相对简单,在相机初始化后进行相机的偏振功能使用,下面主要描述部分核心代码如下: 

/*This example describes how to obtain polarisation data from the Baumer VCXU-50MP and VCXG-50MP.The example describes all how to use the provided Baumer GAPI API functionality to configurethe camera and calculate the required polarisation data (AOL, DOP, ADOLP, Intensity)If more than one of the available polarisation data format is needed it is more efficient to usea multi-part image for the calculation. This is described in the example 021_Polarized_MultiPart.cpp
*/#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include "bgapi2_genicam/bgapi2_genicam.hpp"// handles the command line argument parsing
#include "Arguments.h"using namespace BGAPI2;//------------------------------------------------------------------------------
static double g_aopOffset = 0.0;
static bool   g_bAopOffset = false;struct DeviceMatch {BGAPI2::System* pSystem;BGAPI2::Interface* pInterface;BGAPI2::Device* pDevice;
};//------------------------------------------------------------------------------
/* Read the polarization calibration matrix and angle of polarization offset from the cameraused to calculated the required polarisation data in the Baumer GAPI image processor */
static void SetDeviceCalibrationToImageProcessor(BGAPI2::Device* const pDevice, BGAPI2::ImageProcessor* const pImageProcessor);/* Setup the Baumer GAPI to calculate the requested polarization component from the rawpolarized image */
static void EnableSingleComponent(BGAPI2::Image* const pImage, const std::string sComponent);/* Get the Angle Offset from the command line parameter (if provided) and use it for the calculation */
static void argumentAopOffset(const Argument& argument, const ArgumentMode mode, const char* const pParam);/* connect to the first polarisation camera found on the system */
static int GetFirstDevice(DeviceMatch* const pMatch, bool(*pSystemFilter)(BGAPI2::System* pSystem), bool(*pInterfaceFilter)(BGAPI2::Interface* pInterface), bool(*pDeviceFilter)(BGAPI2::Device* pDevice), std::ostream& log);/* Helper to Display various information of the camera */
static void GetDeviceInfo(std::ostream& log, BGAPI2::Device* const pDevice, const bool bOpen);/* Helper to filter found cameras devices and select only polarization camera for this example */
static bool PolarizationDeviceFilter(BGAPI2::Device* const pDevice);/* Release all allocated resources */
static int ReleaseAllResources(BGAPI2::System* pSystem, BGAPI2::Interface* pInterface, BGAPI2::Device* pDevice, BGAPI2::DataStream* pDataStream, BGAPI2::ImageProcessor* pImageProcessor);//------------------------------------------------------------------------------
int main(int argc, char* argv[])
{// Declaration of variablesBGAPI2::System* pSystem = NULL;BGAPI2::Interface* pInterface = NULL;BGAPI2::Device* pDevice = NULL;BGAPI2::ImageProcessor* pImageProcessor = NULL;BGAPI2::DataStreamList *datastreamList = NULL;BGAPI2::DataStream * pDataStream = NULL;BGAPI2::String sDataStreamID;BGAPI2::BufferList *bufferList = NULL;BGAPI2::Buffer * pBuffer = NULL;BGAPI2::String sBufferID;int returncode = 0;std::string sComponent = "ADOLP";bool bBufferedLog = true;std::cout << std::endl;std::cout << "###########################################################" << std::endl;std::cout << "# PROGRAMMER'S GUIDE Example 020_Polarized_SinglePart.cpp #" << std::endl;std::cout << "###########################################################" << std::endl;std::cout << std::endl << std::endl;static const Argument argumentList[] = {{ &sComponent, "c", "component", false, argumentString,    0, "<component>",  "enable component (Intensity/AOP/DOLP/ADOLP)" },{ NULL,        "o", "offsetAOP", false, argumentAopOffset, 0, "<aop offset>", "angle of polarization offset" },};parseArguments(argumentList, sizeof(argumentList) / sizeof(argumentList[0]), argc, argv);// Check if the polarisation format provided as command line parameter is a valid polarisation formattry{pImageProcessor = new BGAPI2::ImageProcessor();// Create dummy image to check if requested component is availablechar dummyBuffer[1];BGAPI2::Image* pImage = pImageProcessor->CreateImage(1, 1, "BaumerPolarized8", dummyBuffer, sizeof(dummyBuffer));BGAPI2::Node* pComponentSelector = pImage->GetNode("ComponentSelector");pComponentSelector->SetValue(sComponent.c_str());pImage->Release();}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;std::cout << std::endl << "Component '" << sComponent << "' not supported" << std::endl;std::cout << std::endl << "Supported Formats are Intensity, AOP, DOP and ADOLP" << std::endl;std::cout << std::endl << "End" << std::endl << "Input any number to close the program:";int endKey = 0;std::cin >> endKey;ReleaseAllResources(pSystem, pInterface, pDevice, pDataStream, pImageProcessor);return returncode;}// Find and open the first polarisation cameraDeviceMatch match = { NULL, NULL, NULL };std::stringstream bufferedLog;const int code = GetFirstDevice(&match, NULL, NULL, PolarizationDeviceFilter, bBufferedLog ? bufferedLog : std::cout);pSystem    = match.pSystem;pInterface = match.pInterface;pDevice    = match.pDevice;if ((code != 0) || (pDevice == NULL)){// Error or no device foundif (bBufferedLog != false){// Display full device searchstd::cout << bufferedLog.str();}returncode = (returncode == 0) ? code : returncode;if (returncode == 0){std::cout << " No Polarized Device found " << sDataStreamID << std::endl;}std::cout << std::endl << "End" << std::endl << "Input any number to close the program:";int endKey = 0;std::cin >> endKey;ReleaseAllResources(pSystem, pInterface, pDevice, pDataStream, pImageProcessor);return returncode;}GetDeviceInfo(std::cout, pDevice, false);/* Determine the polarized pixel format for processingAs the camera sends the raw polarized data as a Mono8/10/12 pixelformat we need to pick thecorresponding Baumer polarized pixelformat depending on the camera setting for thecalculation of the polarized image.*/std::string sPixelFormatRaw = "";try {BGAPI2::String sPixelFormat = pDevice->GetRemoteNode("PixelFormat")->GetValue();if (sPixelFormat == "Mono8"){sPixelFormatRaw = "BaumerPolarized8";}else if (sPixelFormat == "Mono10"){sPixelFormatRaw = "BaumerPolarized10";}else if (sPixelFormat == "Mono12"){sPixelFormatRaw = "BaumerPolarized12";}else if (sPixelFormat == "Mono12p"){sPixelFormatRaw = "BaumerPolarized12p";}else{std::cout << " Pixel format not supported" << sDataStreamID << std::endl;}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}if (sPixelFormatRaw == ""){returncode = (returncode == 0) ? 1 : returncode;std::cout << std::endl << "End" << std::endl << "Input any number to close the program:";int endKey = 0;std::cin >> endKey;ReleaseAllResources(pSystem, pInterface, pDevice, pDataStream, pImageProcessor);return returncode;}std::cout << "DEVICE PARAMETER SETUP" << std::endl;std::cout << "######################" << std::endl << std::endl;// Set angle of polarization offset to device, if command line parameter passedif (g_bAopOffset){try{BGAPI2::Node* const pAngleOfPolarizationOffset = pDevice->GetRemoteNode("CalibrationAngleOfPolarizationOffset");pAngleOfPolarizationOffset->SetDouble(g_aopOffset);std::cout << "         AngleOfPolarizationOffset:  " << pAngleOfPolarizationOffset->GetValue() << std::endl;}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}}try{// Set trigger mode to off (FreeRun)pDevice->GetRemoteNode("TriggerMode")->SetString("Off");std::cout << "         TriggerMode:             " << pDevice->GetRemoteNode("TriggerMode")->GetValue() << std::endl;std::cout << std::endl;}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}std::cout << "IMAGE PROCESSOR SETUP" << std::endl;std::cout << "#####################" << std::endl << std::endl;// Configure the Image Processor to use the calibration values from the camera devicetry{SetDeviceCalibrationToImageProcessor(pDevice, pImageProcessor);}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}std::cout << std::endl << std::endl;std::cout << "DATA STREAM LIST" << std::endl;std::cout << "################" << std::endl << std::endl;try{// Get information for all available data streamsdatastreamList = pDevice->GetDataStreams();datastreamList->Refresh();std::cout << "5.1.8   Detected datastreams:     " << datastreamList->size() << std::endl;for (DataStreamList::iterator dstIterator = datastreamList->begin(); dstIterator != datastreamList->end(); dstIterator++){std::cout << "  5.2.4   DataStream ID:          " << dstIterator->first << std::endl << std::endl;}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}std::cout << "DATA STREAM" << std::endl;std::cout << "###########" << std::endl << std::endl;// Open the first datastreamtry{for (DataStreamList::iterator dstIterator = datastreamList->begin(); dstIterator != datastreamList->end(); dstIterator++){std::cout << "5.1.9   Open first datastream " << std::endl;std::cout << "          DataStream ID:          " << dstIterator->first << std::endl << std::endl;dstIterator->second->Open();sDataStreamID = dstIterator->first;std::cout << "        Opened datastream - NodeList Information " << std::endl;std::cout << "          StreamAnnounceBufferMinimum:  " << dstIterator->second->GetNode("StreamAnnounceBufferMinimum")->GetValue() << std::endl;if( dstIterator->second->GetTLType() == "GEV" ){std::cout << "          StreamDriverModel:            " << dstIterator->second->GetNode("StreamDriverModel")->GetValue() << std::endl;}std::cout << "  " << std::endl;break;}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}if (sDataStreamID == ""){std::cout << " No DataStream found " << sDataStreamID << std::endl;std::cout << std::endl << "End" << std::endl << "Input any number to close the program:";int endKey = 0;std::cin >> endKey;ReleaseAllResources(pSystem, pInterface, pDevice, pDataStream, pImageProcessor);return returncode;}else{pDataStream = (*datastreamList)[sDataStreamID];}std::cout << "BUFFER LIST" << std::endl;std::cout << "###########" << std::endl << std::endl;try{// get the BufferListbufferList = pDataStream->GetBufferList();// allocate 4 buffers using internal buffer modefor(int i = 0; i < 4; i++){pBuffer = new BGAPI2::Buffer();bufferList->Add(pBuffer);}std::cout << "5.1.10   Announced buffers:       " << bufferList->GetAnnouncedCount() << " using " << pBuffer->GetMemSize() * bufferList->GetAnnouncedCount() << " [bytes]" << std::endl;}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}try{for (BufferList::iterator bufIterator = bufferList->begin(); bufIterator != bufferList->end(); bufIterator++){bufIterator->second->QueueBuffer();}std::cout << "5.1.11   Queued buffers:          " << bufferList->GetQueuedCount() << std::endl;}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}std::cout << " " << std::endl;std::cout << "CAMERA START" << std::endl;std::cout << "############" << std::endl << std::endl;// Start DataStream acquisitiontry{pDataStream->StartAcquisitionContinuous();std::cout << "5.1.12   DataStream started " << std::endl;}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}// Start aquisition from camera devicetry{std::cout << "5.1.12   " << pDevice->GetModel() << " started " << std::endl;pDevice->GetRemoteNode("AcquisitionStart")->Execute();}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}// Capture 12 imagesstd::cout << " " << std::endl;std::cout << "CAPTURE 12 IMAGES BY IMAGE POLLING" << std::endl;std::cout << "##################################" << std::endl << std::endl;// Create the image object to store the calculated polarisation dataBGAPI2::Image* pImagePolarized = NULL;try{// Set to true to save result of the first captured image as a Baumer RAW imagebool bSaveBrw = true;for (int i = 0; i < 12; i++){BGAPI2::Buffer* pBufferFilled = pDataStream->GetFilledBuffer(1000); // timeout 1000 msecif (pBufferFilled == NULL){std::cout << "Error: Buffer Timeout after 1000 msec" << std::endl;}else{try{if (pBufferFilled->GetIsIncomplete() == true){std::cout << "Error: Image is incomplete" << std::endl;}else if (pBufferFilled->GetImagePresent() != true){std::cout << "Error: Image not present" << std::endl;}else{// get information about the image from the buffer objectbo_uint width = static_cast<bo_uint>(pBufferFilled->GetWidth());bo_uint height = static_cast<bo_uint>(pBufferFilled->GetHeight());void* pBufferData = pBufferFilled->GetMemPtr();bo_uint64 bufferDataSize = pBufferFilled->GetMemSize();bo_uint64 imageOffset = pBufferFilled->GetImageOffset();bo_uint64 imageDataSize = (bufferDataSize > imageOffset) ? (bufferDataSize - imageOffset) : 0;void* pImageData = reinterpret_cast<char*>(pBufferData) + imageOffset;std::cout << " Image " << std::setw(5) << pBufferFilled->GetFrameID() << " received in memory address " << std::hex << pBufferData << std::dec << std::endl;/* For the first image, a new image object is created, all further images reuse the object andtherefore just initialize it with new data */if (pImagePolarized == NULL){pImagePolarized = pImageProcessor->CreateImage(width, height, sPixelFormatRaw.c_str(), pImageData, imageDataSize);// Enable the component to be calculated, disable all othersEnableSingleComponent(pImagePolarized, sComponent);}else{pImagePolarized->Init(width, height, sPixelFormatRaw.c_str(), pImageData, imageDataSize);/* As the pixel format is the same for all images captured, the enabled components and the active component selectorare preserved, so you don't need to enable components on every image. */}// Calculate the required Polarisation format using a direct transformation from raw polarized image.BGAPI2::Image* pComponent = pImageProcessor->CreateTransformedImage(pImagePolarized, (sComponent != "ADOLP") ? "Mono8" : "RGB8");std::cout << "  component image: " << pComponent->GetNode("ComponentSelector")->GetValue().get() << std::endl;if (bSaveBrw) {std::string sFilename = sComponent + ".brw";pComponent->GetNode("SaveBrw")->SetValue(sFilename.c_str());}pComponent->Release();bSaveBrw = false;}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}}if (pBufferFilled){// Queue buffer againpBufferFilled->QueueBuffer();}}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}std::cout << " " << std::endl;if (pImagePolarized){try{pImagePolarized->Release();}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}}std::cout << "CAMERA STOP" << std::endl;std::cout << "###########" << std::endl << std::endl;// Stop the cameratry{if (pDevice->GetRemoteNodeList()->GetNodePresent("AcquisitionAbort")){pDevice->GetRemoteNode("AcquisitionAbort")->Execute();std::cout << "5.1.12   " << pDevice->GetModel() << " aborted " << std::endl;}pDevice->GetRemoteNode("AcquisitionStop")->Execute();std::cout << "5.1.12   " << pDevice->GetModel() << " stopped " << std::endl;std::cout << std::endl;BGAPI2::String sExposureNodeName = "";if (pDevice->GetRemoteNodeList()->GetNodePresent("ExposureTime")){sExposureNodeName = "ExposureTime";}else if (pDevice->GetRemoteNodeList()->GetNodePresent("ExposureTimeAbs")){sExposureNodeName = "ExposureTimeAbs";}std::cout << "         ExposureTime:                   " << std::fixed << std::setprecision(0) << pDevice->GetRemoteNode(sExposureNodeName)->GetDouble() << " [" << pDevice->GetRemoteNode(sExposureNodeName)->GetUnit() << "]" << std::endl;if (pDevice->GetTLType() == "GEV"){if(pDevice->GetRemoteNodeList()->GetNodePresent("DeviceStreamChannelPacketSize"))std::cout << "         DeviceStreamChannelPacketSize:  " << pDevice->GetRemoteNode("DeviceStreamChannelPacketSize")->GetInt() << " [bytes]" << std::endl;elsestd::cout << "         GevSCPSPacketSize:              " << pDevice->GetRemoteNode("GevSCPSPacketSize")->GetInt() << " [bytes]" << std::endl;std::cout << "         GevSCPD (PacketDelay):          " << pDevice->GetRemoteNode("GevSCPD")->GetInt() << " [tics]" << std::endl;}std::cout << std::endl;}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}// Stop DataStream acquisitiontry{if (pDataStream->GetTLType() == "GEV"){// DataStream Statisticstd::cout << "         DataStream Statistics " << std::endl;std::cout << "           DataBlockComplete:              " << pDataStream->GetNodeList()->GetNode("DataBlockComplete")->GetInt() << std::endl;std::cout << "           DataBlockInComplete:            " << pDataStream->GetNodeList()->GetNode("DataBlockInComplete")->GetInt() << std::endl;std::cout << "           DataBlockMissing:               " << pDataStream->GetNodeList()->GetNode("DataBlockMissing")->GetInt() << std::endl;std::cout << "           PacketResendRequestSingle:      " << pDataStream->GetNodeList()->GetNode("PacketResendRequestSingle")->GetInt() << std::endl;std::cout << "           PacketResendRequestRange:       " << pDataStream->GetNodeList()->GetNode("PacketResendRequestRange")->GetInt() << std::endl;std::cout << "           PacketResendReceive:            " << pDataStream->GetNodeList()->GetNode("PacketResendReceive")->GetInt() << std::endl;std::cout << "           DataBlockDroppedBufferUnderrun: " << pDataStream->GetNodeList()->GetNode("DataBlockDroppedBufferUnderrun")->GetInt() << std::endl;std::cout << "           Bitrate:                        " << pDataStream->GetNodeList()->GetNode("Bitrate")->GetDouble() << std::endl;std::cout << "           Throughput:                     " << pDataStream->GetNodeList()->GetNode("Throughput")->GetDouble() << std::endl;std::cout << std::endl;}if (pDataStream->GetTLType() == "U3V"){// DataStream Statisticstd::cout << "         DataStream Statistics " << std::endl;std::cout << "           GoodFrames:            " << pDataStream->GetNodeList()->GetNode("GoodFrames")->GetInt() << std::endl;std::cout << "           CorruptedFrames:       " << pDataStream->GetNodeList()->GetNode("CorruptedFrames")->GetInt() << std::endl;std::cout << "           LostFrames:            " << pDataStream->GetNodeList()->GetNode("LostFrames")->GetInt() << std::endl;std::cout << std::endl;}// BufferList Informationstd::cout << "         BufferList Information " << std::endl;std::cout << "           DeliveredCount:        " << bufferList->GetDeliveredCount() << std::endl;std::cout << "           UnderrunCount:         " << bufferList->GetUnderrunCount() << std::endl;std::cout << std::endl;pDataStream->StopAcquisition();std::cout << "5.1.12   DataStream stopped " << std::endl;bufferList->DiscardAllBuffers();}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}std::cout << std::endl;std::cout << "RELEASE" << std::endl;std::cout << "#######" << std::endl << std::endl;// Release buffersstd::cout << "5.1.13   Releasing the resources " << std::endl;try{while (bufferList->size() > 0){pBuffer = bufferList->begin()->second;bufferList->RevokeBuffer(pBuffer);delete pBuffer;}std::cout << "         buffers after revoke:    " << bufferList->size() << std::endl;ReleaseAllResources(pSystem, pInterface, pDevice, pDataStream, pImageProcessor);}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;}std::cout << std::endl;std::cout << "End" << std::endl << std::endl;std::cout << "Input any number to close the program:";int endKey = 0;std::cin >> endKey;return returncode;
}//------------------------------------------------------------------------------
/* Setup the Baumer GAPI to calculate the requested polarization component from the rawpolarized image */
void EnableSingleComponent(BGAPI2::Image* const pImage, const std::string sComponent)
{BGAPI2::Node* pComponentSelector = pImage->GetNode("ComponentSelector");BGAPI2::Node* pComponentEnable = pImage->GetNode("ComponentEnable");BGAPI2::NodeMap*pComponents = pComponentSelector->GetEnumNodeList();const bo_uint64 componentsAvailable = pComponents->GetNodeCount();for (bo_uint64 i = 0; i < componentsAvailable; i++) {pComponentSelector->SetInt(i);pComponentEnable->SetBool(sComponent == pComponentSelector->GetValue().get());}
}//------------------------------------------------------------------------------
/* Read the polarization calibration matrix and angle of polarization offset from the cameraused to calculated the required polarisation data in the Baumer GAPI image processor */
void SetDeviceCalibrationToImageProcessor(BGAPI2::Device* const pDevice, BGAPI2::ImageProcessor* const pImageProcessor)
{struct CalibrationEntry {const char* pSelector;unsigned int row;unsigned int col;};static const CalibrationEntry calibrationEntry[] = {{ "Gain00", 0, 0 },{ "Gain01", 0, 1 },{ "Gain02", 0, 2 },{ "Gain03", 0, 3 },{ "Gain10", 1, 0 },{ "Gain11", 1, 1 },{ "Gain12", 1, 2 },{ "Gain13", 1, 3 },{ "Gain20", 2, 0 },{ "Gain21", 2, 1 },{ "Gain22", 2, 2 },{ "Gain23", 2, 3 },};BGAPI2::NodeMap* const pDeviceMap = pDevice->GetRemoteNodeList();BGAPI2::Node* pDeviceCalibrationMatrixValueSelector = pDeviceMap->GetNode("CalibrationMatrixValueSelector");BGAPI2::Node* pDeviceCalibrationMatrixValue = pDeviceMap->GetNode("CalibrationMatrixValue");BGAPI2::Node* pCalibrationMatrixRowSelector = pImageProcessor->GetNode("CalibrationMatrixRowSelector");BGAPI2::Node* pCalibrationMatrixColSelector = pImageProcessor->GetNode("CalibrationMatrixColumnSelector");BGAPI2::Node* pCalibrationMatrixValue = pImageProcessor->GetNode("CalibrationMatrixValue");const std::streamsize precision = std::cout.precision(5);const std::ios_base::fmtflags flags = std::cout.flags();std::cout.setf(std::ios_base::fixed | std::ios_base::right);// Set calibration matrix from device to image processorfor (unsigned int i = 0; i < sizeof(calibrationEntry) / sizeof(calibrationEntry[0]); i++){pDeviceCalibrationMatrixValueSelector->SetValue(calibrationEntry[i].pSelector);double value = pDeviceCalibrationMatrixValue->GetDouble();std::cout << "      CalibrationMatrix " << calibrationEntry[i].pSelector << ": "<< std::setw(8) << value << std::endl;pCalibrationMatrixRowSelector->SetInt(calibrationEntry[i].row);pCalibrationMatrixColSelector->SetInt(calibrationEntry[i].col);pCalibrationMatrixValue->SetDouble(value);}std::cout.precision(2);// Set angle of polarisation offset from device to image processorconst double aopOffset = pDeviceMap->GetNode("CalibrationAngleOfPolarizationOffset")->GetDouble();std::cout << "      CalibrationAngleOfPolarizationOffset: " << std::setw(6) << aopOffset << std::endl << std::endl;pImageProcessor->GetNode("CalibrationAngleOfPolarizationOffset")->SetDouble(aopOffset);std::cout.precision(precision);std::cout.flags(flags);
}//------------------------------------------------------------------------------
/* Get the Angle Offset from the command line parameter (if provided) and use it for the calculation */
void argumentAopOffset(const Argument& argument, const ArgumentMode mode, const char* const pParam)
{if (mode == eArgumentInit){g_aopOffset = 0.0;g_bAopOffset = false;}else{double value = 0.0;
#if _WIN32if ((pParam != NULL) && (sscanf_s(pParam, "%lf", &value) == 1))
#elseif ((pParam != NULL) && (sscanf(pParam, "%lf", &value) == 1))
#endif{g_aopOffset = value;g_bAopOffset = true;}}
}//------------------------------------------------------------------------------
/* Helper to filter found cameras devices and select only polarization camera for this example */
bool PolarizationDeviceFilter(BGAPI2::Device* const pDevice)
{if (pDevice->GetRemoteNodeList()->GetNodePresent("ComponentSelector")){if (pDevice->GetRemoteNode("ComponentSelector")->GetValue() == "PolarizedRaw"){return true;}}return false;
}//------------------------------------------------------------------------------
int GetFirstDevice(DeviceMatch* const pMatch, bool(*pSystemFilter)(BGAPI2::System* pSystem), bool(*pInterfaceFilter)(BGAPI2::Interface* pInterface), bool(*pDeviceFilter)(BGAPI2::Device* pDevice), std::ostream& log)
{int returncode = 0;log << "SYSTEM LIST" << std::endl;log << "###########" << std::endl << std::endl;try {BGAPI2::SystemList* pSystemList = SystemList::GetInstance();// Counting available systems (TL producers)pSystemList->Refresh();log << "5.1.2   Detected systems:  " << pSystemList->size() << std::endl;// System device informationfor (SystemList::iterator sysIterator = pSystemList->begin(); sysIterator != pSystemList->end(); sysIterator++){BGAPI2::System* const pSystem = sysIterator->second;log << "  5.2.1   System Name:     " << pSystem->GetFileName() << std::endl;log << "          System Type:     " << pSystem->GetTLType() << std::endl;log << "          System Version:  " << pSystem->GetVersion() << std::endl;log << "          System PathName: " << pSystem->GetPathName() << std::endl << std::endl;}for (SystemList::iterator sysIterator = pSystemList->begin(); sysIterator != pSystemList->end(); sysIterator++){log << "SYSTEM" << std::endl;log << "######" << std::endl << std::endl;BGAPI2::System* const pSystem = sysIterator->second;pMatch->pSystem = pSystem;try{pSystem->Open();log << "5.1.3   Open next system " << std::endl;log << "  5.2.1   System Name:     " << pSystem->GetFileName() << std::endl;log << "          System Type:     " << pSystem->GetTLType() << std::endl;log << "          System Version:  " << pSystem->GetVersion() << std::endl;log << "          System PathName: " << pSystem->GetPathName() << std::endl << std::endl;log << "        Opened system - NodeList Information " << std::endl;log << "          GenTL Version:   " << pSystem->GetNode("GenTLVersionMajor")->GetValue() << "." << pSystem->GetNode("GenTLVersionMinor")->GetValue() << std::endl << std::endl;const char* pCloseSystemReason = "???";if ((pSystemFilter != NULL) && (pSystemFilter(pSystem) == false)){pCloseSystemReason = "skipped";}else{log << "INTERFACE LIST" << std::endl;log << "##############" << std::endl << std::endl;try{BGAPI2::InterfaceList* pInterfaceList = pSystem->GetInterfaces();// Count available interfacespInterfaceList->Refresh(100);  // timeout of 100 mseclog << "5.1.4   Detected interfaces: " << pInterfaceList->size() << std::endl;// Interface informationfor (InterfaceList::iterator ifIterator = pInterfaceList->begin(); ifIterator != pInterfaceList->end(); ifIterator++){BGAPI2::Interface* const pInterface = ifIterator->second;log << "  5.2.2   Interface ID:      " << ifIterator->first << std::endl;log << "          Interface Type:    " << pInterface->GetTLType() << std::endl;log << "          Interface Name:    " << pInterface->GetDisplayName() << std::endl << std::endl;}log << "INTERFACE" << std::endl;log << "#########" << std::endl << std::endl;for (InterfaceList::iterator ifIterator = pInterfaceList->begin(); ifIterator != pInterfaceList->end(); ifIterator++){try{// Open the next interface in the listBGAPI2::Interface* const pInterface = ifIterator->second;pMatch->pInterface = pInterface;log << "5.1.5   Open interface " << std::endl;log << "  5.2.2   Interface ID:      " << ifIterator->first << std::endl;log << "          Interface Type:    " << pInterface->GetTLType() << std::endl;log << "          Interface Name:    " << pInterface->GetDisplayName() << std::endl;pInterface->Open();const char* pReason = "???";if ((pInterfaceFilter != NULL) && (pInterfaceFilter(pInterface) == false)){pReason = "skipped";}else{// Search for any camera is connected to this interfaceBGAPI2::DeviceList* const pDeviceList = pInterface->GetDevices();pDeviceList->Refresh(100);if (pDeviceList->size() == 0){pReason = "no camera found";}else{log << "   " << std::endl;log << "        Opened interface - NodeList Information " << std::endl;if (pInterface->GetTLType() == "GEV"){log << "          GevInterfaceSubnetIPAddress: " << pInterface->GetNode("GevInterfaceSubnetIPAddress")->GetValue() << std::endl;log << "          GevInterfaceSubnetMask:      " << pInterface->GetNode("GevInterfaceSubnetMask")->GetValue() << std::endl;}if (pInterface->GetTLType() == "U3V"){// log << "          NodeListCount:     " << pInterface->GetNodeList()->GetNodeCount() << std::endl;}// Open the first matching camera in the listtry{// Counting available cameraslog << "5.1.6   Detected devices:         " << pDeviceList->size() << std::endl;// Device information before openingfor (DeviceList::iterator devIterator = pDeviceList->begin(); devIterator != pDeviceList->end(); devIterator++){BGAPI2::Device* const pDevice = devIterator->second;log << "  5.2.3   Device DeviceID:        " << pDevice->GetID() << std::endl;log << "          Device Model:           " << pDevice->GetModel() << std::endl;log << "          Device SerialNumber:    " << pDevice->GetSerialNumber() << std::endl;log << "          Device Vendor:          " << pDevice->GetVendor() << std::endl;log << "          Device TLType:          " << pDevice->GetTLType() << std::endl;log << "          Device AccessStatus:    " << pDevice->GetAccessStatus() << std::endl;log << "          Device UserID:          " << pDevice->GetDisplayName() << std::endl << std::endl;}for (DeviceList::iterator devIterator = pDeviceList->begin(); devIterator != pDeviceList->end(); devIterator++){try{BGAPI2::Device* const pDevice = devIterator->second;pMatch->pDevice = pDevice;GetDeviceInfo(log, pDevice, true);if ((pDeviceFilter == NULL) || (pDeviceFilter(pDevice) == true)){return returncode;}log << "        Close device (skipped) " << std::endl << std::endl;pDevice->Close();pMatch->pDevice = NULL;}catch (BGAPI2::Exceptions::ResourceInUseException& ex){returncode = (returncode == 0) ? 1 : returncode;log << " Device  " << devIterator->first << " already opened " << std::endl;log << " ResourceInUseException: " << ex.GetErrorDescription() << std::endl;}catch (BGAPI2::Exceptions::AccessDeniedException& ex){returncode = (returncode == 0) ? 1 : returncode;log << " Device  " << devIterator->first << " already opened " << std::endl;log << " AccessDeniedException " << ex.GetErrorDescription() << std::endl;}}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;log << "ExceptionType:    " << ex.GetType() << std::endl;log << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;log << "in function:      " << ex.GetFunctionName() << std::endl;}pReason = "no camera match";}}log << "5.1.13   Close interface (" << pReason << ") " << std::endl << std::endl;pInterface->Close();pMatch->pInterface = NULL;}catch (BGAPI2::Exceptions::ResourceInUseException& ex){returncode = (returncode == 0) ? 1 : returncode;log << " Interface " << ifIterator->first << " already opened " << std::endl;log << " ResourceInUseException: " << ex.GetErrorDescription() << std::endl;}}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;log << "ExceptionType:    " << ex.GetType() << std::endl;log << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;log << "in function:      " << ex.GetFunctionName() << std::endl;}pCloseSystemReason = "no camera match";}log << "        Close system (" << pCloseSystemReason << ") " << std::endl << std::endl;pSystem->Close();pMatch->pSystem = NULL;}catch (BGAPI2::Exceptions::ResourceInUseException& ex){returncode = (returncode == 0) ? 1 : returncode;log << " System " << sysIterator->first << " already opened " << std::endl;log << " ResourceInUseException: " << ex.GetErrorDescription() << std::endl;}}}catch (BGAPI2::Exceptions::IException& ex){returncode = (returncode == 0) ? 1 : returncode;log << "ExceptionType:    " << ex.GetType() << std::endl;log << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;log << "in function:      " << ex.GetFunctionName() << std::endl;}return returncode;
}//------------------------------------------------------------------------------
/* Helper to Display various information of the camera */
void GetDeviceInfo(std::ostream& log, BGAPI2::Device* const pDevice, const bool bOpen)
{log << "5.1.7   Open device " << std::endl;log << "          Device DeviceID:        " << pDevice->GetID() << std::endl;log << "          Device Model:           " << pDevice->GetModel() << std::endl;log << "          Device SerialNumber:    " << pDevice->GetSerialNumber() << std::endl;log << "          Device Vendor:          " << pDevice->GetVendor() << std::endl;log << "          Device TLType:          " << pDevice->GetTLType() << std::endl;log << "          Device AccessStatus:    " << pDevice->GetAccessStatus() << std::endl;log << "          Device UserID:          " << pDevice->GetDisplayName() << std::endl << std::endl;if (bOpen)pDevice->Open();log << "        Opened device - RemoteNodeList Information " << std::endl;log << "          Device AccessStatus:    " << pDevice->GetAccessStatus() << std::endl;BGAPI2::NodeMap* const pRemoteNodeList = pDevice->GetRemoteNodeList();// Serial numberif (pRemoteNodeList->GetNodePresent("DeviceSerialNumber"))log << "          DeviceSerialNumber:     " << pRemoteNodeList->GetNode("DeviceSerialNumber")->GetValue() << std::endl;else if (pRemoteNodeList->GetNodePresent("DeviceID"))log << "          DeviceID (SN):          " << pRemoteNodeList->GetNode("DeviceID")->GetValue() << std::endl;elselog << "          SerialNumber:           Not Available " << std::endl;// Display DeviceManufacturerInfoif (pRemoteNodeList->GetNodePresent("DeviceManufacturerInfo"))log << "          DeviceManufacturerInfo: " << pRemoteNodeList->GetNode("DeviceManufacturerInfo")->GetValue() << std::endl;// Display DeviceFirmwareVersion or DeviceVersionif (pRemoteNodeList->GetNodePresent("DeviceFirmwareVersion"))log << "          DeviceFirmwareVersion:  " << pRemoteNodeList->GetNode("DeviceFirmwareVersion")->GetValue() << std::endl;else if (pRemoteNodeList->GetNodePresent("DeviceVersion"))log << "          DeviceVersion:          " << pRemoteNodeList->GetNode("DeviceVersion")->GetValue() << std::endl;elselog << "          DeviceVersion:          Not Available " << std::endl;if (pDevice->GetTLType() == "GEV") {log << "          GevCCP:                 " << pRemoteNodeList->GetNode("GevCCP")->GetValue() << std::endl;log << "          GevCurrentIPAddress:    " << pRemoteNodeList->GetNode("GevCurrentIPAddress")->GetValue() << std::endl;log << "          GevCurrentSubnetMask:   " << pRemoteNodeList->GetNode("GevCurrentSubnetMask")->GetValue() << std::endl;}log << std::endl;
}//------------------------------------------------------------------------------
/* Release all allocated resources */
int ReleaseAllResources(BGAPI2::System* pSystem, BGAPI2::Interface* pInterface, BGAPI2::Device* pDevice, BGAPI2::DataStream* pDataStream, BGAPI2::ImageProcessor* pImageProcessor)
{try{if (pDataStream)pDataStream->Close();if (pImageProcessor){delete pImageProcessor;}if (pDevice){pDevice->Close();}if (pInterface){pInterface->Close();}if (pSystem){pSystem->Close();}BGAPI2::SystemList::ReleaseInstance();}catch (BGAPI2::Exceptions::IException& ex){std::cout << "ExceptionType:    " << ex.GetType() << std::endl;std::cout << "ErrorDescription: " << ex.GetErrorDescription() << std::endl;std::cout << "in function:      " << ex.GetFunctionName() << std::endl;return 1;}return 0;
}


偏振功能的优点

1、减少闪亮或光亮表面的眩光和反射,提高对比度以更好地检测缺陷或表面特征,并加强颜色区分。

2、它们还可以帮助提高汽车、电子和制造业等行业的自动检测和质量控制过程的准确性和速度。

3、偏振照相机在户外应用中很有用,因为那里有大量的阳光或大气雾霾,否则可能会干扰图像的清晰度。


偏振工业相机相对于普通工业相机的优势


偏光工业相机与普通工业相机相比有几个优点。

1、它们使用偏振滤光片来捕捉在单一方向上振动的光波,减少眩光和闪亮表面的反射。这导致了更清晰和更精确的图像,使其更容易识别高反射表面的缺陷或异常情况。

2、偏光相机还提供更好的对比度和颜色精度,允许精确的颜色测量和分析。

3、偏光相机可以在恶劣的环境条件下使用,并能捕捉到普通相机难以看到的物体的图像。


Baumer偏振相机的行业应用

偏光工业相机通常用于各种工业应用,如质量控制、缺陷检查、材料分析和表面检查。

它们有助于消除眩光和反射,提高玻璃、塑料、金属等各种材料的图像对比度和准确性。

偏光工业相机在检测隐藏的缺陷或污染物、识别材料中的应力点和检查隐藏结构方面也很有用。它们通常用于汽车、航空航天、电子和制造业等行业。

下面简单介绍几个能体现出偏振特性的行业应用:

  

  

  


相关文章:

Baumer工业相机堡盟相机如何使用偏振功能(偏振相机优点和行业应用)(C#)

项目场景&#xff1a; Baumer工业相机堡盟相机是一种高性能、高质量的工业相机&#xff0c;可用于各种应用场景&#xff0c;如物体检测、计数和识别、运动分析和图像处理。 Baumer的万兆网相机拥有出色的图像处理性能&#xff0c;可以实时传输高分辨率图像。此外&#xff0…...

无损以太网与网络拥塞管理(PFC、ECN)

无损以太网 无损以太网&#xff08;Lossless Ethernet&#xff09;是一种专门用于数据中心网络的网络技术&#xff0c;旨在提供低延迟、高吞吐量和可靠性的传输服务。它是在传统以太网的基础上进行了扩展&#xff0c;引入了新的拥塞管理机制&#xff0c;以避免数据包丢失和网络…...

爬虫大全:从零开始学习爬虫的基础知识

爬虫是一种自动获取网站信息的技术&#xff0c;它可以帮助我们快速地抓取海量网站数据&#xff0c;进行统计分析、挖掘和展示。本文旨在为初学者详细介绍爬虫的基础知识&#xff0c;包括&#xff1a;爬虫原理、爬虫分类、网页结构分析、爬虫工具和技能、爬虫实践示范&#xff0…...

【Python】【进阶篇】21、Django Admin数据表可视化

目录 21、Django Admin数据表可视化1. 创建超级用户2. 将Model注册到管理后台1)在admin.py文件中声明 3. django_admin_log数据表 21、Django Admin数据表可视化 在《Django Admin后台管理系统》介绍过 Django 的后台管理系统是为了方便站点管理人员对数据表进行操作。Django …...

【MySQL约束】数据管理实用指南

1、数据库约束的认识 数据库约束的概念&#xff1a;数据库的约束是关系型数据库的一个重要的功能&#xff0c;它提供了一种“校验数据”合法性的机制&#xff0c;能够保证数据的“完整性”、“准确性”和“正确性” 数据库的约束&#xff1a; not null&#xff1a;不能存储 nul…...

2023年第二十届五一数学建模竞赛C题:“双碳”目标下低碳建筑研究-思路详解与代码答案

该题对于模型的考察难度较低&#xff0c;难度在于数据的搜集以及选取与处理。 这里推荐数据查询的网站&#xff1a;中国碳核算数据库&#xff08;CEADs&#xff09; https://www.ceads.net.cn/ 国家数据 国家数据​data.stats.gov.cn/easyquery.htm?cnC01 以及各省市《统…...

Vue父组件生命周期和子组件生命周期触发顺序

加载渲染过程 父 beforeCreate -> 父 created -> 父 beforeMount -> 子 beforeCreate -> 子 created -> 子 beforeMount -> 子 mounted -> 父 mounted子组件更新过程 父 beforeUpdate -> 子 beforeUpdate -> 子 updated -> 父 updated父组件更新…...

DevOps工程师 - 面试手册

DevOps工程师 - 面试手册 岗位概述 DevOps工程师是一种专注于提高软件开发和运维团队协作、提高软件产品交付速度和质量的职位。这种角色要求具备跨领域的知识&#xff0c;以便在开发和运维过程中建立起稳定、可靠的基础设施和自动化流程。 常见的职位招聘描述 负责设计、实…...

Netty内存管理--内存池空间规格化SizeClasses

一、规格化 内存池类似于一个内存零售商, 从操作系统中申请一整块内存, 然后对其进行合理分割, 将分割后的小内存返回给程序。这里存在3个尺寸: 分割尺寸: 底层内存管理的基本单位, 比如常见的以页为单位分配, 但是页的大小是灵活的;申请尺寸: 内存使用者希望申请到的内存大小…...

数据结构刷题(三十):96不同的二叉搜索树、01背包问题理论、416分割等和子集

一、96. 不同的二叉搜索树 1.这个题比较难想递推公式&#xff0c; dp[3]&#xff0c;就是元素1为头结点搜索树的数量 元素2为头结点BFS的数量 元素3为头结点BFS的数量 元素1为头结点搜索树的数量 右子树有2个元素的搜索树数量 * 左子树有0个元素的搜索树数量 元素2为头结…...

bash的进程与欢迎讯息自定义

在bash shell中,可以通过多种方式自定义欢迎讯息和提示符。主要有: 修改/etc/profile文件: 该文件在用户登录后执行,定义了PROMPT_COMMAND和PS1提示符。可以修改其内容实现自定义欢迎讯息和提示符。 例如,修改为: bash PROMPT_COMMANDecho -e "\nWelcome to My Bash She…...

本周大新闻|苹果首款MR没有主打卖点;Meta认为AI是AR OS的基础

​本周XR大新闻&#xff0c;AR方面&#xff0c;苹果首款MR或没有主打卖点&#xff0c;反而尽可能支持更多App和服务&#xff1b;扎克伯格表示基于AI的AR眼镜操作系统是下一代计算平台的基础&#xff1b;微软芯片工程VP Jean Boufarhat加入Meta芯片团队&#xff1b;Humane展示了…...

Java中工具类Arrays、Collections、Objects

Arrays Arrays是Java中提供的一个针对数组操作的工具类&#xff0c;所有的方法都是静态的。 大致有这些常用的方法 sort()针对常用的基本数据类型&#xff0c;都能进行排序&#xff0c;byte、char、int、long、float、doubleparallelSort()并行排序&#xff0c;多线程排序&am…...

Docker安装Nginx/Python/Golang/Vscode【亲测可用】

一、docker安装nginx docker安装nginx&#xff0c;安装的是最新版本的&#xff1a;docker pull nginx:latest 创建一个容器&#xff1a;docker run --name my-nginx -p 80:80 -d nginx:latest 开启一个交互模式终端&#xff1a;docker exec -it my-nginx bash 创建django项…...

蓝桥杯2022年第十三届决赛真题-最大数字

蓝桥杯2022年第十三届决赛真题-最大数字 时间限制: 3s 内存限制: 320MB 题目描述 给定一个正整数 N。你可以对 N 的任意一位数字执行任意次以下 2 种操作&#xff1a; 将该位数字加 1。如果该位数字已经是 9&#xff0c;加 1 之后变成 0。 将该位数字减 1。如果该位数字已经…...

smbms项目搭建

目录 1.搭建一个maven web项目 2.配置Tomcat 3.测试项目是否能够跑起来 4.导入项目中会遇到的Jar包 5.项目结构搭建 6.项目实体类搭建 7.编写基础公共类 1.数据库配置文件 2.编写数据库的公共类 3.编写字符编码过滤器 3.1web配置注册 4.导入静态资源 1.搭建一个maven web项目 …...

进程/线程 状态模型详解

前言&#xff1a;最近操作系统复习到线程的状态模型&#xff08;也可以说进程的状态模型&#xff0c;本文直接用线程来说&#xff09;时候&#xff0c;网上查阅资料&#xff0c;发现很多文章都说的很不一样&#xff0c;有五状态模型、六状态模型、七状态模型.......虽然都是对的…...

数据结构与算法之队列: Leetcode 621. 任务调度器 (Typescript版)

任务调度器 https://leetcode.cn/problems/task-scheduler/ 描述 给你一个用字符数组 tasks 表示的 CPU 需要执行的任务列表。其中每个字母表示一种不同种类的任务。任务可以以任意顺序执行&#xff0c;并且每个任务都可以在 1 个单位时间内执行完。在任何一个单位时间&#…...

【报错】arXiv上传文章出现XXX.sty not found

笔者在overleaf上编译文章一切正常&#xff0c;但上传文章到arxiv时出现类似于如下报错&#xff1a; 一般情况下观察arxiv的编译log&#xff0c;不通过的原因&#xff0c;很多时候都是由于某一行导入了啥package&#xff0c;引起的报错&#xff1b;但是如果没有任何一个具体的…...

项目合同管理

项目合同管理的基本概念及分类、项目合同签订、项目合同管理以及项目合同索赔处理等内容 信息系统工程的建设过程实际上就是合同的执行和监控的过程 1、项目合同的概念及分类 合同法律关系&#xff1a;权力和义务关系 合同可以是书面形式、口头形式和其他形式 书面形式是指…...

聊聊ClickHouse向量化执行引擎-过滤操作

俄罗斯Yandex开发的ClickHouse是一款性能黑马的OLAP数据库&#xff0c;其对SIMD的灵活运用给其带来了难以置信的性能。本文我们聊聊它如何对过滤操作进行SIMD优化。 基本思想 1、有一个数组data&#xff0c;即ColumnVector::data&#xff0c;存放数据 2、使用uint8类型&#xf…...

数据可视化第二版-拓展-网约车分析案例

文章目录 数据可视化第二版-拓展-网约车分析案例竞赛介绍 1等奖作品-IT从业者张某某的作品结论过程数据和思考数据处理数据探索数据分析方法选择数据分析相关性分析转化率分析分析结论 完单数量分析分析结论 司机数量分析分析结论 时间分析每日订单分析 工作日各时段分析周六日…...

pytest - Getting Start

前言 项目开发中有很多的功能&#xff0c;通常开发人员需要对自己编写的代码进行自测&#xff0c;除了借助postman等工具进行测试外&#xff0c;还需要编写单元测试对开发的代码进行测试&#xff0c;通过单元测试来判断代码是否能够实现需求&#xff0c;本文介绍的pytest模块是…...

( 字符串) 205. 同构字符串 ——【Leetcode每日一题】

❓205. 同构字符串 难度&#xff1a;简单 给定两个字符串 s 和 t &#xff0c;判断它们是否是同构的。 如果 s 中的字符可以按某种映射关系替换得到 t &#xff0c;那么这两个字符串是同构的。 每个出现的字符都应当映射到另一个字符&#xff0c;同时不改变字符的顺序。不同…...

python+django+vue消防知识宣传网站

开发语言&#xff1a;Python 框架&#xff1a;django Python版本&#xff1a;python3.7.7 数据库&#xff1a;mysql 数据库工具&#xff1a;Navicat 开发软件&#xff1a;PyCharm 层随着移动应用技术的发展&#xff0c;越来越多的消防单位借助于移动手机、电脑完成生活中的事…...

彻底告别手动配置任务,魔改xxl-job!

分析 改造 1、接口调用 2、创建新注解 3、自动注册核心 4、自动装配 测试 测试后 XXL-Job是一款非常优秀的任务调度中间件&#xff0c;其轻量级、使用简单、支持分布式等优点&#xff0c;被广泛应用在我们的项目中&#xff0c;解决了不少定时任务的调度问题。不仅如此&a…...

【五一创作】Springboot+多环境+多数据源(MySQL+Phoenix)配置及查询(多知识点)

文章目录 1. 背景2. 技术点3 子模块依赖SpringBoot设置4. 多环境配置4.1 application.yml4.2 application-pro.yml 5. 多数据源配置5.1 yml配置5.2 自定义数据源在Java中配置5.2.1 PhoenixDataSourceConfig5.2.2 MysqlDataSourceConfig 6. 完整的Pom6. 测试6.1 Mapper配置6.2 方…...

Python小姿势 - 线程和进程:

线程和进程&#xff1a; Python里面线程是真正的并行执行&#xff0c;进程是可以并行执行的。 所谓进程&#xff0c;就是操作系统中执行一个程序的独立单元&#xff0c;它是系统进行资源分配和调度的基本单位。一个进程可以创建和撤销另一个进程&#xff0c;同一个进程内可以并…...

Mysql 锁

目录 0 课程视频 1 概述 1.1 多用户 并发访问 -> 为了数据一致性(多用户) 1.2 全局锁 数据库所有表 1.3 表级锁 每次操作 锁整张表 1.4 行级锁 每次操作 锁对应行 2 全局锁 ->锁后只读 -> 全库逻辑备份 2.1 阻塞DML /DDL 可DQL读 2.2 语法 2.2.1 加锁 flush…...

基于ssm的论坛系统的设计与实现【附源码】

基于ssm的论坛系统的设计与实现 摘 要 早期的网络论坛系统已经诞生一段时间&#xff0c;随着互联网技术的发展&#xff0c;它已经从最初的简单电子公告板系统变成了一种丰富的论坛系统社区模型。人们通过论坛系统进行信息的获取、发布和交流已经成为一种普遍的社交方式&#x…...

精密模具东莞网站建设/鸿星尔克网络营销

javascript的一个不足之处是不能处理二进制数据&#xff0c;于是node中引入了Buffer类型。这个类型以一个字节&#xff08;即8位&#xff09;为单位&#xff0c;给数据分配存储空间。它的使用类似于Array,但是与Array又有不同&#xff1a;Buffer在定义的时候必须明确知道其长度…...

湘潭做网站价格品牌磐石网络/培训报名

函数的基本使用函数的参数详解名称空间与作用域闭包函数装饰器2020.9.11小白学习&#xff0c;如有错误欢迎指点参考自egon大佬Python快速入门神器​www.zhihu.com函数使用函数的原因&#xff1a;所有功能的实现代码堆叠在一起&#xff0c;导致代码的组织结构不清晰&#xff0c;…...

做音乐网站需要版权么/百度识图在线识别

今天总结了一下spring中作用域scope的用法。在spring中作用域通过配置文件形式的用法如下。 1<bean id"role" class"spring.chapter2.maryGame.Role" scope"singleton"/>一. 在spring 中常用的作用域有单例模式&#xff08;singleton&…...

做b2c网站/童程童美少儿编程怎样收费

最近这几年购置的电脑几乎都安装了Windows 10&#xff0c;并且使用UEFI方式启动(UEFI即统一可扩展固件接口&#xff0c;用来定义操作系统与固件之间的软件界面&#xff0c;作为BIOS的替代方案)。UEFI启动和传统的BIOS启动不同&#xff0c;它不再支持实模式启动系统如DOS等。而传…...

发布网站建设需求的经验/色盲测试图第六版及答案大全

离我上次写的随笔到现在一年了, 日子真的好快. 又一年了. 一看内我收获了什么呢? 好像没有...... 有的只是现在以一年来到底做了什么的遗憾...... 转载于:https://www.cnblogs.com/Jeffrey/archive/2007/05/12/744125.html...

如何做网站服务器映射/bt磁力搜索

什么是WinRT&#xff1f; 首先WinRT是微软为了方便开发者编写Metro风格的程序而提供的一个开发平台。对于广大普通开发者而言&#xff0c;WinRT就是一堆Storage, Pickers, Controls&#xff0c;network&#xff0c;Media等组件的可供调用的API函数。开发者可以调用微软通过W…...