Image positioning method, device, equipment and medium

By sharing the physical memory with the soft-core processor through the programmable logic resources in the FPGA chip, and using the image processing module and the soft-core processor to verify the image data, it solves the problem of image data positioning of the linear array image sensor in the existing technology and achieves high real-time performance. and accurate image positioning processing.

CN118333836BActive Publication Date: 2024-09-27ZHEJIANG HECHUAN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410749031.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-27
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

Existing encoder products are difficult to meet the high real-time communication speed requirements, especially in visual fields such as industrial cameras. Image acquisition methods based on area arrays cannot effectively process the image data positioning of linear array image sensors.

Method used

The programmable logic resources in the FPGA chip share the physical memory with the soft-core processor, and image positioning processing is performed in the FPGA chip. The image processing module and the soft-core processor are used to verify the image data to ensure the reliability and reliability of the image data. Accuracy of positioning results.

Benefits of technology

It realizes high real-time positioning processing of image data collected by linear array image sensors, ensures the reliability of image data and the accuracy of positioning results, meets high real-time requirements, and avoids positioning results that can only be viewed due to pure logical resources. question.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118333836B
    Figure CN118333836B
Patent Text Reader

Abstract

The present application discloses an image positioning method, device, equipment and medium, which relates to the field of image processing, including: an FPGA chip acquires real-time image data from a linear array image sensor, and performs positioning processing on the real-time image data through an image processing module in the FPGA chip to obtain an image positioning result; after the real-time image data is written into the physical memory, the real-time image data is read from the physical memory by a soft-core processor in the FPGA chip, and the real-time image data is positioned to obtain a result to be verified; the result to be verified is compared and verified with the image positioning result by the soft-core processor, and the comparison and verification result is transmitted to the upper system. The present application ensures the reliability of the image data and the accuracy of the positioning result by making the programmable logic resources in the FPGA chip share the physical memory with the soft-core processor in the FPGA chip, and verifies the result to be verified with the image positioning result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to an image positioning method, device, equipment and medium. Background Art

[0002] According to the working principle of the encoder, the encoder can be divided into photoelectric, magnetoelectric and contact brush types, among which photoelectric and magnetoelectric are more common. However, the current encoder products have higher and higher requirements for communication speed, and many encoders based on single-chip microcomputers have been unable to meet the requirements of high real-time performance. Although the encoder using image vision technology can improve real-time performance to a certain extent, the current image acquisition methods in the visual field of cameras, such as industrial cameras, are mostly based on area arrays. Therefore, how to achieve the positioning of image data collected by linear array image sensors is a problem that needs to be solved. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide an image positioning method, device, equipment and medium, which can enable the programmable logic resources in the FPGA chip and the soft core processor in the FPGA chip to share physical memory, and verify the results to be verified and the image positioning results, so as to ensure the reliability of the image data and the accuracy of the positioning results. The specific scheme is as follows:

[0004] In a first aspect, the present application provides an image positioning method, which is applied to an FPGA chip, comprising:

[0005] Acquire real-time image data from the linear array image sensor, and perform positioning processing on the real-time image data through the image processing module in the FPGA chip to obtain an image positioning result;

[0006] After the real-time image data is written into the physical memory, the real-time image data is read from the physical memory by the soft-core processor in the FPGA chip, and positioning processing is performed on the real-time image data to obtain a result to be verified;

[0007] The soft-core processor compares and verifies the result to be verified with the image positioning result, and transmits the comparison and verification result to the upper-level system.

[0008] Optionally, acquiring real-time image data from a linear array image sensor includes:

[0009] If the data processing bit width of the LVDS interface is smaller than the pixel depth of the linear array image sensor, the original image data collected by the linear array image sensor is read through the LVDS interface based on the pre-configured data bit width, and the read image data is aligned to obtain aligned data;

[0010] The plurality of aligned data are stored in a first-in-first-out queue based on a data readout timing, and the small bit-width data read from the first-in-first-out queue after storage are spliced ​​to obtain the real-time image data with a large bit-width required by the FPGA chip.

