Configuration method and device of cameralink camera and storage medium

By acquiring and parsing the XML extension content of CameraLink cameras to generate serial port data, the problem of inconsistent CameraLink camera configuration parameters is solved, enabling convenient configuration and maintenance, and simplifying the process of supporting new cameras.

CN115665547BActive Publication Date: 2026-06-26HEFEI I TEK OPTOELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEFEI I TEK OPTOELECTRONICS CO LTD
Filing Date
2022-09-22
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

The configuration parameters of CameraLink cameras are not standardized enough, making development and maintenance inconvenient. In particular, when adding support for new cameras, the CLProtocol library needs to be modified, and there is a lack of a unified serial port data processing standard.

Method used

By sending commands to obtain standard XML and XML extension content, parsing and generating serial port data, and verifying the camera configuration status, only the camera's XML content needs to be modified, without modifying the CLProtocol library.

Benefits of technology

It achieves uniformity and convenience in CameraLink camera configuration functions, reduces the difficulty of software development and maintenance, and simplifies the process of supporting new cameras.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665547B_ABST
    Figure CN115665547B_ABST
Patent Text Reader

Abstract

The application discloses a configuration method and device of a CameraLink camera and a storage medium, and comprises the following steps: sending an instruction to the CameraLink camera to obtain standard XML and XML extension content; analyzing the XML extension content to obtain first data information; analyzing the standard XML based on a GenICam protocol to obtain second data information; combining the first data information and the second data information to generate serial port data, and sending the serial port data to the CameraLink camera; screening processing data returned by the CameraLink camera to obtain return data; and comparing the return data with the first data information to verify a configuration state of the CameraLink camera. The configuration method of the CameraLink camera can realize modification of a configuration function of the CameraLink camera by only modifying the camera, and the CLProtocol library does not need to be modified when new cameras are supported, thereby facilitating software maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CameraLink camera technology, and more specifically to a configuration method, apparatus and storage medium for a CameraLink camera. Background Technology

[0002] CameraLink cameras are industrial cameras that use the CameraLink interface. They are typically installed on production lines to capture images of products and work with image processing systems and algorithms on industrial control computers to inspect the products.

[0003] To cope with diverse production scenarios, industrial cameras typically have complex configuration parameters that can be configured by industrial control computers. To enable parameter configuration for different interfaces and camera types, most industrial cameras and their accompanying SDKs conform to the GenICam standard protocol. The GenICam protocol provides a method for configuring the camera by acquiring and parsing device XML, and then reading and writing the register addresses corresponding to the parameters.

[0004] CameraLink cameras do not have a register-based method, so the GenICam standard requires each industrial camera manufacturer to provide its own CLProtocol library to implement a method for determining registers and configuring the corresponding parameters of the registers using a serial port.

[0005] Existing methods reveal that adding, deleting, or modifying CameraLink camera parameter configuration requires changes not only to the camera and XML but also to the CLProtocol library. Adding support for new cameras also necessitates modifications to the CLProtocol library. Furthermore, the lack of a unified standard for processing serial port data creates difficulties in software development and maintenance when dealing with a wide variety of cameras. Summary of the Invention

[0006] The present invention proposes a configuration method for CameraLink cameras, which can solve the problems of inconsistent methods for configuring CameraLink camera parameters and inconvenient development and maintenance.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A method for configuring a CameraLink camera includes the following steps:

[0009] Send commands to the CameraLink camera to obtain standard XML and XML extension content;

[0010] Parse the XML extension content to obtain the first data information; based on the GenICam protocol, parse the standard XML to obtain the second data information;

[0011] Combine the first data information and the second data information to generate serial port data, and send the serial port data to the CameraLink camera;

[0012] The processed data returned by the CameraLink camera is filtered to obtain the returned data;

[0013] Compare the returned data with the first data information to verify the CameraLink camera configuration status.

[0014] Furthermore, the instructions include commands pre-agreed with the camera that enable the camera to return standard XML and XML extension content.

[0015] Furthermore, the first data information includes a camera status code value table, expressions corresponding to each register address, and timeout.

[0016] Furthermore, the expressions corresponding to each register address include command expressions and parsing expressions.

[0017] Furthermore, the second data information includes the register address, length, and value corresponding to each configuration parameter of the camera.

[0018] Furthermore, during the data transmission process of the interface implemented by the GenICam standard, the second data information will generate write parameters or read parameters.

[0019] Furthermore, the step of generating serial port data by combining the first data information and the second data information includes obtaining a command expression from the first data information through the register address in the second data information, and generating serial port data by combining read parameters and / or write parameters.

