Time-expanding storage system and method for high-speed cameras based on intelligent event recognition

Through the intelligent event recognition module, the high-speed camera image is processed with double-ring global contrast and n-divided cutting by the time-expansion storage module. Only the changed areas captured by the high-speed camera are stored, which solves the problem of waste of high-speed camera storage resources and achieves a more efficient Storage and processing.

CN118503167BActive Publication Date: 2024-10-29CHANGCHUN INST OF OPTICS FINE MECHANICS & PHYSICS CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410965679.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-10-29
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

When high-speed cameras capture high-speed moving objects, the static background in the image data generated occupies a large amount of storage space, resulting in a waste of storage resources and rising costs. It is difficult for existing technologies to effectively compress storage.

Method used

A time-expansion storage system based on intelligent event recognition is used. Through the combination of FPGA and memory, the intelligent event recognition module is used to perform double-ring global contrast processing on the image, divide the event target and background area, and perform n-division cutting through the time-expansion storage module. Only Store the target image of the changed area, reuse the background image, and reduce storage resource consumption.

Benefits of technology

It effectively enhances the storage efficiency of event targets, suppresses background interference, extends the storage time of high-speed cameras, reduces resource consumption of FPGA boards, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503167B_ABST
    Figure CN118503167B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of image processing technology, and in particular, relates to a time expansion storage system and method for a high-speed camera based on intelligent event recognition. The system includes: an FPGA and a memory, on which a data sending module, an intelligent event recognition module, a time expansion storage module, a first DMA module, a second DMA module, a third DMA module and a MIG core are provided. The data sending module is connected to the memory through the intelligent event recognition module, the time expansion storage module, the first DMA module and the MIG core in sequence, and the memory is connected to the time expansion storage module through the MIG core and the second DMA module. The data sending module is also connected to the memory through the third DMA module and the MIG core. The present invention can extend the storage time of a high-speed camera and reduce the resource consumption of an FPGA board.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a time expansion storage system and method of a high-speed camera based on intelligent event recognition. Background Art

[0002] The human eye has limitations in observing the high-speed changes of high-speed moving objects, so high-speed cameras came into being. A high-speed camera is a device that can capture moving images with an exposure time of less than 1 / 1000 second or a frame rate of more than 250 frames per second. In order to obtain high-dynamic and high-precision image information, the collection, transmission, storage and processing of high-resolution and high-frame-rate digital image information has always been an important research direction in the field of image processing. How to store image data quickly, efficiently and accurately is an important problem faced by the development of high-speed cameras.

[0003] When using a high-speed camera to capture a high-speed target at a fixed point or in a fixed scene, the area of ​​the changing region accounts for a very small proportion of the full-frame image, resulting in a portion of the high-speed target being submerged in a large number of static background images. Therefore, the user can obtain very little key information. If the full-frame image is stored, it will inevitably cause a large amount of "useless data" to be stored, which will occupy storage space and reduce the shooting time of the high-speed camera. With the increasing demand for the frame rate (tens of thousands of frames) and resolution (high definition and above) of image data captured by high-speed cameras, the storage of a large amount of "useless data" will occupy a large amount of storage space of the high-speed camera, resulting in an increase in the cost of transmitting image data. Equipped with a precise trigger system, the high-speed camera will have the disadvantages of being bulky and having poor mobility.

[0004] In order to address the problems of short shooting time and small storage resources of high-speed cameras, increasing hardware storage resources and adding precise trigger devices will lead to an increase in the cost and size of high-speed cameras. Without increasing the cost and size of high-speed cameras, it is difficult for existing technologies to effectively compress and store high-speed images. Summary of the invention

[0005] In view of this, the present invention aims to provide a time-expanding storage system and method for a high-speed camera based on intelligent event recognition, so as to extend the storage time of the high-speed camera and reduce the resource consumption of the FPGA board.

[0006] To achieve the above object, the technical solution created by the present invention is implemented as follows:

[0007] A time expansion storage system for a high-speed camera based on intelligent event recognition comprises an FPGA and a memory externally connected to the FPGA. A data sending module, an intelligent event recognition module, a time expansion storage module, a first DMA module, a second DMA module, a third DMA module and a MIG core are arranged on the FPGA. The data sending module is connected to the memory via the intelligent event recognition module, the time expansion storage module, the first DMA module and the MIG core in sequence. The memory is connected to the time expansion storage module via the MIG core and the second DMA module in sequence. The data sending module is also connected to the memory via the third DMA module and the MIG core in sequence.

[0008] Furthermore, the data sending module inputs the i-th frame image of the video to be identified as the image to be processed into the intelligent event recognition module. At the same time, the data sending module also inputs the image to be processed into the memory through the third DMA module and the MIG core in sequence. The intelligent event recognition module performs double-ring global contrast processing on the image to be processed to obtain the image to be segmented, and sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented, and divides the image to be segmented into a changing area containing the event target and a non-changing area not containing the event target based on the adaptive threshold. The memory inputs the image to be processed into the time expansion storage module through the MIG core and the second DMA module. The time expansion storage module performs dual-ring global contrast processing on the image to be processed to obtain the image to be segmented. The adaptive threshold is set based on the pixel value of each pixel point of the image to be segmented, and the image to be segmented is divided into a changing area containing the event target and a non-changing area not containing the event target based on the adaptive threshold. The image to be processed is cut into n parts at the position to obtain a target image with a changed area and a background image without a changed area, and both the target image and the background image are input into the memory for storage through the first DMA module, and the above operation is repeated, and it is determined whether the current background image is the same as the background image obtained by processing the previous frame image. If so, only the current target image is stored, otherwise the current background image is stored in the memory, so that the memory stores different types of background images and target images corresponding to each type of background image, and the target image to be read corresponding to the i-th frame image and the background image corresponding to the target image to be read are spliced ​​to realize the reading of the i-th frame image in the video to be recognized.