[0011] Optionally, the FPGA chip includes a data transmission module, a read / write arbitration module and a duplex mode conversion module based on the AXI bus protocol;

[0012] Correspondingly, after acquiring the real-time image data from the linear array image sensor, the method further includes:

[0013] Transmitting the real-time image data to the read-write arbitration module through the data transmission module;

[0014] arbitrating the real-time image data through the read-write arbitration module to transmit the real-time image data to the duplex mode conversion module based on an arbitration order;

[0015] The full-duplex mode is converted into the half-duplex mode by the duplex mode conversion module, and the real-time image data is written into the physical memory based on the half-duplex mode.

[0016] Optionally, reading the real-time image data from the physical memory by using a soft-core processor in the FPGA chip includes:

[0017] The real-time image data is read from the physical memory by the soft-core processor in the FPGA chip via the read-write arbitration module and the duplex mode conversion module.

[0018] Optionally, before the real-time image data is positioned by the image processing module in the FPGA chip, the method further includes:

[0019] The image processing module obtains a data calibration coefficient corresponding to each pixel data in the real-time image data, and performs a multiplication operation on the real-time image data based on the data calibration coefficient to obtain the calibrated real-time image data.

[0020] Optionally, the method further includes:

[0021] The operating state of the FPGA chip and the operating state of the linear array image sensor are monitored by the soft core processor to obtain monitoring results;

[0022] If the monitoring result indicates that there is an abnormality in the operating state of the FPGA chip and / or the operating state of the linear array image sensor, the monitoring result is transmitted to the upper-level system through the soft-core processor, and / or the FPGA chip and / or the linear array image sensor are adaptively adjusted based on the monitoring result.

[0023] Optionally, the soft-core processor is connected to a non-volatile memory via a serial peripheral interface, and the non-volatile memory is used to store bit stream files required for the operation of the FPGA chip and binary source files required for the operation of the soft-core processor.

[0024] In a second aspect, the present application provides an image positioning device, applied to an FPGA chip, comprising:

[0025] A first image positioning module, used for acquiring real-time image data from the linear array image sensor, and performing positioning processing on the real-time image data through the image processing module in the FPGA chip to obtain an image positioning result;

[0026] A second image positioning module is used to read the real-time image data from the physical memory through the soft core processor in the FPGA chip after writing the real-time image data into the physical memory, and perform positioning processing on the real-time image data to obtain a result to be verified;

[0027] The positioning result verification module is used to compare and verify the result to be verified with the image positioning result through the soft-core processor, and transmit the comparison and verification result to the upper-level system.

[0028] In a third aspect, the present application provides an electronic device, including:

[0029] Memory, used to store computer programs;

[0030] A processor is used to execute the computer program to implement the aforementioned image positioning method.

[0031] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned image positioning method when executed by a processor.

[0032] In the present application, the FPGA chip acquires real-time image data from the linear array image sensor, and performs positioning processing on the real-time image data through the image processing module in the FPGA chip to obtain an image positioning result; after the real-time image data is written into the physical memory, the real-time image data is read from the physical memory by the soft-core processor in the FPGA chip, and positioning processing is performed on the real-time image data to obtain a result to be verified; the result to be verified is compared and verified with the image positioning result by the soft-core processor, and the comparison and verification result is transmitted to the upper-level system. It can be seen that the present application can meet the high real-time requirements for image positioning processing and realize the positioning processing of image data collected by the linear array image sensor by applying it to the FPGA chip; and by making the programmable logic resources in the FPGA chip and the soft-core processor in the FPGA chip share physical memory, the soft-core processor can directly obtain image data from the shared physical memory to ensure the reliability of the image data; further, the present application can facilitate developers to debug algorithms by adopting a soft-core processor, and the soft-core processor can compare and verify the results to be verified obtained by itself with the image positioning results obtained by the image processing module in the FPGA chip, thereby ensuring the accuracy of the image positioning results, and by transmitting the comparison and verification results to the upper-level system, users can understand more information involved in image positioning, avoiding the problem of only being able to view the positioning results when performing image positioning with FPGA chips that only use pure logic resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0034] Figure 1 A flow chart of an image positioning method disclosed in this application;