[0020] Furthermore, the processed data returned by the CameraLink camera is filtered to obtain the returned data, including the processed data returned by the CameraLink camera. After parsing and processing the data using the parsing expression, the returned data is filtered to obtain the returned data.

[0021] Furthermore, the returned data includes returned read parameters and returned status code values.

[0022] Furthermore, the step of comparing the returned data with the first data information to verify the CameraLink camera configuration status includes finding the CameraLink camera configuration status corresponding to the return status code value of the returned data in the camera status code value table of the first data information.

[0023] On the other hand, a computer device according to the present invention includes a processor and a memory.

[0024] The memory is used to store computer programs;

[0025] The processor is used to execute the computer program stored in the memory to implement the above-described CameraLink camera configuration method.

[0026] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement a CameraLink camera configuration method as described above.

[0027] In summary, existing methods for modifying CameraLink camera parameter configuration require modifications not only to the camera and XML but also to the CLProtocol library; adding support for new cameras also necessitates modifications to the CLProtocol library. Furthermore, the lack of a unified standard for serial port data processing leads to difficulties in software development and maintenance when dealing with a wide variety of cameras. The CameraLink camera configuration method of this invention, however, only requires modifying the camera's XML content to achieve configuration function modification; adding support for new cameras does not require modification of the CLProtocol library, thus facilitating software maintenance. Moreover, in application, modifying configuration functions primarily involves modifying XML, requiring no software expertise, lowering the maintenance threshold. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the structure of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0030] like Figure 1 As shown, the CameraLink camera configuration method described in this embodiment includes the following steps:

[0031] Camera detection allows you to obtain basic information such as the camera's name before connecting to the camera.

[0032] Send a specific command to the camera. The specific command can be any command symbol agreed upon with the camera, such as "info", "list", etc.

[0033] The camera returns XML information or the corresponding model number based on a specific command. The XML information includes standard XML and XML extensions. There are two scenarios regarding the information returned by the camera: if the XML information is stored internally, the camera returns the XML information directly; if the XML information is stored on a computer-readable storage medium, the camera returns a distinctive model name from which the XML information can be found.

[0034] Depending on the content returned by the camera, there are two scenarios for obtaining XML information: If the camera returns XML information, then use the XML information directly; if the camera returns a model number, which is in the same format as the XML information directly returned by the camera, then you need to find the corresponding XML information in the computer-readable storage medium based on the model number and the camera's basic information.

[0035] Parse the XML extension content to obtain the camera status code value table, the expression corresponding to each register address, the timeout period, and other information; if each register address is readable and writable, it also includes the command expression corresponding to the read / write register address, the parsing expression, the timeout period, and other information.

[0036] Removing XML extensions will generate standard GenICam XML, which can be parsed into various features by the GenICam standard protocol.

[0037] Based on the standard GenICam, standard XML is parsed into various camera parameter features. Based on the camera's various parameter features, the corresponding register address, value, and length can be obtained. The interface implemented by the GenICam standard uses the register address, length, and value when writing parameters, and uses the register address and length when reading parameters.

[0038] Retrieve the command expression from the XML extension content based on the register address.

[0039] Send serial port data to the camera. The serial port data can be generated in any of the following four ways: 1. Command expression, 2. Command expression and write parameters, 3. Command expression and read parameters, 4. Command expression and both write and read parameters. The expression includes: string constants and format control strings. For command expressions, one write parameter corresponds to one format control string, formatting the data into a string combined with the string constant. For parsed expressions, one read parameter corresponds to one format control string, matching the string constant and read parameters from the data, and formatting the matched read parameters into data form.

[0040] The camera processes serial port data and returns the read parameters and status codes; if it writes parameters, it only returns the status code.

[0041] The read parameters and status codes are obtained by combining the parsing expression and the return parameters; if it is a write parameter, the status code is only parsed based on the XML information.

[0042] Obtain the read value and return status. If it is a write parameter, only the return status is obtained. It needs to be explained that the configuration status corresponding to the status code is found in the camera status code value table. For example, the camera status value table is 100-success, 101-timeout, 102-error command; a status code of 100 indicates that the camera configuration is successful. In addition to expressing success and failure, the status code usually includes the reason for the failure in the case of failure.

[0043] The following are examples:

[0044] One way to extend register nodes in XML is as follows, but this form is not strictly required:

[0045] For example, GenICam standard register XML:

[0046] <IntReg Name="PixelFormatReg">

[0047] <address>0x1000021B< / address>

