Offset correction template automatic update method and device
By automatically creating and updating the offset correction template when the device is idle, the problems of cumbersome and low efficiency in the prior art are solved, and the effect of simplifying operation and improving acquisition efficiency is achieved.
Patent Information
- Application Number
- CN202111562534.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-12-20
AI Technical Summary
In the prior art, the updating method of offset correction templates is complicated, resulting in low convenience of equipment use and low image acquisition efficiency, which cannot meet user needs.
In the idle state of the device, dark field images are collected at preset frequency, first and second offset correction templates are automatically created, and correction templates are selected according to time sorting when bright field image acquisition, so as to realize automatic update of the template.
It simplifies operation steps, improves the convenience of the equipment, and does not extend the image acquisition time, improves the image acquisition efficiency, and meets the user's usage needs.
Smart Images

Figure CN114463194B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image correction, and in particular to a method and device for automatically updating an offset correction template. Background Art
[0002] With the rapid development of radioactive detection technology, radioactive detection has become an important detection method and has been remarkably applied in many fields such as biomedicine, materials science, industrial testing, and homeland security. At the same time, the requirements for the image quality of the detector are gradually increasing.
[0003] Among them, due to the differences in the physical channels of the image sensor and the acquisition circuit hardware, the grayscale values of the actual collected image are not uniform, and will include channel differences introduced by the image sensor and the acquisition circuit itself. When this part of the image difference is finally used, it is necessary to create an offset correction template and use the offset correction template to correct the image to eliminate it. Correcting this part of the image background difference is called offset background bias correction.
[0004] However, in actual operation, the offset correction template needs to be updated due to temperature changes in the imaging device. The existing methods are manual update or alternating between the acquisition of bright field images and dark field images. Among them, the manual update method is cumbersome and reduces the convenience of using the device. The alternating method prolongs the image acquisition time and reduces the image acquisition efficiency. Both methods cannot meet the needs of users. Summary of the Invention
[0005] In order to overcome the shortcomings of the existing technology, the present invention proposes a method and device for automatically updating an offset correction template. When in an idle state, dark field images are captured at a preset frequency, and a first offset correction template and a second offset correction template are alternately performed based on the captured dark field images. When performing bright field image capture, image correction is performed based on the prepared correction template. This realizes the automatic update of the offset correction template, simplifies the operation steps, improves the ease of use of the device, does not prolong the image capture time, improves the image capture efficiency, and meets the user's usage needs.
[0006] To solve the above problems, the present invention adopts a technical solution: a method for automatically updating an offset correction template, the offset correction template automatic updating method comprising: S101: determining whether the current state is idle, if so, executing S102, if not, executing S103; S102: acquiring dark field images at a preset frequency, cyclically preparing a first offset correction template and a second offset correction template based on the dark field images, and determining whether the preset conditions are currently met, if so, executing S103, if not, continuing to execute S102; S103: executing or receiving corresponding operations according to the preset conditions, and when the corresponding operation is bright field image acquisition, selecting a correction template according to the time sorting of the correction templates to correct the acquired bright field image, the correction templates comprising a first offset correction template and a second offset correction template.
[0007] Furthermore, the steps of acquiring dark field images at a preset frequency and cyclically producing a first offset correction template and a second offset correction template based on the dark field images specifically include: acquiring dark field images at equal time intervals, superimposing and summing adjacent multiple frames of dark field images to form a first offset correction template, and after producing the first offset correction template, continuing to acquire dark field images at equal time intervals, superimposing and summing adjacent multiple frames of dark field images to form a second offset correction template.
[0008] Furthermore, after the step of acquiring dark field images at equal time intervals, the method further includes: automatically generating a number for each frame of the dark field image.
[0009] Furthermore, the step of determining whether a preset condition is currently satisfied specifically includes: determining whether there is an exposure operation currently, receiving an issued operation instruction, and receiving at least one of a trigger signal from a high-voltage terminal.
[0010] Furthermore, the step of selecting a correction template according to the time order of the correction templates to correct the collected bright field image specifically includes: obtaining a correction template that is closest to the bright field image in time according to the time order, and correcting the bright field image using the correction template.
[0011] Based on the same inventive concept, the present invention also proposes an offset correction template automatic update device, the offset correction template automatic update device includes a processor and a memory, the processor is communicatively connected to the memory, the memory stores program data, the processor executes an offset correction template automatic update method according to the program data, and the offset correction template automatic update method includes: S201: determine whether the current state is idle, if so, execute S202, if not, execute S203; S202: capture dark field images at a preset frequency, cyclically generate a first offset correction template and a second offset correction template according to the dark field image, and determine whether the preset conditions are currently met, if so, execute S203, if not, continue to execute S202; S203: execute corresponding operations according to the preset conditions, and when the corresponding operation is bright field image capture, select a correction template according to the time sorting of the correction template to correct the captured bright field image, the correction template includes a first offset correction template and a second offset correction template.
[0012] Furthermore, the steps of acquiring dark field images at a preset frequency and cyclically producing a first offset correction template and a second offset correction template based on the dark field images specifically include: acquiring dark field images at equal time intervals, superimposing and summing adjacent multiple frames of dark field images to form a first offset correction template, and after producing the first offset correction template, continuing to acquire dark field images at equal time intervals, superimposing and summing adjacent multiple frames of dark field images to form a second offset correction template.
[0013] Furthermore, after the step of acquiring dark field images at equal time intervals, the method further includes: automatically generating a number for each frame of the dark field image.
[0014] Furthermore, the step of determining whether a preset condition is currently satisfied specifically includes: determining whether there is an exposure operation currently, receiving an issued operation instruction, and receiving at least one of a trigger signal from a high-voltage terminal.
[0015] Furthermore, the step of selecting a correction template according to the time order of the correction templates to correct the collected bright field image specifically includes: obtaining a correction template that is closest to the bright field image in time according to the time order, and correcting the bright field image using the correction template.
[0016] Compared with the existing technology, the beneficial effects of the present invention are: when in an idle state, dark field images are captured at a preset frequency, the first offset correction template and the second offset correction template are alternately performed according to the captured dark field images, and when performing bright field image capture, image correction is performed according to the prepared correction template, thereby realizing automatic update of the offset correction template, simplifying the operation steps, improving the ease of use of the device, and not prolonging the image capture time, thereby improving the image capture efficiency and meeting the user's usage needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flowchart of an embodiment of a method for automatically updating an offset correction template according to the present invention;
[0018] Figure 2 Schematic diagram of an embodiment of dark field image acquisition and bright field image acquisition in the offset correction template automatic update method of the present invention;
[0019] Figure 3 This is a structural diagram of an embodiment of an automatic updating device for an offset correction template according to the present invention;
[0020] Figure 4 This is a flowchart of an embodiment of an offset correction template automatic updating method executed by an offset correction template automatic updating device of the present invention. DETAILED DESCRIPTION
[0021] The following describes the implementation methods of the present application through specific concrete examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the various embodiments of the present disclosure generally described and shown in the drawings herein can be combined with each other without conflict, and the structural components or functional modules therein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents selected embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0022] See also Figure 1 、 Figure 2 ,in, Figure 1 This is a flowchart of an embodiment of a method for automatically updating an offset correction template according to the present invention; Figure 2This is a schematic diagram of an embodiment of dark field image acquisition and bright field image acquisition in the offset correction template automatic update method of the present invention. Figure 1 、 Figure 2 The offset correction template automatic updating method of the present invention is described in detail.
[0023] In this embodiment, the device that executes the offset correction template automatic updating method may be a flat panel detector, an X-ray detector, or other imaging devices that require using a dark field image to correct a bright field image.
[0024] In this embodiment, the offset correction template automatic update method includes:
[0025] S101: Determine whether the current state is idle, if so, execute S102, if not, execute S103.
[0026] The firmware inside the imaging device detects its own status in real time and executes different steps based on the detection results.
[0027] S102: Acquire dark field images at a preset frequency, cyclically generate a first offset correction template and a second offset correction template based on the dark field images, and determine whether the preset conditions are currently met. If so, execute S103; if not, continue to execute S102.
[0028] The steps of capturing dark field images at a preset frequency and cyclically generating a first offset correction template and a second offset correction template based on the dark field images specifically include: capturing dark field images at equal time intervals, superimposing and summing multiple adjacent frames of dark field images to form a first offset correction template, and after generating the first offset correction template, continuing to capture dark field images at equal time intervals, superimposing and summing multiple adjacent frames of dark field images to form a second offset correction template.
[0029] In this embodiment, each dark field image is captured at the same time interval, and eight adjacent dark field images are superimposed and summed to form a first offset correction template or a second offset correction template. After acquiring the first offset correction template and the second offset correction template, the imaging device stores the first offset correction template and the second offset correction template in a memory of the imaging device. The memory may be the imaging device's internal memory, local storage, connected external storage, or cloud storage.
[0030] In other embodiments, the number of frames of the superimposed and summed dark field images may also be 4 frames, 7 frames, 9 frames, or other numbers of frames, and the number of frames of the dark field images used by the first offset correction template and the second offset correction template may also be different, which can be specifically configured and modified according to the actual needs of the user or the usage environment.
[0031] After the step of acquiring dark field images at equal time intervals, the method further includes automatically generating a number for each frame of the dark field image, wherein the number is generated in sequence according to the acquisition time, and selecting images for superposition and summation by sorting the numbers.
[0032] In a specific embodiment, image A is a first offset correction template, and image B is a second offset correction template. The dark field images collected by the firmware at equal intervals are automatically numbered inside the imaging device, and a superposition summation is performed for every 8 frames of images to obtain a pair of images, and the pair of images obtained after the superposition summation is stored in the internal memory. As in the above acquisition and storage operation, 8 frames of images are collected for superposition and summation to obtain a pair of image A, and this image A is stored in the internal memory of the imaging device. As in the above acquisition and storage operation, 8 frames of images are collected again for superposition and summation to obtain a pair of image B, and this pair of image B is stored in the internal memory of the imaging device. The storage operation of images A and B is cyclically cross-operated. As shown above, images A and B are the offset correction templates automatically generated inside the pre-firmware. New images collected subsequently are all subtracted from the offset template to perform correction operations.
[0033] In this embodiment, when storing the first offset correction template and the second offset correction template, the imaging device may replace the first offset correction template and the second offset correction template already stored in the internal memory, or may not replace them and set a corresponding identifier for each first offset correction template and the second offset correction template in the internal memory to distinguish them.
[0034] The step of determining whether the preset condition is currently satisfied specifically includes: determining whether there is an exposure operation currently, receiving an operation instruction, and receiving at least one of a trigger signal from a high-voltage terminal. The high-voltage terminal may be a high-voltage generator.
[0035] In a specific embodiment, the imaging device determines whether an exposure operation occurs by detecting a grayscale value of a captured dark field image and determining whether the grayscale value meets a preset value or a preset detection condition.
[0036] S103: Execute an operation corresponding to a preset condition or a received instruction, and when the corresponding operation is bright field image acquisition, select a correction template according to the time order of the correction templates to correct the acquired bright field image, the correction templates including a first offset correction template and a second offset correction template.
[0037] The step of selecting a correction template according to the time sequence of the correction templates to correct the collected bright field image specifically includes: obtaining a correction template that is closest to the bright field image in time according to the time sequence, and correcting the bright field image using the correction template.
[0038] In one specific embodiment, during the creation of the first and second offset correction templates, the imaging device uses internal firmware to simultaneously monitor and determine the grayscale values of the currently captured image in real time, allowing it to promptly detect whether an exposure operation is currently in progress. If an exposure operation is in progress, or if an operation instruction is received from the software, or if a trigger signal is received from a high voltage source, the overlay process of the current eight frames of images is abandoned. The firmware stops the current acquisition operation, waits for the exposure operation to complete, captures a bright-field image, and uses the previously generated offset correction template overlaid on the currently abandoned eight frames for image correction. This approach enables automatic updating of the offset correction template, eliminating the need for the user to manually update the offset template.
[0039] Beneficial effect: The offset correction template automatic update method of the present invention captures dark field images at a preset frequency when in an idle state, and alternately performs the first offset correction template and the second offset correction template according to the captured dark field images, and performs image correction according to the prepared correction template when executing bright field image capture, thereby realizing automatic update of the offset correction template, simplifying the operation steps, improving the ease of use of the equipment, and not prolonging the image acquisition time, thereby improving the image acquisition efficiency and meeting the user's usage needs.
[0040] Based on the same inventive concept, the present invention also proposes an automatic update device for offset correction template, see Figure 3 、 Figure 4 , Figure 3 This is a structural diagram of an embodiment of an automatic updating device for an offset correction template according to the present invention; Figure 4 This is a flowchart of an embodiment of an offset correction template automatic update method executed by an offset correction template automatic update device of the present invention, combined with Figure 3 、 Figure 4 The offset correction template automatic updating device of the present invention is described.
[0041] In this embodiment, an automatic offset correction template update device includes a processor and a memory, the processor being in communication with the memory. The memory stores program data, and the processor executes an automatic offset correction template update method according to the program data. The automatic offset correction template update device can be a flat panel detector, an X-ray detector, or other imaging device that requires dark-field image correction for bright-field image processing, or an image processing unit or module within the imaging device.
[0042] Among them, the memory may include but is not limited to high-speed random access memory and non-volatile memory. For example, one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0043] The offset correction template automatic update method includes:
[0044] S201: Determine whether the current state is idle, if so, execute S202, if not, execute S203.
[0045] The firmware inside the imaging device detects its own status in real time and executes different steps based on the detection results.
[0046] S202: Acquire dark field images at a preset frequency, cyclically generate a first offset correction template and a second offset correction template based on the dark field images, and determine whether the preset conditions are currently met. If so, execute S203; if not, continue to execute S102.
[0047] The steps of capturing dark field images at a preset frequency and cyclically generating a first offset correction template and a second offset correction template based on the dark field images specifically include: capturing dark field images at equal time intervals, superimposing and summing multiple adjacent frames of dark field images to form a first offset correction template, and after generating the first offset correction template, continuing to capture dark field images at equal time intervals, superimposing and summing multiple adjacent frames of dark field images to form a second offset correction template.
[0048] In this embodiment, each dark field image is captured at the same time interval, and eight adjacent dark field images are superimposed and summed to form a first offset correction template or a second offset correction template. After acquiring the first offset correction template and the second offset correction template, the imaging device stores the first offset correction template and the second offset correction template in a memory of the imaging device. The memory may be the imaging device's internal memory, local storage, connected external storage, or cloud storage.
[0049] In other embodiments, the number of frames of the superimposed and summed dark field images may also be 7 frames, 9 frames, or other numbers of frames, and the number of frames of the dark field images used by the first offset correction template and the second offset correction template may also be different, which can be specifically configured and modified according to the actual needs of the user or the usage environment.
[0050] After the step of acquiring dark field images at equal time intervals, the method further includes automatically generating a number for each frame of the dark field image, wherein the number is generated in sequence according to the acquisition time, and selecting images for superposition and summation by sorting the numbers.
[0051] In a specific embodiment, image A is a first offset correction template, and image B is a second offset correction template. The dark field images collected by the firmware at equal intervals are automatically numbered inside the imaging device, and a superposition summation is performed for every 8 frames of images to obtain a pair of images, and the pair of images obtained after the superposition summation is stored in the internal memory. As in the above acquisition and storage operation, 8 frames of images are collected for superposition and summation to obtain a pair of image A, and this image A is stored in the internal memory of the imaging device. As in the above acquisition and storage operation, 8 frames of images are collected again for superposition and summation to obtain a pair of image B, and this pair of image B is stored in the internal memory of the imaging device. The storage operation of images A and B is cyclically cross-operated. As shown above, images A and B are the offset correction templates automatically generated inside the pre-firmware. New images collected subsequently are all subtracted from the offset template to perform correction operations.
[0052] In this embodiment, when storing the first offset correction template and the second offset correction template, the imaging device may replace the first offset correction template and the second offset correction template already stored in the internal memory, or may not replace them and set a corresponding identifier for each first offset correction template and the second offset correction template in the internal memory to distinguish them.
[0053] The step of determining whether the preset condition is currently satisfied specifically includes: determining whether there is an exposure operation currently, receiving an operation instruction, and receiving at least one of a trigger signal from a high-voltage terminal. The high-voltage terminal may be a high-voltage generator.
[0054] In a specific embodiment, the imaging device determines whether an exposure operation occurs by detecting a grayscale value of a captured dark field image and determining whether the grayscale value meets a preset value or a preset detection condition.
[0055] S203: Execute an operation corresponding to a preset condition or a received instruction, and when the corresponding operation is bright field image acquisition, select a correction template according to the time order of the correction templates to correct the acquired bright field image, the correction templates including a first offset correction template and a second offset correction template.
[0056] The step of selecting a correction template according to the time sequence of the correction templates to correct the collected bright field image specifically includes: obtaining a correction template that is closest to the bright field image in time according to the time sequence, and correcting the bright field image using the correction template.
[0057] In one specific embodiment, during the creation of the first and second offset correction templates, the imaging device uses internal firmware to simultaneously monitor and determine the grayscale values of the currently captured image in real time, allowing it to promptly detect whether an exposure operation is currently in progress. If an exposure operation is in progress, or if an operation instruction is received from the software, or if a trigger signal is received from a high voltage source, the overlay process of the current eight frames of images is abandoned. The firmware stops the current acquisition operation, waits for the exposure operation to complete, captures a bright-field image, and uses the previously generated offset correction template overlaid on the currently abandoned eight frames for image correction. This approach enables automatic updating of the offset correction template, eliminating the need for the user to manually update the offset template.
[0058] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0059] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for automatically updating an offset correction template, characterized in that: The offset correction template automatic updating method includes: S101: Determine whether the imaging device is currently in an idle state. If so, execute S102; if not, execute S103; S102: Acquire a dark field image at a preset frequency, cyclically generate a first offset correction template and a second offset correction template based on the dark field image, and determine whether the dark field image currently meets a preset condition. If so, execute S103; if not, continue to execute S102; the preset condition is whether there is currently an exposure operation and whether a trigger signal from the high voltage terminal is received; S103: performing a corresponding operation according to the preset condition, and when the corresponding operation is bright field image acquisition, selecting a correction template according to the time order of the correction templates to correct the acquired bright field image, the correction templates including a first offset correction template and a second offset correction template; The step of selecting a correction template according to the time order of the correction templates to correct the collected bright field image specifically includes: obtaining a correction template that is closest to the bright field image in time according to the time order, and correcting the bright field image using the correction template.
2. The offset correction template automatic updating method according to claim 1, characterized in that: The step of acquiring dark field images at a preset frequency and cyclically generating a first offset correction template and a second offset correction template based on the dark field images specifically includes: Dark field images are collected at equal time intervals, and adjacent multiple frames of dark field images are superimposed and summed to form a first offset correction template. After making the first offset correction template, dark field images are continued to be collected at equal time intervals, and adjacent multiple frames of dark field images are superimposed and summed to form a second offset correction template.
3. The method for automatically updating an offset correction template according to claim 2, wherein: After the step of collecting dark field images at equal time intervals, the following step is further included: Automatically generate a number for each dark field image frame.
4. An automatic update device for offset correction template, characterized in that: The offset correction template automatic updating device includes a processor and a memory, wherein the processor is in communication with the memory, the memory stores program data, and the processor executes an offset correction template automatic updating method according to the program data. The offset correction template automatic updating method includes: S201: Determine whether the imaging device is currently in an idle state. If so, execute S202; if not, execute S203; S202: Acquire a dark field image at a preset frequency, cyclically generate a first offset correction template and a second offset correction template based on the dark field image, and determine whether the dark field image currently meets a preset condition. If so, execute S203; if not, continue to execute S202; the preset condition is whether an exposure operation is currently in progress and whether a trigger signal from the high voltage terminal is received; S203: performing a corresponding operation according to the preset condition, and when the corresponding operation is bright field image acquisition, selecting a correction template according to the time order of the correction templates to correct the acquired bright field image, the correction templates including a first offset correction template and a second offset correction template; The step of selecting a correction template according to the time order of the correction templates to correct the collected bright field image specifically includes: obtaining a correction template that is closest to the bright field image in time according to the time order, and correcting the bright field image using the correction template.
5. The automatic updating device for offset correction template according to claim 4, characterized in that: The step of acquiring dark field images at a preset frequency and cyclically generating a first offset correction template and a second offset correction template based on the dark field images specifically includes: Dark field images are collected at equal time intervals, and adjacent multiple frames of dark field images are superimposed and summed to form a first offset correction template. After making the first offset correction template, dark field images are continued to be collected at equal time intervals, and adjacent multiple frames of dark field images are superimposed and summed to form a second offset correction template.
6. The offset correction template automatic updating device according to claim 5, characterized in that: After the step of collecting dark field images at equal time intervals, the following step is further included: Automatically generate a number for each dark field image frame.
Citation Information
Patent Citations
An image dark field correction method and system
CN109671033A
Darkfield modeling
US20190180069A1