[0035] Figure 2 A data bit width conversion flow chart disclosed in this application;

[0036] Figure 3 A specific image positioning processing flow chart disclosed in this application;

[0037] Figure 4 This is an architecture diagram of an FPGA chip disclosed in this application;

[0038] Figure 5 This is a schematic diagram of the structure of an image positioning device disclosed in this application;

[0039] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] Current encoder products have increasingly higher requirements for communication speeds, and many encoders based on single-chip microcomputers have been unable to meet high real-time requirements. Although encoders using image vision technology can improve real-time performance to a certain extent, currently in visual fields such as cameras, most methods of collecting images are based on area arrays. To this end, the present application provides an image positioning method, which enables the programmable logic resources in the FPGA chip to share physical memory with the soft-core processor in the FPGA chip, and verifies the results to be verified with the image positioning results, thereby ensuring the reliability of the image data and the accuracy of the positioning results.

[0042] See also Figure 1 As shown, an embodiment of the present invention discloses an image positioning method, which is applied to an FPGA chip, comprising:

[0043] Step S11, acquiring real-time image data from the linear array image sensor, and performing positioning processing on the real-time image data through the image processing module in the FPGA chip to obtain an image positioning result.

[0044] In this embodiment, the FPGA (Field Programmable Gate Array) chip is connected to the linear array image sensor through an LVDS (Low-Voltage Differential Signaling) interface. The linear array image sensor can use CMOS (Complementary Metal Oxide Semiconductor) or CCD (Charge Coupled Device) and the like; and the line frequency signal that the linear array image sensor can support can be up to 200K, and the effective pixel bit is 512H*1V. The soft core processor in the FPGA chip performs programmable control on the linear array image sensor through I2C (Inter-Integrated Circuit).

[0045] Considering that if the linear array image sensor adopts CMOS, the pixel depth of CMOS is generally 8 bits, 10 bits, 12 bits, etc., and the bit width sequence processed by the LVDS interface in the FPGA chip is only 8 bits to 10 bits, so in order to enable the FPGA chip to process some high-precision data, such as 12 bits, 16 bits, etc., this embodiment adds a first-level configurable FIFO (First Input First Output) data sorting module in the FPGA chip.

[0046] Specifically, Figure 2 As shown, if the data processing bit width of the LVDS interface is smaller than the pixel depth of the linear array image sensor, the raw image data collected by the linear array image sensor is read based on the LVDS interface according to the pre-configured data bit width through the configurable FIFO data sorting module, and the n-channel image data read are aligned to obtain n-channel aligned data. Among them, the pre-configured data bit width is smaller than the pixel depth of the linear array image sensor, for example, it can be configured as half of the pixel depth of the linear array image sensor. Then, based on the data readout timing, the n-channel aligned data is stored in a first-in-first-out queue, and the small bit width data read from the first-in-first-out queue after storage is spliced ​​to obtain the large bit width real-time image data required by the FPGA chip. After obtaining the large bit width real-time image data required by the FPGA chip, the data stream interface (Axi-stream) based on the AXI (Advanced eXtensible Interface, a bus protocol) bus transmits the real-time image data to the image processing module in the FPGA chip.

[0047] Furthermore, after the image processing module in the FPGA chip receives the real-time image data, it is necessary to perform positioning processing on the real-time image data to obtain the image positioning result. It should be noted that before positioning processing is performed on the real-time image data, the real-time image data needs to be calibrated first. Specifically, the image processing module in the FPGA chip reads the data calibration coefficients corresponding to each pixel data in the real-time image data from the read-only memory (ROM), and multiplies the real-time image data based on the data calibration coefficients to obtain the calibrated real-time image data. Among them, the multiplication operation can be performed by the multiplier in the FPGA chip, and can also be performed by the DSP (Digital Signal Processing) unit in the FPGA chip.

