Optimization method and device for morphological filtering image loss of photoelectric tracking system
By optimizing the morphological filtering algorithm of the photoelectric tracking system and increasing or decreasing the number of pixels, the pixel loss problem was solved, and the system performance was improved.
Patent Information
- Application Number
- CN202311416106.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-10-27
AI Technical Summary
The morphological filtering algorithm in existing photoelectric tracking systems leads to pixel loss, affecting the field of view and target acquisition time, and reducing system performance.
By obtaining the basic operation sequence of the morphological filtering algorithm, the number of pixels to be added and removed for each operation is determined. After optimization, a new operation sequence is formed to add and remove corresponding pixels before and after the image sequence, thus avoiding pixel loss.
Effectively avoid pixel loss, improve the performance of the photoelectric tracking system, and ensure optimization of the field of view and target acquisition time.
Smart Images

Figure CN117237247B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for optimizing image loss through morphological filtering in a photoelectric tracking system. Background Technology
[0002] An optoelectronic tracking system is a complex real-time system integrating optoelectronic detection, image processing, servo control, and mechanical structure. Field of view and target acquisition time are crucial performance indicators for optoelectronic tracking systems. In the image processing section, FPGA-based morphological filtering algorithms are typically used. However, these algorithms result in pixel loss, leading to a reduced field of view and increased target acquisition time, severely impacting the system's performance.
[0003] Currently, there are no relevant optimization methods. Therefore, there is an urgent need to provide a method for optimizing the morphological filtering image loss in photoelectric tracking systems. Summary of the Invention
[0004] This invention provides a method and apparatus for optimizing image loss through morphological filtering in a photoelectric tracking system, which can effectively avoid pixel loss and improve the performance of the photoelectric tracking system.
[0005] In a first aspect, embodiments of the present invention provide a method for optimizing morphological filtering image loss in a photoelectric tracking system, comprising:
[0006] Obtain the basic morphological operation sequence formed by the morphological filtering algorithm used by the photoelectric tracking system;
[0007] Based on the number of structural elements corresponding to each basic morphological operation in the basic morphological operation sequence, determine the number of first pixels to be added and the number of second pixels to be deleted for each basic morphological operation.
[0008] Each basic morphological operation is optimized so that the optimized basic morphological operation performs the following steps: adding the corresponding number of pixels before and after the image sequence to be processed to obtain the reconstructed image sequence; performing the basic morphological operation on the reconstructed image sequence to obtain the result sequence; and deleting the corresponding number of pixels before and after the result sequence to obtain the output image sequence.
[0009] The photoelectric tracking system uses an operation sequence formed by optimized basic morphological operations to perform morphological filtering on the image.
[0010] Secondly, embodiments of the present invention also provide a morphological filtering image loss optimization device for an optoelectronic tracking system, comprising:
[0011] The acquisition unit is used to acquire the basic morphological operation sequence formed by the morphological filtering algorithm adopted by the photoelectric tracking system;
[0012] The determining unit is used to determine the number of first pixels to be added and the number of second pixels to be deleted for each basic morphological operation based on the number of structural elements corresponding to each basic morphological operation in the basic morphological operation sequence.
[0013] The processing unit is used to optimize each basic morphological operation so that the optimized basic morphological operation is performed as follows: adding a number of pixels corresponding to the first pixel before and after the image sequence to be processed to obtain a reconstructed image sequence; performing the basic morphological operation on the reconstructed image sequence to obtain a result sequence; and deleting a number of pixels corresponding to the second pixel before and after the result sequence to obtain an output image sequence.
[0014] A filtering unit is used by the photoelectric tracking system to perform morphological filtering on the image using an operation sequence formed by optimized basic morphological operations.
[0015] Thirdly, embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any embodiment of this specification.
[0016] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods described in any embodiment of this specification.
[0017] This invention provides a method and apparatus for optimizing image loss through morphological filtering in a photoelectric tracking system. The morphological filtering algorithm used in the photoelectric tracking system can form a basic morphological operation sequence, which includes multiple basic morphological operations arranged in sequence. Since edge image loss occurs after performing basic morphological operations on an image sequence, pixels corresponding to a first number of pixels are added before and after the image sequence to be processed before performing the basic morphological operations. Then, the basic morphological operations are performed to obtain a result sequence, so that the lost image pixels are the added pixels. Then, the extra pixels are deleted, that is, pixels corresponding to a second number of pixels are deleted before and after the result sequence. The operation sequence formed by the optimized basic morphological operations is placed in the photoelectric tracking system to perform morphological filtering on the image. This can effectively avoid pixel loss and improve the performance of the photoelectric tracking system. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of a morphological filtering image loss optimization method for an optoelectronic tracking system according to an embodiment of the present invention;
[0020] Figure 2 This is a hardware architecture diagram of an electronic device provided in an embodiment of the present invention;
[0021] Figure 3 This is a structural diagram of a morphological filtering image loss optimization device for an optoelectronic tracking system provided in an embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0023] Please refer to Figure 1 This invention provides a method for optimizing morphological filtering image loss in a photoelectric tracking system, the method comprising:
[0024] Step 100: Obtain the basic morphological operation sequence formed by the morphological filtering algorithm used by the photoelectric tracking system;
[0025] Step 102: Based on the number of structural elements corresponding to each basic morphological operation in the basic morphological operation sequence, determine the number of first pixels to be added and the number of second pixels to be deleted for each basic morphological operation.
[0026] Step 104: Optimize each basic morphological operation so that the optimized basic morphological operation is performed as follows: add the corresponding number of pixels before and after the image sequence to be processed to obtain the reconstructed image sequence; perform the basic morphological operation on the reconstructed image sequence to obtain the operation result sequence; delete the corresponding number of pixels before and after the operation result sequence to obtain the output image sequence.
[0027] Step 106: The photoelectric tracking system performs morphological filtering on the image using an operation sequence formed by the optimized basic morphological operations.
[0028] In this embodiment of the invention, the morphological filtering algorithm used in the photoelectric tracking system can form a basic morphological operation sequence. This basic morphological operation sequence includes multiple basic morphological operations arranged in sequence. Since edge image loss occurs after performing basic morphological operations on the image sequence, pixels corresponding to the first number of pixels are added before and after the image sequence to be processed before performing the basic morphological operations. Then, the basic morphological operations are performed to obtain the result sequence, so that the lost image pixels are the added pixels. Then, the extra pixels are deleted, that is, pixels corresponding to the second number of pixels are deleted before and after the result sequence. The operation sequence formed by the optimized basic morphological operations is placed in the photoelectric tracking system to perform morphological filtering on the image. This can effectively avoid pixel loss and improve the performance of the photoelectric tracking system.
[0029] The following description Figure 1 The execution method for each step is shown.
[0030] First, for step 100, a basic morphological operation sequence is obtained from the morphological filtering algorithm used by the photoelectric tracking system.
[0031] Morphological filtering algorithms include two types of morphological operations: basic morphological operations and advanced morphological operations. Basic morphological operations include erosion and dilation; advanced morphological operations are based on basic morphological operations and include opening, closing, top-hat, black-hat operations, and morphological gradient operations. Advanced morphological operations can be decomposed into multiple basic morphological operations. Therefore, to obtain the sequence of basic morphological operations formed by the morphological filtering algorithm used in the photoelectric tracking system, it is necessary to first determine whether advanced morphological operations exist. If advanced morphological operations exist, they need to be decomposed into basic morphological operations.
[0032] Specifically, step 100 may include the following steps:
[0033] A1. Obtain the morphological filtering algorithm used by the photoelectric tracking system;
[0034] A2. Determine whether the morphological filtering algorithm includes advanced morphological operations. If it does, proceed to step A3; if it does not, proceed to step A4.
[0035] A3. Decompose the advanced morphological operation into multiple basic morphological operations with an arranged order, and perform step A4.
[0036] A4. Form a basic morphological operation sequence from the multiple basic morphological operations that have an order in the morphological filtering algorithm.
[0037] It should be noted that breaking down advanced morphological operations into multiple basic morphological operations with a specific order is a current technique and will not be elaborated upon here. For example, the opening operation can be broken down into erosion followed by dilation.
[0038] Since the morphological operations included in the morphological filtering algorithm have a sequential order, after breaking down the high-level morphological operations into multiple basic morphological operations with a sequential order, the corresponding high-level morphological operations are replaced by these multiple basic morphological operations with a sequential order, resulting in multiple basic morphological operations with a sequential order in the morphological filtering algorithm.
[0039] Then, for step 102, based on the number of structural elements corresponding to each basic morphological operation in the basic morphological operation sequence, the number of first pixels to be added and the number of second pixels to be deleted corresponding to each basic morphological operation are determined.
[0040] Each basic morphological operation has a corresponding number of structuring elements. The structuring elements are a key parameter in morphological filtering, determining the pixel loss for each basic morphological operation. Therefore, the number of structuring elements for each basic morphological operation can be used to determine the number of pixels to be added or removed. Assuming the number of structuring elements is N*1, then the pixel loss for each basic morphological operation is N-1.
[0041] To ensure that the number of pixels in the image sequence before performing basic morphological operations is the same as the number of pixels in the image sequence after performing basic morphological operations, it can be guaranteed that the sum of the number of first pixels added before and after is equal to the sum of the number of second pixels deleted before and after, plus the sum of the number of pixels lost before and after.
[0042] Preferably, step 102 may include:
[0043] Each basic morphological operation requires (N-1) additional first pixels; N is the number of structuring elements corresponding to the basic morphological operation, indicating that the number of structuring elements is N*1; (N-1) pixels need to be added before and after;
[0044] If N is odd, it means that the (N / 2)th pixel is selected as the anchor point. After the basic morphological operation, the number of pixels lost before and after is (N-1) / 2. Therefore, the number of second pixels to be deleted corresponding to each basic morphological operation is (N-1) / 2; that is, (N-1) / 2 pixels need to be deleted before and after.
[0045] If N is even and the (N / 2)th pixel is selected as the anchor point, then after the basic morphological operation, the number of pixels lost in the front is (N / 2-1) and the number of pixels lost in the back is (N / 2). Therefore, the number of second pixels to be deleted for each basic morphological operation is as follows: (N / 2) pixels are deleted in the front and (N / 2-1) pixels are deleted in the back.
[0046] If N is even and the (N / 2+1)th pixel is selected as the anchor point, then after the basic morphological operation, the number of pixels lost in the front is (N / 2) and the number of pixels lost in the back is (N / 2-1). Therefore, the number of second pixels to be deleted for each basic morphological operation is as follows: (N / 2-1) pixels are deleted in the front and (N / 2) pixels are deleted in the back.
[0047] Furthermore, since basic morphological operations include erosion and dilation, erosion is a minimum value filtering operation, replacing the anchor pixel value with the minimum value in the structuring element, while dilation is the opposite, a maximum value filtering operation, replacing the anchor pixel value with the maximum value in the structuring element. Therefore, it is necessary to add pixels with different pixel values based on the characteristics of erosion and dilation operations. Specifically:
[0048] If the basic morphological operation is erosion, then the pixel value of each additional pixel before and after the image sequence to be processed is the maximum pixel value; for example, the maximum pixel value is 255.
[0049] If the basic morphological operation is dilation, then the pixel value of each additional pixel before and after the image sequence to be processed is the minimum pixel value; for example, the minimum pixel value is 0.
[0050] This ensures that the added pixels will not affect the basic morphological operations.
[0051] Next, for step 104, each basic morphological operation is optimized so that the optimized basic morphological operation is performed as follows: the number of pixels corresponding to the first pixel is added before and after the image sequence to be processed to obtain the reconstructed image sequence; the basic morphological operation is performed on the reconstructed image sequence to obtain the result sequence; and the number of pixels corresponding to the second pixel is deleted before and after the result sequence to obtain the output image sequence.
[0052] Because erosion and dilation operations have different characteristics, different image loss optimization methods are designed to address these differences.
[0053] 1. Optimize the erosion operation so that the optimized erosion operation performs the following steps S11 to S14:
[0054] S11: Cache image, cache image sequence P1 into on-chip RAM;
[0055] S12: Within (N-1) pixel clock cycles after the start of buffering, input (N-1) maximum pixel values. After (N-1) pixel clock cycles, read the buffered image sequence from RAM. After reading all of them, input (N-1) maximum pixel values to obtain the reconstructed image sequence.
[0056] S13: Perform erosion operation on the reconstructed image sequence to obtain the result sequence;
[0057] S14: Delete the corresponding number of pixels before and after the result sequence of the operation.
[0058] 2. For the expansion operation, optimization is performed so that the expanded operation executes the following steps S21 to S24:
[0059] S21: Cache the image, cache the image sequence P1 into the on-chip RAM;
[0060] S22: Within (N-1) pixel clock cycles after the start of caching, input (N-1) minimum pixel values. After (N-1) pixel clock cycles, read the cached image sequence from RAM. After reading all the images, input (N-1) minimum pixel values to obtain the reconstructed image sequence.
[0061] S23: Perform dilation operation on the reconstructed image sequence to obtain the result sequence;
[0062] S24: Delete the corresponding number of pixels before and after the result sequence of the operation.
[0063] It should be noted that when deleting the corresponding number of pixels before and after the result sequence of the operation, if N is an even number, you can delete (N / 2-1) pixels before the result sequence of the operation and (N / 2) pixels after the result sequence of the operation; or, you can delete (N / 2) pixels before the result sequence of the operation and (N / 2-1) pixels after the result sequence of the operation.
[0064] In this way, an operation sequence formed by the optimized basic morphological operations can be obtained.
[0065] The following uses the top-hat algorithm, an advanced morphological operation, as an example to illustrate its optimized operation process. Assuming the input is an image with a resolution of 640*512 and a bit width of 8 bits, and the anchor point is chosen as the last pixel of the structuring element, the optimized operation process is as follows:
[0066] Step 1: Image Cache. Driven by the pixel clock, the first row of the image sequence P1 in the on-chip RAM1 is cached.
[0067] Step 2: Generate the reconstructed image sequence. Within N-1 pixel clock cycles after the first row is cached, input the maximum value of N-1 pixels, Pmax = 255, into the reconstructed image sequence P2. After N-1 pixel clock cycles, read the cached first row of the image from RAM1 and input it into the reconstructed image sequence P2. After the first row is completely read, input the maximum value of N-1 pixels, Pmax = 255, into the reconstructed image sequence P2.
[0068] Step 3: Erosion operation. Perform an erosion operation on the reconstructed image sequence P2 to generate the erosion result sequence P3.
[0069] Step 4: Image caching. Driven by the pixel clock, the erosion operation result sequence P3 is cached in the on-chip RAM2.
[0070] Step 5: Generate the reconstructed image sequence P4. Starting from the moment when the erosion operation result sequence P3 is cached, input the minimum value Pmin = 0 of N-1 pixels into the reconstructed image sequence P4. After N-1 pixel clock cycles, read the cached erosion operation result sequence P3 from RAM2 and input it into the reconstructed image sequence P4. After all of P3 has been read, input the minimum value Pmin = 0 of N-1 pixels into the reconstructed image sequence P4.
[0071] Step 6: Dilation operation. Perform a dilation operation on the reconstructed image sequence P4 to generate the dilation result sequence P5.
[0072] Step 7: Extract the valid data from the result sequence of the dilation operation. Delete N-1 data points before and after the result sequence P5, and extract the remaining data as the valid data sequence P6, with a total of 640 valid data points.
[0073] Step 8: Top-hat operation. After delaying the image sequence P1 by 2*(N-1) pixel clock cycles, an image sequence P1' aligned with the data of P6 is obtained. The difference between P1' and P6 is calculated to generate the top-hat operation result sequence P7.
[0074] Step 9: Repeat steps 1 through 7 for the other rows to complete the morphological top-hat filtering operation on the complete image.
[0075] Finally, regarding step 106, the photoelectric tracking system performs morphological filtering on the image using an operation sequence formed by the optimized basic morphological operations.
[0076] To ensure the accuracy of the timing of the operation sequence formed by the optimized basic morphological operations, and thus the accuracy of the morphological filtering results of the photoelectric tracking system on the image, in one embodiment of the present invention, the timing of the operation sequence formed by the optimized basic morphological operations can be checked. If the timing is abnormal, a timing constraint method is used to optimize the timing of the operation sequence, so that the photoelectric tracking system can use the timing-optimized operation sequence to perform morphological filtering on the image.
[0077] Timing anomalies are usually caused by register setup and hold times not meeting requirements. Therefore, timing constraints can be used to optimize the operation sequence.
[0078] In one implementation, the timing of the operation sequence formed by the optimized basic morphological operations can be checked in the following way:
[0079] The test image is subjected to morphological filtering processing on the operation sequence formed by the optimized basic morphological operations to obtain the output image; the pixel value change patterns of the test image and the output image are compared. If the change patterns are the same, the timing is normal; if the change patterns are different, the timing is abnormal.
[0080] For example, if the pixel values in the first row of the test image are decreasing then increasing, with the 7th pixel being the minimum, then the pixel values in the first row of the output image must also be decreasing then increasing, with the 7th pixel being the minimum. If the first row of the output image also needs to be decreasing then increasing, with the 8th pixel being the minimum, this indicates a timing error of one pixel. The timing needs to be moved forward one pixel to ensure proper timing.
[0081] like Figure 2 , Figure 3 As shown, this embodiment of the invention provides a device for optimizing morphological filtering image loss in a photoelectric tracking system. The device embodiment can be implemented in software, hardware, or a combination of both. From a hardware perspective, as... Figure 2 The diagram shown is a hardware architecture diagram of an electronic device for optimizing morphological image loss in a photoelectric tracking system, as provided in an embodiment of the present invention. (Except for...) Figure 2 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing packets. Taking software implementation as an example, such as... Figure 3As shown, a device in a logical sense is formed by the CPU of its electronic device reading the corresponding computer program from non-volatile memory into memory and running it. This embodiment provides a morphological filtering image loss optimization device for a photoelectric tracking system, comprising:
[0082] The acquisition unit 301 is used to acquire the basic morphological operation sequence formed by the morphological filtering algorithm adopted by the photoelectric tracking system;
[0083] The determining unit 302 is used to determine the number of first pixels to be added and the number of second pixels to be deleted for each basic morphological operation based on the number of structural elements corresponding to each basic morphological operation in the basic morphological operation sequence.
[0084] The processing unit 303 is used to perform optimization processing on each basic morphological operation, so that the optimized basic morphological operation is performed as follows: adding pixels corresponding to the first number of pixels before and after the image sequence to be processed to obtain a reconstructed image sequence; performing the basic morphological operation on the reconstructed image sequence to obtain a result sequence; and deleting pixels corresponding to the second number of pixels before and after the result sequence to obtain an output image sequence.
[0085] The filtering unit 304 is used by the photoelectric tracking system to perform morphological filtering on the image using an operation sequence formed by optimized basic morphological operations.
[0086] In one embodiment of the present invention, the acquisition unit is specifically used to perform the following steps.
[0087] A1. Obtain the morphological filtering algorithm used by the photoelectric tracking system;
[0088] A2. Determine whether the morphological filtering algorithm includes advanced morphological operations. If it does, proceed to step A3; if it does not, proceed to step A4.
[0089] A3. Decompose the advanced morphological operation into multiple basic morphological operations with an arranged order, and perform step A4.
[0090] A4. Form a basic morphological operation sequence from the multiple basic morphological operations that have an order in the morphological filtering algorithm.
[0091] In one embodiment of the present invention, the determining unit is specifically used for: the number of first pixels to be added corresponding to each basic morphological operation is (N-1); N is the number of structural elements corresponding to the basic morphological operation; if N is odd, the number of second pixels to be deleted corresponding to each basic morphological operation is (N-1) / 2; if N is even, and the (N / 2)th pixel is selected as the anchor point, the number of second pixels to be deleted corresponding to each basic morphological operation is: (N / 2) pixels deleted from the front and (N / 2-1) pixels deleted from the back; if N is even, and the (N / 2+1)th pixel is selected as the anchor point, the number of second pixels to be deleted corresponding to each basic morphological operation is: (N / 2-1) pixels deleted from the front and (N / 2) pixels deleted from the back.
[0092] In one embodiment of the present invention, the basic morphological operations include erosion and expansion;
[0093] If the basic morphological operation is erosion, then the pixel value of each additional pixel before and after the image sequence to be processed is the maximum pixel value; if the basic morphological operation is dilation, then the pixel value of each additional pixel before and after the image sequence to be processed is the minimum pixel value.
[0094] In one embodiment of the present invention, the processing unit is further configured to: check the timing of the operation sequence formed by the optimized basic morphological operations; if the timing is abnormal, optimize the operation sequence by using a timing constraint method, so that the photoelectric tracking system can use the timing-optimized operation sequence to perform morphological filtering processing on the image.
[0095] In one embodiment of the present invention, when the processing unit checks the timing of the operation sequence formed by the optimized basic morphological operations, it specifically includes: performing morphological filtering on the test image using the operation sequence formed by the optimized basic morphological operations to obtain an output image; comparing the pixel value change patterns of the test image and the output image; if the change patterns are the same, the timing is normal; if the change patterns are different, the timing is abnormal.
[0096] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on a morphological filtering image loss optimization device for an electro-optical tracking system. In other embodiments of the present invention, a morphological filtering image loss optimization device for an electro-optical tracking system may include more or fewer components than illustrated, or combine some components, split some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0097] The information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the method embodiment of the present invention, and the specific details can be found in the description of the method embodiment of the present invention, and will not be repeated here.
[0098] This invention also provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements a morphological filtering image loss optimization method for a photoelectric tracking system according to any embodiment of this invention.
[0099] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform a morphological filtering image loss optimization method for a photoelectric tracking system according to any embodiment of this invention.
[0100] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.
[0101] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.
[0102] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.
[0103] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.
[0104] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.
[0105] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0106] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for optimizing morphological filtering image loss of an electro-optical tracking system, characterized in that, The method comprises the following steps: obtaining a basic morphological operation sequence formed by a plurality of basic morphological operations arranged in sequence in a morphological filtering algorithm adopted by the optoelectronic tracking system; the basic morphological operations include erosion and dilation; determining the first pixel number to be added and the second pixel number to be deleted corresponding to each basic morphological operation based on the number of structural elements corresponding to each basic morphological operation in the basic morphological operation sequence; optimizing each basic morphological operation, so that the optimized basic morphological operation performs the following operations: adding a corresponding first pixel number of pixels before and after a sequence of images to be processed to obtain a sequence of reconstructed images; performing the basic morphological operation on the sequence of reconstructed images to obtain a sequence of operation results, and deleting a corresponding second pixel number of pixels before and after the sequence of operation results to obtain a sequence of output images; the optoelectronic tracking system performs morphological filtering on images by using an operation sequence formed by the optimized basic morphological operation.
2. The method of claim 1, wherein, The method for obtaining the basic morphological operation sequence formed by the morphological filtering algorithm adopted by the optoelectronic tracking system comprises the following steps: A1, obtaining a morphological filtering algorithm adopted by the optoelectronic tracking system; A2, determining whether the morphological filtering algorithm includes a high-level morphological operation, if yes, performing step A3; if not, performing step A4; A3, splitting the high-level morphological operation into a plurality of basic morphological operations arranged in sequence, and performing step A4; A4, forming a basic morphological operation sequence from the plurality of basic morphological operations arranged in sequence in the morphological filtering algorithm.
3. The method of claim 1, wherein, The method for determining the first pixel number to be added and the second pixel number to be deleted corresponding to each basic morphological operation comprises the following steps: the first pixel number to be added corresponding to each basic morphological operation is (N-1); N is the number of structural elements corresponding to the basic morphological operation; if N is an odd number, the second pixel number to be deleted corresponding to each basic morphological operation is (N-1) / 2; if N is an even number, and the (N / 2)th pixel is selected as an anchor point, the second pixel number to be deleted corresponding to each basic morphological operation is (N / 2) before and (N / 2-1) after, respectively; if N is an even number, and the (N / 2+1)th pixel is selected as an anchor point, the second pixel number to be deleted corresponding to each basic morphological operation is (N / 2-1) before and (N / 2) after, respectively.
4. The method according to claim 3, wherein if the basic morphological operation is erosion, the pixel value of the pixels added before and after the sequence of images to be processed is the maximum pixel value; if the basic morphological operation is dilation, the pixel value of the pixels added before and after the sequence of images to be processed is the minimum pixel value.
5. The method according to any one of claims 1 to 4, characterized in that, Before the optoelectronic tracking system performs morphological filtering on images by using the operation sequence formed by the optimized basic morphological operation, the method further comprises the following steps: The time sequence of the operation sequence formed by the basic morphological operation after the optimization processing is checked, and if the time sequence is abnormal, the operation sequence is optimized in a time sequence constraint manner to make the photoelectric tracking system perform morphological filtering on the image using the operation sequence after the time sequence optimization.
6. The method of claim 5, wherein, The checking of the time sequence of the operation sequence formed by the basic morphological operation after the optimization processing comprises: The operation sequence formed by the basic morphological operation after the optimization processing is used to perform morphological filtering on the test image to obtain an output image; The pixel value change rule of the test image and the output image is compared, if the change rules are the same, the time sequence is normal, and if the change rules are different, the time sequence is abnormal.
7. An electro-optical tracking system morphological filtering image loss optimization apparatus, characterized by, Comprise: The acquisition unit is used to acquire a basic morphological operation sequence formed by a plurality of basic morphological operations with an arrangement order in a morphological filtering algorithm used by the photoelectric tracking system; the basic morphological operation comprises erosion and expansion; The determination unit is used to determine the first pixel number required to be increased and the second pixel number required to be reduced corresponding to each basic morphological operation based on the number of structure elements corresponding to each basic morphological operation in the basic morphological operation sequence; The processing unit is used to perform optimization processing on each basic morphological operation, so that the basic morphological operation after the optimization processing performs: adding a corresponding first pixel number of pixels before and after a to-be-processed image sequence to obtain a reconstructed image sequence; performing the basic morphological operation on the reconstructed image sequence to obtain an operation result sequence, and deleting a corresponding second pixel number of pixels before and after the operation result sequence to obtain an output image sequence; The filtering unit is used to perform morphological filtering on the image by the photoelectric tracking system using the operation sequence formed by the basic morphological operation after the optimization processing. 8.An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method of any one of claims 1-6. 9.A computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed in a computer, causes the computer to perform the method of any one of claims 1-6.
Citation Information
Patent Citations
Method for removing black edge of image
CN112634229A
Image target identification method and device, electronic equipment and storage medium
CN114529724A