[0009] Furthermore, the n-division cutting is n-equal division cutting, and the cutting position when cutting each image to be processed is the same.

[0010] A time expansion storage method for a high-speed camera based on intelligent event recognition is implemented using a time expansion storage system for a high-speed camera based on intelligent event recognition, and specifically includes the following steps:

[0011] S1: Use a high-speed camera to collect the video to be identified, and the data sending module takes the i-th frame image in the video to be identified as the image to be processed, and sends the image to be processed to the intelligent event recognition module and the memory at the same time;

[0012] S2: The intelligent event recognition module performs double-ring global contrast processing on the image to be processed to obtain the image to be segmented;

[0013] S3: The intelligent event recognition module sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented, and divides the image to be segmented into a change area and a non-change area based on the adaptive threshold, and inputs the image to be segmented containing the change area and the non-change area into the time expansion storage module;

[0014] S4: The memory sends the image to be processed to the time expansion storage module through the MIG core and the second DMA module. The time expansion storage module divides the image to be processed into n parts based on the position of the changed area in the image to be processed, obtains the target image containing the changed area and the background image without the changed area, and inputs both the target image and the background image into the memory through the first DMA module for storage;

[0015] S5: taking the i+1th frame image in the video to be identified as the image to be processed, repeating steps S1-S4, and determining whether the current background image is the same as the background image obtained by processing the previous frame image. If so, only the current target image is stored; otherwise, the current background image is stored in the memory;

[0016] S6: repeating steps S1-S5 until all frame images of the video to be identified are stored;

[0017] Furthermore, the time-expanded storage method of the high-speed camera based on intelligent event recognition also includes step S7: splicing the target image to be read corresponding to the i-th frame image and the background image corresponding to the target image to be read, so as to realize the reading of the i-th frame image in the video to be recognized.

[0018] Furthermore, step S2 specifically includes the following steps:

[0019] S21: setting the size of the double ring target template to w×h, the double ring target template comprising an inner ring target template and an outer ring target template, wherein the size of the inner ring target template is (w+2)×(h+2), and the size of the outer ring target template is (w+4)×(h+4);

[0020] S22: Performing a dilation operation on each pixel of the image to be processed based on the double-ring target template to obtain the image grayscale value of the inner ring dilation image and the image grayscale value of the outer ring dilation image:

[0021] ;

[0022] ;

[0023] in, is the grayscale value of the inner ring dilation image, is the image grayscale value of the outer ring dilation image, is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B1 matrix. is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B2 matrix. is the expansion operator, 1 is the operation matrix of the inner ring expansion operation, △B2 is the operation matrix of the outer ring expansion operation;

[0024] S23: Perform a tapping delay operation on the image to be processed, and perform a double-ring global contrast process on the image to be processed by the following formula to obtain an image to be segmented:

[0025] ;

[0026] ;

[0027] Among them, I or is the image to be processed after the tapping delay operation. is the grayscale value of the pixel point (x, y) of the image to be segmented, and H(x) is a step function that ensures that the value of point x is not negative.

[0028] Furthermore, step S3 specifically includes the following steps:

[0029] S31: Setting an adaptive threshold based on the grayscale value of each pixel of the image to be segmented :

[0030] ;

[0031] ;

[0032] in, is a function to obtain the mean value of the pixel values ​​of the image to be segmented. is a function for obtaining the variance of the pixel values ​​of the image to be segmented, 70 is an empirical coefficient, C is the number of pixel rows of the image to be segmented, R is the number of pixel columns of the image to be segmented, and X is the image to be segmented;

[0033] S32: Divide the image to be segmented into change areas and non-change areas based on the adaptive threshold:

[0034] ;

[0035] Among them, Change(x) is used to determine whether point x has changed.

[0036] Furthermore, in step S4, the specific process of the first DMA module using the memory access mechanism to perform write control on the memory is as follows:

[0037] S4A1: if the first DMA module detects the write request signal sent by the time expansion storage module, the initial physical address and burst length of the image frame to be written of the image data to be written are sent to the MIG core, so that the memory enters the waiting state for writing, and step S4A2 is executed; otherwise, wait for the first DMA module to detect the write request signal;

[0038] S4A2: If the first DMA module detects that the frame valid rising edge signal sent by the time expansion storage module is in a high state, the FPGA FIFO is reset to clear the residual data of the broken frame of the first DMA module, so that the data stream of the current image frame to be written is synchronized with the control signal sent by the time expansion storage module, and step S4A3 is executed; otherwise, wait until the first DMA module detects that the frame valid rising edge signal sent by the time expansion storage module is in a high state;

[0039] S4A3: If the FIFO caches data of a burst length, the data of a burst length cached in the FIFO is used as the burst length data to be written, and the write response signal and the write cycle signal are pulled high in the first DMA module to put the memory into a write state, and the write address enable signal is pulled high, and step S4A4 is executed; otherwise, wait for the FIFO to cache data of a burst length;