[0048] Considering that this embodiment is aimed at a sequence of light and dark images collected by a linear array image sensor, the image processing module in the FPGA chip performs positioning processing on the real-time image data to obtain an image positioning result. The specific operation is as follows: Figure 3 As shown. The calibrated real-time image data is input into the binarization square wave module to binarize the calibrated real-time image data to obtain a binarized square wave. Then, the binarized square wave is interpolated by the linear interpolation method through the calculation unit based on the sub-pixel offset to obtain the sub-pixels of the upper and lower edges of the binarized square wave, and the corresponding offset is calculated based on the sub-pixels of the upper and lower edges of the binarized square wave. At the same time, the sequence length of the binarized square wave is looked up in a table by a fast table lookup method to obtain the displacement angle value corresponding to the fixed sequence length, that is, the coarse angle. Finally, the coarse angle and the offset are added and subtracted by the two attributes of the motion direction and the offset direction of the offset to obtain a high-precision positioning result for the real-time image data. Further, after obtaining the image positioning result, the image positioning result needs to be transmitted to the soft-core processor in the FPGA chip; at the same time, the image positioning result can also be transmitted to the upper system.

[0049] Step S12: After writing the real-time image data into the physical memory, the real-time image data is read from the physical memory by the soft-core processor in the FPGA chip, and positioning processing is performed on the real-time image data to obtain the result to be verified.

[0050] In this embodiment, after obtaining the large-bit-width real-time image data required by the FPGA chip through the configurable FIFO data sorting module, the real-time image data needs to be written into the physical memory; wherein the physical memory can be selected as RAM (Random Access Memory). Specifically, in the process of writing the real-time image data into the physical memory, a data transmission module, a read-write arbitration module, and a duplex mode conversion module are required. These three modules are all located in the FPGA chip and are all modules based on the AXI bus protocol.

[0051] Among them, the real-time image data is transmitted to the data transmission module through the configurable FIFO data sorting module based on the data stream interface (Axi-stream) of the AXI bus. Then the data transmission module transmits the real-time image data to the read-write arbitration module based on the AXI bus; the real-time image data is arbitrated by the read-write arbitration module, so as to transmit the real-time image data to the duplex mode conversion module based on the AXI bus using the arbitration sequence; wherein the arbitration sequence is the read-write sequence when multiple devices read and write data to the physical memory. Finally, the full-duplex mode is converted to the half-duplex mode through the duplex mode conversion module, and the real-time image data is written into the physical memory based on the half-duplex mode.

[0052] Among them, the data transmission module can adopt a DMA (Direct Memory Access) module. The DMA module used here is essentially a memory read-write module based on the AXI bus technology, and the main function of the DMA module is to transfer data to other devices, and it is multi-channel, but in the design of the present invention, only one of the write functions is used, so the present invention does not impose a mandatory limitation on the DMA module. Secondly, from a technical principle, the data transmission module can also adopt a memory read-write control body based on the AXI master mode.

[0053] Furthermore, in order to enable the soft-core processor in the FPGA chip to read data directly from the physical memory, the programmable logic resources in the FPGA chip and the soft-core processor in the FPGA chip share the physical memory. In this embodiment, the soft-core processor is connected to the physical memory via the read-write arbitration module and the duplex mode conversion module based on the AXI bus, so that the real-time image data is read from the physical memory through the soft-core processor via the read-write arbitration module and the duplex mode conversion module. Among them, the soft-core processor can use a CPU (Center Process Unit) based on RISC-V (Reduced Instruction Set Computer). In this way, the image data is directly obtained from the shared physical memory through the soft-core processor, which ensures the reliability of the image data.

[0054] In this embodiment, after the real-time image data is acquired from the physical memory by the soft-core processor in the FPGA chip, it is necessary to further perform positioning processing on the real-time image data to obtain the result to be verified.

[0055] Step S13: Compare and verify the result to be verified with the image positioning result through the soft core processor, and transmit the comparison and verification result to the upper level system.