[0048] <length> 4< / length>

[0049] <accessmode>RW< / accessmode>

[0050] <pport>Device< / pport>

[0051] <pinvalidator>UserSetLoadReg< / pinvalidator>

[0052] <sign>Unsigned< / sign>

[0053] <endianess>LittleEndian< / endianess>

[0054] .

[0055] After adding the extended node:

[0056] <IntReg Name="PixelFormatReg">

[0057] <address>0x1000021B< / address>

[0058] <length> 4< / length>

[0059] <accessmode>RW< / accessmode>

[0060] <pport>Device< / pport>

[0061] <pinvalidator>UserSetLoadReg< / pinvalidator>

[0062] <sign>Unsigned< / sign>

[0063] <endianess>LittleEndian< / endianess>

[0064] <iread>

[0065] <timeout> 100< / timeout>

[0066] <commandpattern>list< / commandpattern>

[0067] <parserpattern>>; clnk = %lld< / parserpattern>

[0068] < / iread>

[0069] <iwrite>

[0070] <timeout> 4000< / timeout>

[0071] <commandpattern>clnk = %lld< / commandpattern>

[0072] < / iwrite>

[0073] .

[0074] An IRead node is added for reading parameters. Specifically, when reading node 0x1000021B, a list command is sent to the camera, and then the serial port is read until a timeout occurs or an expression satisfying the ParserPattern node is found. > is the XML representation of ">". %lld represents reading an integer, such as ">clnk=1", which satisfies the expression.

[0075] Add an IWrite node for writing parameters. When writing to node 0x1000021B, send the command "clnk=%lld" to the camera, where %lld represents inputting the value as an integer. Then wait for the status code within the timeout period.

[0076] One way to extend status codes in XML is as follows, but it is not limited to this form:

[0077] Add the following node after the original standard XML:

[0078] <Status Name="CommandResult">

[0079] <EnumEntry Name="Ok"NameSpace="Custom">

[0080] <eof>>; Ok ;< / eof>

[0081] <statusid> 0x0000< / statusid>

[0082]

[0083]

[0084] This indicates that after receiving >Ok\13, a status code of 0 will be returned, and the reading will be terminated.

[0085] In summary, the CameraLink camera configuration method of the present invention can achieve the configuration function modification of the CameraLink camera by only modifying the camera; it does not require modification of the CLProtocol library when adding support for new cameras; and it is beneficial to software maintenance.

[0086] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of any of the methods described above.

[0087] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the methods described above.

[0088] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of any of the methods described in the above embodiments.

[0089] It is understood that the system provided in the embodiments of the present invention corresponds to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.

[0090] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0091] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0092] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for configuring a CameraLink camera, characterized in that, Includes the following steps, Sending instructions to the CameraLink camera to obtain standard XML and XML extension content; wherein, the instructions include commands pre-agreed with the camera to cause the camera to return standard XML and XML extension content; the CameraLink camera is an industrial camera that uses the CameraLink interface; Parse the XML extension content to obtain the first data information; based on the GenICam protocol, parse the standard XML to obtain the second data information; wherein, the first data information includes a camera status code value table, command expressions and parsing expressions corresponding to each register address, and timeout; the second data information includes the register address, length, and value corresponding to each camera configuration parameter; during the data transmission process of the interface implemented by the GenICam standard, the second data information will generate write parameters or read parameters; Serial port data is generated by combining the first data information and the second data information, and the serial port data is sent to the CameraLink camera; wherein, generating serial port data by combining the first data information and the second data information includes obtaining a command expression from the first data information through the register address in the second data information, and generating serial port data by combining read parameters and / or write parameters; The processed data returned by the CameraLink camera is filtered to obtain the returned data; The CameraLink camera configuration status is verified by comparing the returned data with the first data information; this includes finding the CameraLink camera configuration status corresponding to the return status code value of the returned data in the camera status code value table of the first data information.

2. The configuration method for a CameraLink camera according to claim 1, characterized in that, The processed data returned by the CameraLink camera is filtered to obtain the returned data, which includes the processed data returned by the CameraLink camera. After parsing and processing the data using the parsing expression, the returned data is filtered to obtain the returned data.

3. The configuration method for a CameraLink camera according to claim 2, characterized in that, The returned data includes the returned read parameters and the returned status code value.

4. A computer device, characterized in that, include: Processor and memory, The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory to implement a CameraLink camera configuration method as described in any one of claims 1 to 3.

5. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement a configuration method for a CameraLink camera as described in any one of claims 1 to 3.