[0040] S4A4: If the write address response signal of the MIG core and the write address enable signal of the first DMA module shake hands successfully, the MIG core loads the write address signal, and uses the MIG core to determine the address of the memory receiving the burst length data to be written, so that the memory writes the write address state and executes step S4A5; otherwise, wait for the write address response signal of the MIG core to shake hands successfully with the write address enable signal of the first DMA module;

[0041] S4A5: If the first DMA module detects that the write address enable signal and the write address response signal sent by the MIG core are both in a high state, the write data enable signal is pulled high and step S4A6 is executed; otherwise, wait until the first DMA module detects that the write address enable signal and the read address response signal sent by the MIG core are both in a high state;

[0042] S4A6: If the data response signal of the MIG core shakes hands successfully with the write data enable signal of the first DMA module, the first DMA module writes the burst length data to be written into the memory through the MIG core, and when writing the last byte of the burst length data to be written, pulls up the end byte data transmission signal, resets the write response signal, the write cycle signal, the write address enable signal and the write data enable signal, and executes step S4A7; otherwise, wait for the data response signal of the MIG core to shake hands successfully with the write data enable signal of the first DMA module;

[0043] S4A7: repeating steps S4A3 to S4A6 until all burst length data of the current image frame to be written are written into the memory, and executing step S4A8;

[0044] S4A8: If the first DMA module detects that the frame valid falling edge signal sent by the time expansion storage module is in a high state, the address and frame number of the next image frame to be written are updated;

[0045] S4A9: Repeat steps S4A1 to S4A8 until the last burst length data of the image data to be written is written into the memory, completing the entire write cycle of the image data to be written, resetting all control signals of the first DMA module, making the first DMA module enter the initial state, and waiting for the transmission of the next image data to be written.

[0046] Furthermore, in step S1 and step S4, the first DMA module and the third DMA module have the same process of controlling the writing of the memory by using the memory access mechanism.

[0047] Furthermore, in step S4, the specific process of the second DMA module performing read control on the memory through the memory access mechanism is as follows:

[0048] S4B1: If the second DMA module detects the read request signal sent by the time expansion storage module, the time expansion storage module sends the initial physical address and burst length of the image frame to be read out to the MIG core, so that the memory enters the read cycle state and executes step S4B2; otherwise, wait for the second DMA module to detect the read request signal sent by the time expansion storage module;

[0049] S4B2: Synchronize the frame number signal of the image frame to be written and the frame number signal of the image frame to be read, pull the read cycle signal high, and make the memory enter the read address writing state;

[0050] S4B3: If the second DMA module detects that the read address cycle signal is pulled high, and the read data of the FPGA FIFO is less than four burst lengths of data, the read address enable signal is pulled high, and the MIG core is waited for to pull the read address response signal high, and step S4B4 is executed; otherwise, the MIG core is waited for to pull the read address response signal high;

[0051] S4B4: If the second DMA module detects that the read address enable signal and the read address response signal sent by the MIG core are both in a high state, the second DMA module loads the data of the burst length to be read out to the MIG core at the address of the memory, and pulls the read data enable signal of the second DMA module high, pulls the read address cycle signal low, and executes step S4B5; otherwise, wait until the second DMA module detects that the read address enable signal and the read address response signal sent by the MIG core are both in a high state;

[0052] S4B5: If the read data response signal of the MIG core shakes hands successfully with the read data enable signal of the second DMA module, the data of the burst length to be read out is read out from the DDR3 read-write controller to the second DMA module, and when the last byte of the burst length to be read out is read out, the end byte data transmission signal is pulled high, the read address cycle signal, the read address enable signal and the read address cycle signal are reset, and step S4B6 is executed; otherwise, wait for the read data response signal of the MIG core to shake hands successfully with the read data enable signal of the second DMA module;

[0053] S4B6: Repeat steps S4B3 to S4B5 until all burst length data of the current image frame to be read out are read out from the memory, completing the entire read cycle, resetting all control signals of the second DMA module, and waiting for the transmission of the next image frame to be read out.

[0054] Compared with the prior art, the invention can achieve the following beneficial effects:

[0055] (1) The time expansion storage system and method of a high-speed camera based on intelligent event recognition created by the present invention utilizes an intelligent event recognition module to perform dual-ring global contrast processing on the image to be processed, thereby effectively enhancing the event target and suppressing background interference. By converting the event target into a bright area, an image to be segmented with the enhanced event target is obtained. The time expansion storage module sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented, and the image to be segmented is divided into a changing area and a non-changing area based on the adaptive threshold, thereby realizing the judgment of the changing area of ​​the image to be segmented.

[0056] (2) The time-expanded storage system and method for a high-speed camera based on intelligent event recognition created by the present invention expands the storage time of the high-speed camera by using a memory to store the target image where the change area is located and reuses the background image, thereby reducing the resource consumption of the FPGA board and improving the processing efficiency of the entire FPGA. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The drawings constituting part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments and descriptions of the present invention are used to explain the present invention and do not constitute an improper limitation on the present invention. In the drawings:

[0058] Figure 1 A schematic diagram of the structure of a time expansion storage system for a high-speed camera based on intelligent event recognition according to an embodiment of the present invention;

[0059] Figure 2 A schematic flow chart of a time expansion storage method for a high-speed camera based on intelligent event recognition according to an embodiment of the present invention;

[0060] Figure 3 A schematic diagram of the structure of the double-ring target template described in the embodiment of the present invention;

[0061] Figure 4 Creating an image to be processed as described in an embodiment of the present invention;

[0062] Figure 5 Creating an image to be segmented as described in an embodiment of the present invention;