[0056] In this embodiment, the soft core processor in the FPGA chip compares and verifies the result to be verified and the image positioning result obtained from the image processing module in the FPGA chip to obtain a comparison verification result, and transmits the comparison verification result to the upper system. The comparison verification result includes the result to be verified, the image positioning result, and the comparison verification of the two results.

[0057] Among them, the communication interface for data transmission between the FPGA chip and the upper system can be either SSI (Synchronous Serial Interface), RS485 / 422 interface, enDat full-duplex synchronous serial interface, or SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver / Transmitter) interface. For example, for the RS485 / 422 interface, at a clock frequency of 10MHZ, the positioning update speed can reach 5us-20us. Under such high-speed requirements, soft-core processors or other independent ARM (Advanced RISC Machine) cores, DSP cores, etc. cannot meet the high-speed requirements, mainly because it takes time to transfer the computing performance of various cores and the results of the calculations. A single FPGA chip based on pure logic can solve the above problems and meet the requirements of high speed and real-time performance.

[0058] Furthermore, the operating status of the FPGA chip and the operating status of the linear array image sensor can also be monitored through the soft-core processor to obtain monitoring results; if the monitoring results indicate that the operating status of the FPGA chip and / or the operating status of the linear array image sensor is abnormal, the monitoring results are transmitted to the upper-level system through the soft-core processor, and / or the FPGA chip and / or the linear array image sensor are adaptively adjusted based on the monitoring results.

[0059] Furthermore, this embodiment can also be equipped with an external non-volatile memory according to actual conditions, so as to be connected to the non-volatile memory through the soft-core processor based on the serial peripheral interface SPI; wherein the non-volatile memory is used to store the bit stream files required for the operation of the FPGA chip and the binary source files required for the operation of the soft-core processor; the non-volatile memory can be a flash memory.

[0060] It can be seen that the present application can meet the high real-time requirements for image positioning processing and realize the positioning processing of image data collected by the linear array image sensor by applying it to the FPGA chip; and by making the programmable logic resources in the FPGA chip and the soft-core processor in the FPGA chip share physical memory, the soft-core processor can directly obtain image data from the shared physical memory to ensure the reliability of the image data; further, the present application can facilitate developers to debug algorithms by adopting a soft-core processor, and the soft-core processor can compare and verify the results to be verified obtained by itself with the image positioning results obtained by the image processing module in the FPGA chip, thereby ensuring the accuracy of the image positioning results, and by transmitting the comparison and verification results to the upper-level system, users can understand more information involved in image positioning, avoiding the problem of only being able to view the positioning results when performing image positioning with FPGA chips that only use pure logic resources.

[0061] See also Figure 4 As shown, an embodiment of the present invention discloses an image positioning method, which is applied to an FPGA chip, comprising:

[0062] The configurable FIFO data sorting module in the FPGA chip reads the raw image data collected by the linear array image sensor (such as CMOS or CCD) based on the LVDS interface according to the pre-configured data bit width, and aligns the n-channel image data read to obtain n-channel aligned data. Then, based on the data readout timing, the n-channel aligned data is stored in the FIFO queue, and the small bit width data read from the stored FIFO queue is spliced ​​to obtain the large bit width real-time image data required by the FPGA chip. After obtaining the large bit width real-time image data required by the FPGA chip, the data stream interface (Axi-stream) based on the AXI bus transmits the real-time image data to the image processing module and the data transmission module (such as DMA or memory read and write control body) in the FPGA chip. Among them, the soft core processor (such as RISC-V CPU) in the FPGA chip performs programmable control on the linear array image sensor through the I2C integrated circuit bus.

[0063] The real-time image data is positioned and processed through the image processing module in the FPGA chip to obtain the image positioning result, and the image positioning result is transmitted to the external superior system through the UART / SPI high-speed interface. At the same time, the image positioning result is transmitted to the soft-core processor in the FPGA chip through the APB3 slave0 (Advanced Peripheral Bus) interface.

[0064] Furthermore, after the data transmission module acquires the real-time image data, the real-time image data is transmitted to the duplex mode conversion module via the read-write arbitration module based on the AXI bus, so that the real-time image data is written into the physical memory (such as RAM) based on the half-duplex mode through the duplex mode conversion module. At the same time, the real-time image data is read from the physical memory through the soft-core processor in the FPGA chip via the read-write arbitration module and the duplex mode conversion module based on the Axislave interface, so that the algorithm verification unit in the soft-core processor performs positioning processing on the real-time image data to obtain the result to be verified, and compares and verifies the result to be verified with the image positioning result, and transmits the comparison verification result to the external superior system based on the APB3 slave0 interface and the UART / SPI high-speed interface.

[0065] Furthermore, the soft-core processor monitors the operating status of the FPGA chip and the operating status of the linear array image sensor through the local status monitoring unit. For example, if the light emission of the LED (Light Emitting Diode) of the linear array image sensor becomes weak due to long-term operation, the state monitoring unit uses the PID (Proportion Integration Differentiation) adaptive adjustment algorithm to adjust the duty cycle of the PWM (Pulse Width Modulation) based on the APB3 slave0 interface, so that the LED light intensity of the linear array image sensor works in the best state, which plays a role in extending the life of the product. It should be noted that the LED can be integrated with the linear array image sensor or separated from the linear array image sensor. In addition, the status monitoring unit in the soft-core processor can also obtain the battery status, the absolute position information before the system is powered on, and the parameter backup when the external upper system was last running.

[0066] It should be noted that the soft-core processor is connected to the data transmission module through the APB3 slave1 interface, so that the soft-core processor can configure the parameters of the data transmission module, and the soft-core processor also controls the enable switch of the data transmission module and monitors the operating status of the data transmission module through the APB3 slave1 interface. In addition, the soft-core processor is connected to the external flash memory based on the SPI serial peripheral interface, so that the flash memory can store the bitstream files required for the operation of the FPGA chip and the binary source files required for the operation of the soft-core processor. In addition, the soft-core processor is connected to the UART / jtag debug port, so that the debugging of the soft-core processor can be realized through the UART / jtag debug port.

[0067] It should be noted that by setting a soft-core processor in the FPGA chip, it is possible to configure local parameters, such as the line frequency parameters and exposure parameters of the linear array image sensor. At the same time, the soft-core processor can also be used to monitor the operating status and debug the algorithm.

[0068] It can be seen that the present application can meet the high real-time requirements for image positioning processing and realize the positioning processing of image data collected by the linear array image sensor by applying it to the FPGA chip; and by making the programmable logic resources in the FPGA chip and the soft-core processor in the FPGA chip share physical memory, the soft-core processor can directly obtain image data from the shared physical memory to ensure the reliability of the image data; further, the present application can facilitate developers to debug algorithms by adopting a soft-core processor, and the soft-core processor can compare and verify the results to be verified obtained by itself with the image positioning results obtained by the image processing module in the FPGA chip, thereby ensuring the accuracy of the image positioning results, and by transmitting the comparison and verification results to the upper-level system, users can understand more information involved in image positioning, avoiding the problem of only being able to view the positioning results when performing image positioning with FPGA chips that only use pure logic resources.

[0069] See also Figure 5 As shown, an embodiment of the present invention discloses an image positioning device, which is applied to an FPGA chip, including:

[0070] The first image positioning module 11 is used to obtain real-time image data from the linear array image sensor, and perform positioning processing on the real-time image data through the image processing module in the FPGA chip to obtain an image positioning result;

[0071] A second image positioning module 12 is used for reading the real-time image data from the physical memory through the soft core processor in the FPGA chip after writing the real-time image data into the physical memory, and performing positioning processing on the real-time image data to obtain a result to be verified;

[0072] The positioning result verification module 13 is used to compare and verify the result to be verified with the image positioning result through the soft-core processor, and transmit the comparison and verification result to the upper-level system.