[0063] Figure 6 To create the background image and target image after cutting as described in the embodiment of the present invention;

[0064] Figure 7 A schematic diagram of a process of dividing an image to be segmented according to an embodiment of the present invention.

[0065] Description of reference numerals:

[0066] 1. FPGA; 2. Memory; 11. Data sending module; 12. Intelligent event recognition module; 13. Time expansion storage module; 14. First DMA module; 15. Second DMA module; 16. Third DMA module; 17. MIG core. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the invention more clear, the invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described here are only used to explain the invention and do not constitute a limitation of the invention.

[0068] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0069] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0070] In the description of the invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the invention can be understood according to specific circumstances.

[0071] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments.

[0072] like Figure 1 As shown, a time expansion storage system for a high-speed camera based on intelligent event recognition provided by the present invention includes an FPGA 1 and a memory 2 (including but not limited to a DDR3 memory and a DDR4 memory) externally connected to the FPGA 1. A data sending module 11, an intelligent event recognition module 12, a time expansion storage module 13, a first DMA module 14, a second DMA module 15, a third DMA module 16 and a MIG core 17 are provided on the FPGA 1. The data sending module 11 is connected to the memory 2 in sequence through the intelligent event recognition module 12, the time expansion storage module 13, the first DMA module 14 and the MIG core 17. The memory 2 is connected to the time expansion storage module 13 in sequence through the MIG core 17 and the second DMA module 15. The data sending module 11 is also connected to the memory 2 in sequence through the third DMA module 16 and the MIG core 17.

[0073] The data sending module 11, the intelligent event identification module 12, the time expansion storage module 13, the first DMA module 14, the second DMA module 15, the third DMA module 16, the MIG core 17 and the memory 2 all transmit data through the AXI bus protocol.

[0074] Direct Memory Access (DMA) is a function provided by some computer bus architectures. It enables data to be sent directly from an attached device to the memory of FPGA1. AXI_DMA is a direct memory access method based on the AXI bus protocol. It can realize data transmission between other devices and memory based on the AXI bus protocol. By providing the AXI bus, the MIG core simplifies the control process of read and write operations on memory 2, making memory 2 easier to use in FPGA1.

[0075] The data sending module 11 inputs the i-th frame image of the video to be identified as the image to be processed to the intelligent event identification module 12. At the same time, the data sending module 11 also inputs the image to be processed to the memory 2 through the third DMA module 16 and the MIG core 17 in sequence. The intelligent event identification module 12 performs double-ring global contrast processing on the image to be processed to obtain the image to be segmented, and sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented, and divides the image to be segmented into a changing area containing the event target and a non-changing area without the event target based on the adaptive threshold. The memory 2 inputs the image to be processed to the time expansion storage module 13 through the MIG core 17 and the second DMA module 15. The time expansion storage module 13 performs double-ring global contrast processing on the image to be processed to obtain the image to be segmented, and sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented. The image to be segmented is divided into a changing area containing the event target and a non-changing area without the event target based on the adaptive threshold. The position in the processed image is divided into n parts to obtain a target image with a changed area and a background image without a changed area, and both the target image and the background image are input into the memory 2 for storage through the first DMA module 14, and the above operation is repeated, and it is determined whether the current background image is the same as the background image obtained by processing the previous frame image. If so, only the current target image is stored, otherwise the current background image is stored in the memory 2, so that the memory 2 stores different types of background images and target images corresponding to each type of background image, and the target image to be read corresponding to the i-th frame image and the background image corresponding to the target image to be read are spliced ​​to realize the reading of the i-th frame image in the video to be recognized.

[0076] The n-division cutting is n-equal division cutting, and the cutting position when cutting each image to be processed is the same.

[0077] like Figure 2 As shown, the present invention provides a time expansion storage method for a high-speed camera based on intelligent event recognition, which is implemented using a time expansion storage system for a high-speed camera based on intelligent event recognition, and specifically includes the following steps:

[0078] S1: Using a high-speed camera to collect the video to be identified, the data sending module 11 takes the i-th (i=1, 2, 3...) frame image in the video to be identified as the image to be processed, and sends the image to be processed to the intelligent event recognition module 12 and the memory 2 at the same time;

[0079] S2: the intelligent event recognition module 12 performs double-ring global contrast processing on the image to be processed to obtain an image to be segmented;

[0080] S21: setting the size of the double ring target template to w×h, the double ring target template comprising an inner ring target template and an outer ring target template, wherein the size of the inner ring target template is (w+2)×(h+2), and the size of the outer ring target template is (w+4)×(h+4);

[0081] w is the length of the double ring target template, and h is the width of the double ring target template.

[0082] S22: Performing a dilation operation on each pixel of the image to be processed based on the double-ring target template to obtain the image grayscale value of the inner ring dilation image and the image grayscale value of the outer ring dilation image:

[0083] ;

[0084] ;

[0085] in, is the grayscale value of the inner ring dilation image, is the image grayscale value of the outer ring dilation image, is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B1 matrix. is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B2 matrix. is the expansion operator, 1 is the operation matrix of the inner loop expansion operation, and △B2 is the operation matrix of the outer loop expansion operation.

[0086] like Figure 3 As shown, assuming that the size of the double ring target template is 3×3, the size of the inner ring target template is 5×5, and the size of the outer ring target template is 7×7. After the expansion operation, the operation matrix of the inner ring expansion operation is: ; The operation matrix of the outer ring expansion operation is: .