[0073] It can be seen that the present application can meet the high real-time requirements for image positioning processing and realize the positioning processing of image data collected by the linear array image sensor by applying it to the FPGA chip; and by making the programmable logic resources in the FPGA chip and the soft-core processor in the FPGA chip share physical memory, the soft-core processor can directly obtain image data from the shared physical memory to ensure the reliability of the image data; further, the present application can facilitate developers to debug algorithms by adopting a soft-core processor, and the soft-core processor can compare and verify the results to be verified obtained by itself with the image positioning results obtained by the image processing module in the FPGA chip, thereby ensuring the accuracy of the image positioning results, and by transmitting the comparison and verification results to the upper-level system, users can understand more information involved in image positioning, avoiding the problem of only being able to view the positioning results when performing image positioning with FPGA chips that only use pure logic resources.

[0074] In some specific embodiments, the first image positioning module 11 includes:

[0075] A data alignment unit, configured to read the original image data collected by the linear array image sensor through the LVDS interface based on a pre-configured data bit width if the data processing bit width of the LVDS interface is smaller than the pixel depth of the linear array image sensor, and align the read image data to obtain aligned data;

[0076] The data splicing unit is used to store the plurality of aligned data into a first-in-first-out queue based on the data read-out timing, and to splice the small bit width data read from the first-in-first-out queue after storage to obtain the real-time image data with a large bit width required by the FPGA chip.

[0077] In some specific embodiments, the FPGA chip includes a data transmission module, a read / write arbitration module, and a duplex mode conversion module based on the AXI bus protocol;

[0078] Correspondingly, the image positioning device further includes:

[0079] A first transmission unit, used for transmitting the real-time image data to the read-write arbitration module through the data transmission module;

[0080] a second transmission unit, configured to arbitrate the real-time image data through the read-write arbitration module, so as to transmit the real-time image data to the duplex mode conversion module based on an arbitration order;

[0081] The data writing unit is used to convert the full-duplex mode into the half-duplex mode through the duplex mode conversion module, and write the real-time image data into the physical memory based on the half-duplex mode.

[0082] In some specific embodiments, the second image positioning module 12 includes:

[0083] A data reading unit is used to read the real-time image data from the physical memory through the soft-core processor in the FPGA chip via the read-write arbitration module and the duplex mode conversion module.

[0084] In some specific embodiments, the image positioning device further includes:

[0085] The data calibration unit is used to obtain the data calibration coefficients corresponding to each pixel data in the real-time image data through the image processing module, and perform multiplication operation on the real-time image data based on the data calibration coefficients to obtain the calibrated real-time image data.

[0086] In some specific embodiments, the image positioning device further includes:

[0087] An operation status monitoring unit is used to monitor the operation status of the FPGA chip and the operation status of the linear array image sensor through the soft-core processor to obtain a monitoring result; if the monitoring result indicates that the operation status of the FPGA chip and / or the operation status of the linear array image sensor is abnormal, the monitoring result is transmitted to the upper-level system through the soft-core processor, and / or the FPGA chip and / or the linear array image sensor are adaptively adjusted based on the monitoring result.

[0088] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0089] Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the image positioning method disclosed in any of the above embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0090] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0091] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0092] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the image positioning method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0093] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed image positioning method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0094] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0095] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0096] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0097] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0098] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image positioning method, characterized in that: Applied to FPGA chips, including: Acquire real-time image data from the linear array image sensor, and perform positioning processing on the real-time image data through the image processing module in the FPGA chip to obtain an image positioning result; After the real-time image data is written into the physical memory, the real-time image data is read from the physical memory by the soft-core processor in the FPGA chip, and positioning processing is performed on the real-time image data to obtain a result to be verified; Comparing and verifying the result to be verified with the image positioning result through the soft core processor, and transmitting the comparison and verification result to the upper level system; Wherein, acquiring real-time image data from the linear array image sensor comprises: If the data processing bit width of the LVDS interface is smaller than the pixel depth of the linear array image sensor, the original image data collected by the linear array image sensor is read through the LVDS interface based on the pre-configured data bit width, and the read image data is aligned to obtain aligned data; Based on the data readout timing, the plurality of aligned data are stored in a first-in-first-out queue, and the small bit width data read from the first-in-first-out queue after storage are spliced ​​to obtain the real-time image data with a large bit width required by the FPGA chip; The FPGA chip includes a data transmission module, a read / write arbitration module and a duplex mode conversion module based on the AXI bus protocol; Correspondingly, after acquiring the real-time image data from the linear array image sensor, the method further includes: Transmitting the real-time image data to the read-write arbitration module through the data transmission module; arbitrating the real-time image data through the read-write arbitration module to transmit the real-time image data to the duplex mode conversion module based on an arbitration order; Converting the full-duplex mode into the half-duplex mode by the duplex mode conversion module, and writing the real-time image data into the physical memory based on the half-duplex mode; Wherein, reading the real-time image data from the physical memory through the soft-core processor in the FPGA chip includes: The real-time image data is read from the physical memory by the soft-core processor in the FPGA chip via the read-write arbitration module and the duplex mode conversion module.

2. The image positioning method according to claim 1, characterized in that: Before the real-time image data is positioned by the image processing module in the FPGA chip, the method further includes: The image processing module obtains a data calibration coefficient corresponding to each pixel data in the real-time image data, and performs a multiplication operation on the real-time image data based on the data calibration coefficient to obtain the calibrated real-time image data.

3. The image positioning method according to claim 1, characterized in that: Also includes: The operating state of the FPGA chip and the operating state of the linear array image sensor are monitored by the soft core processor to obtain monitoring results; If the monitoring result indicates that there is an abnormality in the operating state of the FPGA chip and / or the operating state of the linear array image sensor, the monitoring result is transmitted to the upper-level system through the soft-core processor, and / or the FPGA chip and / or the linear array image sensor are adaptively adjusted based on the monitoring result.

4. The image positioning method according to any one of claims 1 to 3, characterized in that: The soft-core processor is connected to a non-volatile memory via a serial peripheral interface, and the non-volatile memory is used to store the bit stream files required for the operation of the FPGA chip and the binary source files required for the operation of the soft-core processor.

5. An image positioning device, characterized in that: Applied to FPGA chips, including: A first image positioning module, used for acquiring real-time image data from the linear array image sensor, and performing positioning processing on the real-time image data through the image processing module in the FPGA chip to obtain an image positioning result; A second image positioning module is used to read the real-time image data from the physical memory through the soft core processor in the FPGA chip after writing the real-time image data into the physical memory, and perform positioning processing on the real-time image data to obtain a result to be verified; A positioning result verification module, used for comparing and verifying the result to be verified with the image positioning result through the soft-core processor, and transmitting the comparison and verification result to the upper-level system; Wherein, the first image positioning module includes: A data alignment unit, configured to read the original image data collected by the linear array image sensor through the LVDS interface based on a pre-configured data bit width if the data processing bit width of the LVDS interface is smaller than the pixel depth of the linear array image sensor, and align the read image data to obtain aligned data; A data splicing unit, used for storing the plurality of aligned data into a first-in-first-out queue based on a data readout timing, and splicing the small bit width data read from the first-in-first-out queue after storage, so as to obtain the real-time image data with a large bit width required by the FPGA chip; The FPGA chip includes a data transmission module, a read / write arbitration module and a duplex mode conversion module based on the AXI bus protocol; Correspondingly, the image positioning device further includes: A first transmission unit, used for transmitting the real-time image data to the read-write arbitration module through the data transmission module; a second transmission unit, configured to arbitrate the real-time image data through the read-write arbitration module, so as to transmit the real-time image data to the duplex mode conversion module based on an arbitration order; A data writing unit, configured to convert the full-duplex mode into the half-duplex mode through the duplex mode conversion module, and write the real-time image data into the physical memory based on the half-duplex mode; Wherein, the second image positioning module includes: A data reading unit is used to read the real-time image data from the physical memory through the soft-core processor in the FPGA chip via the read-write arbitration module and the duplex mode conversion module.

6. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the image positioning method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the image positioning method according to any one of claims 1 to 4.