[0087] S23: Figure 4 The image to be processed is subjected to a beat delay operation, and a double-ring global contrast process is performed on the image to be processed by the following formula to obtain the following Figure 5 The image to be segmented is shown as follows:

[0088] ;

[0089] ;

[0090] Among them, I or is the image to be processed after the tapping delay operation. is the grayscale value of the pixel point (x, y) of the image to be segmented, and H(x) is a step function that ensures that the value of point x is not negative.

[0091] S3: the intelligent event recognition module 12 sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented, and divides the image to be segmented into a change area and a non-change area based on the adaptive threshold, and inputs the image to be segmented containing the change area and the non-change area into the time expansion storage module 13;

[0092] S31: Setting an adaptive threshold based on the grayscale value of each pixel of the image to be segmented :

[0093] ;

[0094] ;

[0095] in, is a function to obtain the mean value of the pixel values ​​of the image to be segmented. is a function for obtaining the variance of the pixel values ​​of the image to be segmented, 70 is an empirical coefficient, C is the number of pixel rows of the image to be segmented, R is the number of pixel columns of the image to be segmented, and X is the image to be segmented;

[0096] S32: Divide the image to be segmented into change areas and non-change areas based on the adaptive threshold:

[0097] ;

[0098] Among them, Change(x) is used to determine whether point x has changed.

[0099] S4: The memory 2 sends the image to be processed to the time expansion storage module 13 through the MIG core 17 and the second DMA module 15. The time expansion storage module 13 divides the image to be processed into n parts based on the position of the changed area in the image to be processed, obtains the target image containing the changed area and the background image without the changed area, and inputs both the target image and the background image into the memory 2 for storage through the first DMA module 14;

[0100] Assume that the image to be processed is cut into four parts, such as Figure 6As shown, the red frame is the target image, and the other three images constitute the background image. In step S4, the specific process of the first DMA module 14 using the memory access mechanism to write control to the memory 2 is:

[0101] S4A1: If the first DMA module 14 detects the write request signal sent by the time expansion storage module 13, the initial physical address and burst length of the image frame to be written of the image data to be written are sent to the MIG core 17, so that the memory 2 enters the waiting state for writing, and executes step S4A2; otherwise, wait for the first DMA module 14 to detect the write request signal;

[0102] S4A2: If the first DMA module 14 detects that the frame valid rising edge signal sent by the time expansion storage module 13 is in a high state, the FIFO of the FPGA 1 is reset to clear the residual data of the broken frame of the first DMA module 14, so that the data stream of the current image frame to be written is synchronized with the control signal sent by the time expansion storage module 13, and step S4A3 is executed; otherwise, wait until the first DMA module 14 detects that the frame valid rising edge signal sent by the time expansion storage module 13 is in a high state;

[0103] S4A3: If the FIFO caches data of a burst length, the data of a burst length cached in the FIFO is used as the burst length data to be written, so that the memory 2 enters the write state, and the write address enable signal is pulled high, and the address of the memory 2 receiving the burst length data to be written is determined by the MIG core 17, and step S4A4 is executed; otherwise, wait for the FIFO to cache data of a burst length;

[0104] S4A4: If the write address response signal of the MIG core 17 and the write address enable signal of the first DMA module 14 shake hands successfully, the MIG core 17 loads the write address signal, and pulls up the write response signal and the write cycle signal in the first DMA module 14, so that the memory 2 writes the write address state, and executes step S4A5; otherwise, wait for the write address response signal of the MIG core 17 to shake hands successfully with the write address enable signal of the first DMA module 14;

[0105] S4A5: If the first DMA module 14 detects that the write address enable signal and the write address response signal sent by the MIG core 17 are both in a high state, the write data enable signal is pulled high and step S4A6 is executed; otherwise, wait until the first DMA module 14 detects that the write address enable signal and the read address response signal sent by the MIG core 17 are both in a high state;

[0106] S4A6: If the data response signal of the MIG core 17 and the write data enable signal of the first DMA module 14 shake hands successfully, the first DMA module 14 writes the burst length data to be written into the memory 2 through the MIG core 17, and when writing the last byte of the burst length data to be written, pulls up the end byte data transmission signal, resets the write response signal, the write cycle signal, the write address enable signal and the write data enable signal, and executes step S4A7; otherwise, wait for the data response signal of the MIG core 17 to shake hands successfully with the write data enable signal of the first DMA module 14;

[0107] S4A7: repeating steps S4A3 to S4A6 until all burst length data of the current image frame to be written are written into the memory 2, and executing step S4A8;

[0108] S4A8: If the first DMA module 14 detects that the frame valid falling edge signal sent by the time expansion storage module 13 is in a high state, the address and frame number of the next image frame to be written are updated;

[0109] S4A9: Repeat steps S4A1 to S4A8 until the last burst length data of the image data to be written is written into the memory 2, completing the entire write cycle of the image data to be written, resetting all control signals of the first DMA module 14, and making the first DMA module 14 enter the initial state, waiting for the transmission of the next image data to be written.

[0110] In step S1 and step S4 , the first DMA module 14 and the third DMA module 16 use the same process of accessing the memory mechanism to control writing to the memory 2 .

[0111] In step S4, the specific process of the second DMA module 15 performing read control on the memory 2 through the memory access mechanism is as follows:

[0112] S4B1: If the second DMA module 15 detects the read request signal sent by the time expansion storage module 13, the time expansion storage module 13 sends the initial physical address and burst length of the image frame to be read out to the MIG core 17, so that the memory 2 enters the read cycle state and executes step S4B2; otherwise, wait for the second DMA module 15 to detect the read request signal sent by the time expansion storage module 13;

[0113] S4B2: Synchronize the frame number signal of the image frame to be written and the frame number signal of the image frame to be read, pull the read cycle signal high, and make the memory 2 enter the read address writing state;

[0114] Before this frame of data is read, the write operation can continue. The frame number signal of the image frame to be written can be changed according to the change of the written data frame, which will not cause the frame number signal of the image frame to be read to change, and will not affect the read operation, thereby causing data interruption. When the read operation occupies the bus, the data written by the write operation can be cached in the second DMA module 15 to complete the multi-frame cache architecture.

[0115] S4B3: If the second DMA module 15 detects that the read address cycle signal is pulled high, and the read data of the FIFO of FPGA1 is less than four burst lengths of data, the read address enable signal is pulled high, and the MIG core 17 is waited for to pull the read address response signal high, and step S4B4 is executed; otherwise, the MIG core 17 is waited for to pull the read address response signal high;

[0116] Since the speed at which the second DMA module 15 reads out image frames may be lower than the speed at which the memory 2 reads out image frames, and each address update causes the memory 2 to write a burst length of data into the FIFO through the MIG core 17, the second DMA module 15 may not take the data out of the FIFO in time, which may result in too much data being stored in the FIFO. When the data cached in the FIFO is greater than 4 burst lengths of data, the address update will be suspended, and the address will be updated again when the second DMA module 15 takes out enough data from the FIFO to make the remaining data in the FIFO less than 4 burst lengths.

[0117] S4B4: If the second DMA module 15 detects that the read address enable signal and the read address response signal sent by the MIG core 17 are both in a high state, the second DMA module 15 loads the data of the burst length to be read out to the MIG core 17 at the address of the memory 2, and pulls the read data enable signal of the second DMA module 15 high, pulls the read address cycle signal low, and executes step S4B5; otherwise, wait until the second DMA module 15 detects that the read address enable signal and the read address response signal sent by the MIG core 17 are both in a high state;

[0118] S4B5: If the read data response signal of the MIG core 17 and the read data enable signal of the second DMA module 15 shake hands successfully, the data of the burst length to be read out is read out from the DDR3 read-write controller to the second DMA module 15, and when the last byte of the burst length to be read out is read out, the end byte data transmission signal is pulled high, the read address cycle signal, the read address enable signal and the read address cycle signal are reset, and step S4B6 is executed; otherwise, wait for the read data response signal of the MIG core 17 to shake hands successfully with the read data enable signal of the second DMA module 15;

[0119] S4B6: Repeat steps S4B3 to S4B5 until all burst length data of the current image frame to be read out are read out from the memory 2, completing the entire read cycle, resetting all control signals of the second DMA module 15, and waiting for the transmission of the next image frame to be read out.

[0120] S5: taking the i+1th frame image in the video to be identified as the image to be processed, repeating steps S1-S4, and determining whether the current background image is the same as the background image obtained by processing the previous frame image. If so, only the current target image is stored; otherwise, the current background image is stored in the memory 2;

[0121] S6: repeating steps S1-S5 until all frame images of the video to be identified are stored;

[0122] The background images of multiple target images are the same. Therefore, for multiple target images whose changed areas are located at the same position after segmentation, only one background image is stored. When reading, the relevant target images are spliced ​​with the background image, which saves the memory of the high-speed camera and reduces the resource consumption of the FPGA1 board.

[0123] S7: splicing the target image to be read corresponding to the i-th frame image and the background image corresponding to the target image to be read, so as to realize reading of the i-th frame image in the video to be recognized.

[0124] like Figure 7 As shown, step S2 to step S3 are the process of dividing the image to be segmented: performing annular expansion operation and tapping operation on the image to be processed (taking the image to be processed as input data), respectively, calculating the pixel value of each pixel point of the image to be segmented based on the following formula to set an adaptive threshold, and finally dividing the image to be segmented into changing areas and non-changing areas based on the adaptive threshold (the changing areas and non-changing areas are the output results).

[0125] .

[0126] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the disclosure of the present invention can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.

[0127] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A time expansion storage system for a high-speed camera based on intelligent event recognition, comprising an FPGA and a memory externally connected to the FPGA, characterized in that: A data sending module, an intelligent event recognition module, a time expansion storage module, a first DMA module, a second DMA module, a third DMA module and a MIG core are provided on the FPGA. The data sending module is connected to the memory through the intelligent event recognition module, the time expansion storage module, the first DMA module and the MIG core in sequence. The memory is connected to the time expansion storage module through the MIG core and the second DMA module in sequence. The data sending module is also connected to the memory through the third DMA module and the MIG core in sequence. The data sending module inputs the i-th frame image of the video to be identified as the image to be processed to the intelligent event identification module. At the same time, the data sending module also inputs the image to be processed to the memory through the third DMA module and the MIG core in sequence. The intelligent event identification module performs double-ring global contrast processing on the image to be processed to obtain the image to be segmented, and sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented, and divides the image to be segmented into a changing area containing an event target and a non-changing area without an event target based on the adaptive threshold. The memory inputs the image to be processed to the time expansion storage module through the MIG core and the second DMA module. The time expansion storage module is based on the changing area. The target image with the changed region and the background image without the changed region are cut into n parts according to the position of the domain in the image to be processed, and the target image with the changed region and the background image without the changed region are obtained, and the target image and the background image are input into the memory for storage through the first DMA module, and the above operation is repeated, and it is judged whether the current background image is the same as the background image obtained by processing the previous frame image, and if so, only the current target image is stored, otherwise, the current background image is stored in the memory, so that the memory stores different types of background images and target images corresponding to each type of background images, and the target image to be read corresponding to the i-th frame image and the background image corresponding to the target image to be read are spliced, so as to realize the reading of the i-th frame image in the video to be recognized; The dual-annular global contrast processing specifically includes the following steps: The size of the double ring target template is set to w×h. The double ring target template includes an inner ring target template and an outer ring target template. The size of the inner ring target template is (w+2)×(h+2), and the size of the outer ring target template is (w+4)×(h+4). Based on the double ring target template, each pixel of the image to be processed is expanded to obtain the image grayscale value of the inner ring expansion image and the image grayscale value of the outer ring expansion image: ; ; in, is the grayscale value of the inner ring dilation image, is the image grayscale value of the outer ring dilation image, is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B1 matrix. is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B2 matrix. is the expansion operator, 1 is the operation matrix of the inner ring expansion operation, △B2 is the operation matrix of the outer ring expansion operation; The image to be processed is subjected to a tapping delay operation, and a double-ring global contrast process is performed on the image to be processed using the following formula to obtain the image to be segmented: ; ; Among them, I or is the image to be processed after the tapping delay operation. is the grayscale value of the pixel point (x, y) of the image to be segmented, and H(x) is a step function that ensures that the value of point x is not negative.

2. The time expansion storage system of a high-speed camera based on intelligent event recognition according to claim 1, characterized in that: The n-division cutting is n-equal division cutting, and the cutting position when cutting each image to be processed is the same.

3. A time-expanding storage method for a high-speed camera based on intelligent event recognition, implemented by using the time-expanding storage system for a high-speed camera based on intelligent event recognition according to any one of claims 1-2, characterized in that: The specific steps include: S1: Using a high-speed camera to collect a video to be identified, the data sending module takes the i-th frame image in the video to be identified as the image to be processed, and sends the image to be processed to the intelligent event recognition module and the memory at the same time; S2: the intelligent event recognition module performs double-ring global contrast processing on the image to be processed to obtain an image to be segmented; S3: the intelligent event recognition module sets an adaptive threshold based on the pixel value of each pixel point of the image to be segmented, and divides the image to be segmented into a change area and a non-change area based on the adaptive threshold, and inputs the image to be segmented containing the change area and the non-change area into the time expansion storage module; S4: the memory sends the image to be processed to the time expansion storage module through the MIG core and the second DMA module, and the time expansion storage module divides the image to be processed into n parts based on the position of the changed area in the image to be processed, obtains the target image containing the changed area and the background image without the changed area, and inputs both the target image and the background image into the memory through the first DMA module for storage; S5: taking the i+1th frame image in the video to be identified as the image to be processed, repeating steps S1-S4, and determining whether the current background image is the same as the background image obtained by processing the previous frame image. If so, only the current target image is stored; otherwise, the current background image is stored in the memory; S6: Repeat steps S1-S5 until all frame images of the video to be identified are stored.

4. The time expansion storage method of a high-speed camera based on intelligent event recognition according to claim 3 is characterized in that: The time expansion storage method of the high-speed camera based on intelligent event recognition also includes step S7: splicing the target image to be read corresponding to the i-th frame image and the background image corresponding to the target image to be read to realize the reading of the i-th frame image in the video to be recognized.

5. The time expansion storage method of a high-speed camera based on intelligent event recognition according to claim 3 is characterized in that: The step S2 specifically includes the following steps: S21: setting the size of the double ring target template to w×h, the double ring target template comprising an inner ring target template and an outer ring target template, wherein the size of the inner ring target template is (w+2)×(h+2), and the size of the outer ring target template is (w+4)×(h+4); S22: Performing a dilation operation on each pixel of the image to be processed based on the double-ring target template to obtain the image grayscale value of the inner ring dilation image and the image grayscale value of the outer ring dilation image: ; ; in, is the grayscale value of the inner ring dilation image, is the image grayscale value of the outer ring dilation image, is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B1 matrix. is a matrix with the pixel (x, y) of the image to be processed as the center pixel and the same size as the △B2 matrix. is the expansion operator, 1 is the operation matrix of the inner ring expansion operation, △B2 is the operation matrix of the outer ring expansion operation; S23: Perform a tapping delay operation on the image to be processed, and perform a double-ring global contrast process on the image to be processed by the following formula to obtain an image to be segmented: ; ; Among them, I or is the image to be processed after the tapping delay operation. is the grayscale value of the pixel point (x, y) of the image to be segmented, and H(x) is a step function that ensures that the value of point x is not negative.

6. The time expansion storage method of a high-speed camera based on intelligent event recognition according to claim 5, characterized in that: The step S3 specifically includes the following steps: S31: Setting an adaptive threshold based on the grayscale value of each pixel of the image to be segmented : ; ; in, is a function to obtain the mean value of the pixel values ​​of the image to be segmented. is a function for obtaining the variance of the pixel values ​​of the image to be segmented, 70 is an empirical coefficient, C is the number of pixel rows of the image to be segmented, R is the number of pixel columns of the image to be segmented, and X is the image to be segmented; S32: Dividing the image to be segmented into change areas and non-change areas based on an adaptive threshold: ; Among them, Change(x) is used to determine whether point x has changed.

7. The time expansion storage method of a high-speed camera based on intelligent event recognition according to claim 3 is characterized in that: In step S4, the specific process of the first DMA module using the memory access mechanism to perform write control on the memory is as follows: S4A1: if the first DMA module detects the write request signal sent by the time expansion storage module, the initial physical address and burst length of the image frame to be written of the image data to be written are sent to the MIG core, so that the memory enters the waiting state for writing, and step S4A2 is executed; otherwise, wait for the first DMA module to detect the write request signal; S4A2: If the first DMA module detects that the frame valid rising edge signal sent by the time expansion storage module is in a high state, the FPGA FIFO is reset to clear the residual data of the broken frame of the first DMA module, so that the data stream of the current image frame to be written is synchronized with the control signal sent by the time expansion storage module, and step S4A3 is executed; otherwise, wait until the first DMA module detects that the frame valid rising edge signal sent by the time expansion storage module is in a high state; S4A3: If the FIFO caches data of a burst length, the data of a burst length cached in the FIFO is used as the burst length data to be written, and the write response signal and the write cycle signal are pulled high in the first DMA module to put the memory into a write state, and the write address enable signal is pulled high, and step S4A4 is executed; otherwise, wait for the FIFO to cache data of a burst length; S4A4: If the write address response signal of the MIG core and the write address enable signal of the first DMA module shake hands successfully, the MIG core loads the write address signal, and uses the MIG core to determine the address of the memory receiving the burst length data to be written, so that the memory writes the write address state and executes step S4A5; otherwise, wait for the write address response signal of the MIG core to shake hands successfully with the write address enable signal of the first DMA module; S4A5: If the first DMA module detects that the write address enable signal and the write address response signal sent by the MIG core are both in a high state, the write data enable signal is pulled high and step S4A6 is executed; otherwise, wait until the first DMA module detects that the sent write address enable signal and the read address response signal sent by the MIG core are both in a high state; S4A6: If the data response signal of the MIG core shakes hands successfully with the write data enable signal of the first DMA module, the first DMA module writes the burst length data to be written into the memory through the MIG core, and when writing the last byte of the burst length data to be written, pulls up the end byte data transmission signal, resets the write response signal, the write cycle signal, the write address enable signal and the write data enable signal, and executes step S4A7; otherwise, wait for the data response signal of the MIG core to shake hands successfully with the write data enable signal of the first DMA module; S4A7: repeating steps S4A3 to S4A6 until all burst length data of the current image frame to be written are written into the memory, and executing step S4A8; S4A8: If the first DMA module detects that the frame valid falling edge signal sent by the time expansion storage module is in a high state, the address and frame number of the next image frame to be written are updated; S4A9: Repeat steps S4A1 to S4A8 until the last burst length data of the image data to be written is written into the memory, completing the entire write cycle of the image data to be written, resetting all control signals of the first DMA module, making the first DMA module enter the initial state, and waiting for the transmission of the next image data to be written.

8. The time expansion storage method of a high-speed camera based on intelligent event recognition according to claim 7, characterized in that: In step S1 and step S4, the first DMA module and the third DMA module have the same process of controlling the writing of the memory by using the memory access mechanism.

9. The time expansion storage method of a high-speed camera based on intelligent event recognition according to claim 3, characterized in that: In step S4, the specific process of the second DMA module performing read control on the memory through the memory access mechanism is as follows: S4B1: If the second DMA module detects the read request signal sent by the time expansion storage module, the time expansion storage module sends the initial physical address and burst length of the image frame to be read out to the MIG core, so that the memory enters the read cycle state, and executes step S4B2; Otherwise, wait for the second DMA module to detect the read request signal sent by the time expansion storage module; S4B2: Synchronize the frame number signal of the image frame to be written and the frame number signal of the image frame to be read, pull the read cycle signal high, and make the memory enter the read address writing state; S4B3: If the second DMA module detects that the read address cycle signal is pulled high, and the read data of the FPGA FIFO is less than four burst lengths of data, the read address enable signal is pulled high, and the MIG core is waited for to pull the read address response signal high, and step S4B4 is executed; otherwise, the MIG core is waited for to pull the read address response signal high; S4B4: If the second DMA module detects that the read address enable signal and the read address response signal sent by the MIG core are both in a high state, the second DMA module loads the data of the burst length to be read out to the MIG core at the address of the memory, and pulls the read data enable signal of the second DMA module high, pulls the read address cycle signal low, and executes step S4B5; otherwise, wait until the second DMA module detects that the read address enable signal and the read address response signal sent by the MIG core are both in a high state; S4B5: If the read data response signal of the MIG core shakes hands successfully with the read data enable signal of the second DMA module, the data of the burst length to be read out is read out from the DDR3 read-write controller to the second DMA module, and when the last byte of the burst length to be read out is read out, the end byte data transmission signal is pulled high, the read address cycle signal, the read address enable signal and the read address cycle signal are reset, and step S4B6 is executed; otherwise, wait for the read data response signal of the MIG core to shake hands successfully with the read data enable signal of the second DMA module; S4B6: Repeat steps S4B3 to S4B5 until all burst length data of the current image frame to be read out are read out from the memory, completing the entire read cycle, resetting all control signals of the second DMA module, and waiting for the transmission of the next image frame to be read out.

Citation Information

Patent Citations

  • Image defect fitting method and system and storage medium

    CN113077454A

  • High speed image acquisition for microelectronics inspection

    US5302836A