Correction Method and Correction Device for Correcting Instantaneous Images through Color Jitter Processing
By adding noise values generated by random numbers to the pixel points in the image, and using color shaking processing technology to correct the instant image, the quantization error problem caused by the image after high and low precision conversion is solved, and the visual smoothing effect of the image is achieved.
Patent Information
- Application Number
- CN202111169848.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-08
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-10-08
AI Technical Summary
The image will produce quantization errors after high and low precision conversion, resulting in visual sensations of faults and incongruence.
By adding noise values generated by random numbers to the pixel points in the image, the real-time image is corrected using color shaking processing technology. The specific implementation includes using a processor to shift the noise values in the miscellaneous list, and obtaining the noise values from the adjusted miscellaneous list based on the coordinate position of the pixel point, and adding it to the lowest bit of the pixel point to generate a corrected image.
It effectively solves the quantization error caused by the image after high and low precision conversion, avoids the problem of adding the same noise value to the same pixel points in multiple adjacent images in time, reduces the correction effect of the color shaking process, and makes continuous images visually smooth in the human eye.
Smart Images

Figure CN115988333B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image correction, and in particular to a correction method and a correction device for correcting instant images through color dithering processing. Background Art
[0002] Generally speaking, when images are converted between high and low precision, quantization errors will occur. For users, the converted images will have visual discontinuities and look inconsistent.
[0003] For example, if the color depth of the original image is 6 bits (bits), and the display used to output the image is 8 bits, then in order to meet the specifications of the display, the original image is upgraded from 6 bits to 8 bits. Similarly, if the color depth of the original image is 10 bits, but the display used to output the image is 8 bits, then the original image must be downgraded from 10 bits to 8 bits. After the precision conversion, the image will produce the aforementioned quantization error.
[0004] See also Figure 1 , is a schematic diagram of the band effect. Figure 1 As shown, when the original image 1 is processed to increase or decrease the number of bits and then generate the converted image 2, when the user views the converted image 2 with the naked eye, he will visually feel the fault 21 caused by the banding effect, and the fault 21 is caused by the quantization error. In order to make the upscaled / downscaled image look smooth, the upscaled / downscaled image must be further processed. Summary of the invention
[0005] The main purpose of the present invention is to provide a correction method and correction device for real-time images through dithering processing, which can solve the quantization error generated by high-precision and low-precision conversion of images by adding noise values generated by random numbers to several pixel points in the image.
[0006] In order to achieve the above-mentioned purpose, the calibration device of the present invention comprises:
[0007] A receiving unit connected to an image sensor, receiving a real-time image generated by the image sensor, and recording a time parameter of the real-time image;
[0008] A storage unit storing a hash table (hash table) recording a plurality of noise values used to calibrate a plurality of pixel points in the real-time image;
[0009] A processor, connected to the receiving unit and the storage device, comprising:
[0010] A displacement module that displaces the plurality of noise values in the noise sequence table according to the time parameter to generate an adjusted noise sequence table; and
[0011] A calculation module that respectively obtains the corresponding noise values from the corresponding positions of the adjusted noise sequence table according to the coordinate positions of the respective pixel points in the live image, and respectively adds the corresponding noise values to the least significant bit of each of the pixel points to generate a corrected image; and
[0012] An output unit connected to the processor to output the corrected image.
[0013] As described above, wherein the time parameter is a frame count of the live image, or a time count or a clock of the image sensor.
[0014] As described above, wherein the noise sequence table is a table composed of a plurality of rows and a plurality of columns, the plurality of noise values are respectively recorded in each field of the table, the calculation module calculates a first modulus of the x-axis coordinate of each pixel point and the total number of columns of the adjusted noise sequence table, and a second modulus of the y-axis coordinate of each pixel point and the total number of rows of the adjusted noise sequence table, and takes out the corresponding noise value from the corresponding position in the adjusted noise sequence table according to the first modulus and the second modulus.
[0015] As described above, wherein the displacement module performs a horizontal displacement or a vertical displacement on the plurality of noise values in the noise sequence table, and the displacement amounts of the horizontal displacement and the vertical displacement are positively correlated with the time parameter.
[0016] As described above, wherein the calculation module performs an upscaling process or a downscaling process on the live image to increase or decrease the number of bits of the live image, and adds the obtained noise value to the least significant bit of each pixel point in the live image to generate the corrected image.
[0017] To achieve the above object, the correction method of the present invention includes the following steps:
[0018] a) Obtain a live image through an image sensor and record a time parameter of the live image;
[0019] b) Read a noise sequence table, wherein the noise sequence table records a plurality of noise values for correcting a plurality of pixel points in the live image;
[0020] c) Displace the plurality of noise values in the noise sequence table according to the time parameter to generate an adjusted noise sequence table;
[0021] d) Respectively obtain the corresponding noise values from the corresponding positions of the adjusted noise sequence table according to the coordinate positions of the respective pixel points in the live image;
[0022] e) Add the corresponding noise value to the least significant bit of each of the pixel points to generate a corrected image; and
[0023] f) Output the corrected image.
[0024] As described above, wherein the time parameter is a frame count of the real-time image, or a time count or a clock of the image sensor.
[0025] As described above, wherein the noise sequence table is a table composed of a plurality of rows and a plurality of columns, and the plurality of noise values are respectively recorded in each field of the table. The step d) includes:
[0026] d1) Obtain the coordinate position of each of the pixel points in the real-time image, wherein the coordinate position includes an x-axis coordinate and a y-axis coordinate;
[0027] d2) Calculate a first modulus of the x-axis coordinate and a total number of columns of the adjusted noise sequence table;
[0028] d3) Calculate a second modulus of the y-axis coordinate and a total number of rows of the adjusted noise sequence table; and
[0029] d4) Extract the corresponding noise value from the corresponding position in the adjusted noise sequence table according to the first modulus and the second modulus.
[0030] As described above, wherein the step c) performs a horizontal displacement or a vertical displacement on the plurality of noise values in the noise sequence table according to the time parameter, and a displacement amount of the horizontal displacement and the vertical displacement is positively correlated with the time parameter.
[0031] As described above, before the step e), it further includes: e0) Perform an upscaling process or a downscaling process on the real-time image to increase or decrease the number of bits of the real-time image;
[0032] Wherein, the step e) adds the obtained noise value to the least significant bit of each of the pixel points in the real-time image to generate the corrected image.
[0033] In the present invention, after adjusting the noise sequence table according to the time parameter of the image, the corresponding noise value is obtained from the adjusted noise sequence table to correct each pixel point in the image. Thereby, adding the same noise value to the same pixel points in multiple adjacent images in time can be avoided, and the correction effect of the dithering process is reduced. In this way, consecutive images can be made smooth in the human eye vision. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a schematic diagram of the banding effect;
[0035] Figure 2The first specific embodiment of the block diagram of the calibration device of the present invention;
[0036] Figure 3 The first specific embodiment of the flowchart of the calibration method of the present invention;
[0037] Figure 4 The first specific embodiment of the adjustment schematic diagram of the miscellaneous sequence table of the present invention;
[0038] Figure 5 The first specific embodiment of the image calibration flowchart of the present invention.
[0039] Among them, reference numerals:
[0040] 1... Original image;
[0041] 2... Transformed image;
[0042] 21... Tomography;
[0043] 3... Calibration device;
[0044] 31... Processor;
[0045] 311... Displacement module;
[0046] 312... Calculation module;
[0047] 32... Receiving unit;
[0048] 33... Storage unit;
[0049] 331... Miscellaneous sequence table;
[0050] 332, 333... Adjusted miscellaneous sequence tables;
[0051] 34... Output unit;
[0052] 35... Input unit;
[0053] 4... Image sensor;
[0054] 5... Noise value;
[0055] S10~S20, S160~S172... Calibration steps. Detailed implementation manners
[0056] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the embodiments cited do not limit the present invention.
[0057] Refer to Figure 2, which is the first specific embodiment of the block diagram of the calibration device of the present invention. The present invention discloses a calibration device (hereinafter simply referred to as calibration device 3 in the specification) for calibrating an instant image through dithering. The calibration device 3 can, in an operating environment where high-precision and low-precision conversions of an image are required, first calibrate the converted image through dithering and then output the calibrated image. The dithering process refers to adding random noise values to each pixel point in the image to eliminate the quantization error generated after the high-precision and low-precision conversion of the image, making the output continuous image look smoother.
[0058] As Figure 2 shown, the calibration device of the present invention mainly includes a processor 31, a receiving unit 32, a storage unit 33, and an output unit 34. Among them, the processor 31 is electrically connected to the receiving unit 32, the storage unit 33, and the output unit 34 to integrate and control these units 32 - 34.
[0059] In one embodiment, the processor 31 can be implemented by a micro control unit (MCU), a central processing unit (CPU), a field programmable gate array (FPGA), or an application specific integrated circuit (ASIC). The processor 31 records computer-readable program codes. After the processor 31 executes the computer-readable program codes, various functions required for the calibration device 3 of the present invention can be realized.
[0060] Based on the functions that the processor 31 can achieve, several functional modules are virtually generated inside the processor 31 for the calibration device 3, mainly including a displacement module 311 and a calculation module 312 (to be described in detail later). In this embodiment, the displacement module 311 and the calculation module 312 are software modules implemented by the processor 31 through executing computer-readable program codes, but are not limited thereto.
[0061] In one embodiment, the receiving unit 32 may be a port, such as a Universal Serial Bus (USB) port, a Serial Peripheral Interface (SPI) port, a Low-Voltage Differential Signaling (LVDS) port, a Mobile Industry Processor Interface (MIPI) port, etc., but not limited thereto. The calibration device 3 is connected to an external image sensor 4 through the receiving unit 32 to receive and process the real-time image sensed and generated by the image sensor 4. More specifically, after the image sensor 4 is activated, it continuously senses the external environment and continuously generates a number of images. After the calibration device 3 is activated, it can continuously receive the continuous images generated by the image sensor 4 through the receiving unit 32.
[0062] The calibration device 3 of the present invention corrects the image through dithering processing, and the dithering processing mainly adds random noise values to each pixel point in the image to make the continuous image smoother. To achieve the above purpose, the calibration device 3 adjusts the noise value to be added according to the time parameter of the real-time image to be calibrated currently, thereby avoiding adding the same noise value to the same pixel point in the previous and subsequent images, and reducing the calibration effect of the dithering processing. Therefore, when the receiving unit 32 receives the real-time image, it simultaneously records the time parameter of the real-time image.
[0063] In one embodiment, the time parameter is the frame count of the currently received real-time image. Since the receiving unit 32 only receives one frame of image at a time, the time parameters corresponding to different frames of images must be different. In another embodiment, the time parameter is the time count (timer) or clock of the image sensor 4 when generating the real-time image, but not limited thereto.
[0064] The image sensor 4 may be, for example, a camera, an infrared sensor, a laser sensor, etc., for instantaneously sensing an external image and importing it into the calibration device 3 for analysis, calibration, and output. In one embodiment, the image sensor 4 may be, for example, a medical endoscope for sensing a human body image, but not limited thereto.
[0065] The storage unit 33 can be, for example, a hard-drive disk (HDD), a solid-state disk (SSD), a flash memory, a read-only memory (ROM), a random access memory (RAM), a non-volatile memory, etc., but not limited thereto. A hash table 331 is pre-stored in the storage unit 33, and the hash table 331 records a plurality of noise values used to correct several pixel points in the image respectively.
[0066] In one embodiment, the user can pre-generate a plurality of noise values and the arrangement order of the plurality of noise values via an algorithm based on the required specifications, and generate the hash table 331 based on the plurality of noise values and the corresponding arrangement order. Specifically, the hash table 331 is a table composed of a plurality of rows and a plurality of columns, and each noise value is respectively recorded in the corresponding field in the hash table 331 according to the corresponding arrangement order (for example Figure 4 as shown).
[0067] In the present invention, the correction device 3 corrects the live image through the processor 31 to generate a corrected image, and then outputs the corrected image through the output unit 34. In one embodiment, the output unit 34 can be an image output port, such as a high definition multimedia interface (HDMI) output port, a serial digital interface (SDI) output port, etc., and the correction device 3 is connected to an external display through the output unit 34 to display the corrected image. In another embodiment, the output unit 34 can be a display configured on the correction device 3 for directly displaying the corrected image. The above are only partial specific implementation examples of the present invention, but not limited thereto.
[0068] The display can be, for example, a medical display for displaying the live image sensed and generated by the image sensor 4 (such as a medical endoscope).
[0069] If the color depth of the image generated by the image sensor 4 (such as six bits) is less than the color depth adopted by the display (such as eight bits), the correction device 3 needs to perform a gradation processing on the image before output, and after the gradation processing, noise values will be added to the lower bits of the gradated image to eliminate the quantization error generated due to the gradation processing.
[0070] For example, if the pixel value of a pixel in an image is 20 (represented in six-bit binary as 010100), after the image is upscaled to eight bits through upscaling processing, the number of bits of this pixel will increase by two bits, and the pixel value will become 80 (i.e., 01010000). In the present invention, after the upscaling processing, the correction device 3 will extract the corresponding noise values from the noise table 331, such as 0, 1, 2, and 3 (represented in two-bit binary as 00, 01, 10, 11), and add them to the lower bits of this pixel, so that the pixel value becomes one of 80 (i.e., 01010000), 81 (01010001), 82 (01010010), and 83 (01010011).
[0071] If the color depth of the image generated by the image sensor 4 (for example, ten bits) is greater than the color depth adopted by the display (for example, eight bits), then the correction device 3 needs to perform downscaling processing on the image before output, and after the downscaling processing, noise values will also be added to the lower bits of the downscaled image to eliminate the quantization error generated due to the downscaling processing.
[0072] For example, if the pixel value of a pixel in an image is 320 (represented in ten-bit binary as 0101000000), after the image is downscaled to eight bits through downscaling processing, the number of bits of this pixel will decrease by two bits, and the pixel value will become 80 (i.e., 01010000). In the present invention, after the downscaling processing, the correction device 3 will extract the corresponding noise values from the noise table 331, such as 0, 1, 2, 3 (represented in two-bit binary as 00, 01, 10, and 11), and add them to the lower bits of this pixel, so that the pixel value becomes one of 80 (i.e., 01010000), 81 (01010001), 82 (01010010), and 83 (01010011).
[0073] As described above, by adding different noise values to the same pixel in different images, when playing consecutive images, the visual persistence effect of the human eye can be utilized to achieve the effect of repeatedly flickering the image (for example, the same pixel will continuously switch between pixel values 80, 81, 82, 83), thereby making the output image reach a higher resolution. And the above is only a specific implementation example of the present invention, but not limited thereto.
[0074] As described above, the present invention adopts the method of spatial dithering to achieve the visual persistence effect. Therefore, the correction device 3 needs to ensure that different noise values are used to correct the same pixel in multiple images adjacent in time.
[0075] As described above, the processor 31 can execute computer-readable program codes to form a virtual displacement module 311 and a calculation module 312. The displacement module 311 can mainly obtain the time parameters of the current real-time image from the receiving unit 32, and obtain the pre-stored miscellaneous sequence table 331 from the storage unit 33. Moreover, the displacement module 311 displaces several noise values in the miscellaneous sequence table 331 according to the time parameters to generate an adjusted miscellaneous sequence table. In the present invention, the arrangement order of several noise values in the adjusted miscellaneous sequence table is positively correlated with the time parameters of the real-time image, and the processor 31 corrects (i.e., performs dithering processing) the real-time image according to the adjusted miscellaneous sequence table.
[0076] The calculation module 312 obtains the coordinate positions of each pixel point in the real-time image in the real-time image, and respectively obtains the corresponding noise values from the corresponding positions in the adjusted miscellaneous sequence table according to these coordinate positions. Then, the calculation module 312 adds the obtained noise values to the least significant bit part of each pixel point respectively to generate several corrected pixel points, and generates a corrected image according to the several corrected pixel points. Finally, the processor 31 transmits the corrected image to the output unit 34 for output through the output unit 34.
[0077] In the present invention, the number of bits of the corrected image is different from that of the real-time image and conforms to the specifications of the display (or the output unit 34). Although the corrected image has been subjected to upscaling / downscaling processing, because each image has been subjected to dithering processing, it will look smoother to the human eye.
[0078] Please also refer to Figure 2 and Figure 3 , where Figure 3 is the first specific embodiment of the flowchart of the correction method of the present invention. The present invention further discloses a correction method for correcting a real-time image through dithering processing (hereinafter simply referred to as the correction method in the specification). The correction method is mainly applied to a correction device 3 as shown in Figure 2 . The correction device 3 can execute the correction method to implement dithering processing, thereby correcting the real-time image.
[0079] As shown in Figure 3 , first, the correction device 3 obtains a real-time image through the connected image sensor 4 and records the time parameters of the real-time image (step S10). Moreover, the processor 31 reads the miscellaneous sequence table 331 from the storage unit 33 and displaces several noise values in the miscellaneous sequence table 331 according to the time parameters to generate an adjusted miscellaneous sequence table (step S12). The miscellaneous sequence table 331 is a table composed of several rows and several columns, and several noise values are respectively recorded in each field of the table.
[0080] In one embodiment, the time parameter is the frame count of an instant image. In step S10, the correction device 3 determines, through the receiving unit 32 or the processor 31, which frame of the continuous images the currently received instant image is. In step S12, the processor 31 horizontally displaces, vertically displaces, or simultaneously horizontally and vertically displaces several noise values in the noise table 331 according to the frame count of the instant image (such as the first frame, the second frame, the third frame, etc.).
[0081] By moving the recording positions of several noise values in the noise table 331, it is possible to avoid using the same noise value to correct the same pixel point in multiple temporally adjacent images. Or, even if the same pixel point in multiple images is corrected using the same noise value, the number of times of using the same noise value does not exceed a threshold value, so that the corrected image is still within the acceptable range of the user's naked eye.
[0082] In another embodiment, the time parameter is the time count or clock of the image sensor 4. In step S10, the correction device 3 detects the current time count or clock of the image sensor 4 through the receiving unit 32 or the processor 31. In step S12, the processor 31 horizontally displaces, vertically displaces, or simultaneously horizontally and vertically displaces several noise values in the noise table 331 according to the time count or clock.
[0083] After step S12, the processor 31 respectively obtains the coordinate positions of each pixel point in the instant image in the instant image, and obtains the corresponding noise value at the corresponding position in the adjusted noise table according to each coordinate position (step S14). After the execution of step S14, the processor 31 can correspond each pixel point in the instant image to a noise value. And, the processor 31 respectively adds the corresponding noise value to the least significant bit of each pixel point in the instant image, thereby generating a corrected image (step S16). In one embodiment, the pixel values of each pixel point are represented in binary. In step S16, the processor 31 first converts the noise value into a binary value and then adds it to the least significant bit of the pixel point.
[0084] It is worth mentioning that the dithering process is to solve the quantization error generated after the image is converted between high and low precisions. Therefore, the correction device 3 and the correction method of the present invention are only executed in the usage environment where the instant image needs to be upscaled or downscaled, and the processed image has a fault 21 as shown in Figure 1 and needs to be corrected.
[0085] In the present invention, the calibration device 3 mainly determines whether to perform upscaling processing (i.e., increasing the number of bits of the live image) or downscaling processing (i.e., reducing the number of bits of the live image) based on the difference between the color depth of the live image and the color depth of the output display. If upscaling processing or downscaling processing is required for the live image, the calibration device 3 can perform upscaling processing or downscaling processing on the live image at any time point after step S10 and before step S16 to obtain a processed image. Specifically, the calibration device 3 can perform upscaling processing on the live image through the calculation module 312 in the processor 31 to increase the number of bits of each pixel point in the live image. Alternatively, the calibration device 3 can perform downscaling processing through the calculation module 312 to reduce the number of bits of each pixel point in the live image.
[0086] It is worth mentioning that in the upscaling processing, the processor 31 adds the set number of bits at the lowest bit of each pixel point. In the downscaling processing, the processor 31 deletes the set number of bits from the lowest bit of each pixel point. In step S16, the processor 31 adds the corresponding noise value to the lowest bit of each pixel point in the processed image, thereby generating a calibrated image.
[0087] After step S16, the calibration device 3 outputs the calibrated image through the output unit 34 (step S18), wherein the color depth of the calibrated image conforms to the specifications of the display (or output unit 34) used to output the image.
[0088] After step S18, the processor 31 determines whether to perform dithering processing on the next image (step S20), that is, the processor 31 determines whether the calibration device 3 is turned off or whether the image sensor 4 stops transmitting images. If the determination in step S20 is no, the processor 31 executes steps S10 to S18 again to perform dithering processing on the next image. Thereby, the consecutive images output by the calibration device 3 will look smoother.
[0089] Please also refer to Figure 2 、 Figure 3 and Figure 4 wherein Figure 4 is the first specific embodiment of the adjustment schematic diagram of the miscellaneous sequence table of the present invention. As Figure 4 shown, the miscellaneous sequence table 331 is a table composed of several rows and several columns, and several noise values 5 are stored in the table. Since different images have different time parameters, the content of the miscellaneous sequence table 331 used by the processor 31 to calibrate the live images obtained at different time points is also different.
[0090] As Figure 4As shown, if the time parameter of the first instant image (e.g., the first frame in a continuous image, or corresponding to 0.01 ms of the image sensor 4) is 1, the processor 31 does not adjust the dither table 331, but can directly correct the first instant image according to the content of the pre-stored dither table 331.
[0091] If the time parameter of the second instant image (e.g., the second frame in a continuous image, or corresponding to 0.02 ms of the image sensor 4) is 2, the processor 31 performs a horizontal shift and / or a vertical shift on several noise values 5 in the dither table 331 to generate an adjusted dither table 332. And, the processor 31 corrects the second instant image based on the content of the adjusted dither table 332. In this embodiment, the processor 31 performs a one-unit horizontal shift on all the noise values 5 in the dither table 331 ( Figure 4 taking a right shift as an example in the figure), and then performs a one-unit vertical shift on all the noise values 5 in the first column ( Figure 4 taking an upward shift as an example in the figure) to generate the adjusted dither table 332.
[0092] If the time parameter of the third instant image (e.g., the third frame in a continuous image, or corresponding to 0.03 ms of the image sensor 4) is 3, the processor 31 performs a horizontal shift and / or a vertical shift on several noise values 5 in the adjusted dither table 332 to generate an adjusted dither table 333. And, the processor 31 corrects the third instant image based on the content of the adjusted dither table 333. In this embodiment, the processor 31 performs a one-unit horizontal shift on all the noise values 5 in the adjusted dither table 332, and then performs a one-unit vertical shift on all the noise values 5 in the first column to generate the adjusted dither table 333.
[0093] In Figure 4 the embodiment shown, the numerical values, arrangement order, and displacement method of each noise value 5 are only for illustration and do not have a limiting intention, and should not be used to limit the scope of the claims of the present invention.
[0094] The numerical values and arrangement order of several noise values 5 in the dither table 331 can be preset in advance, so that when the processor 31 performs dithering processing, different noise values 5 can be used to separately correct multiple adjacent pixel points (adjacent left and right or adjacent up and down) in the image in terms of position. Thereby, after correction, multiple adjacent pixel points in the image will have slight differences from each other. When the user views the corrected image with the naked eye, there will be no sense of discontinuity, and the main purpose of dithering processing can be achieved.
[0095] More specifically, the noise values 5 in the hash table 331 may be generated by a random number generator. When using the random number generator, the user may set the random number generator so that the generated random numbers (i.e., the noise values 5) have a preset characteristic. For example, two adjacent noise values 5 are different from each other, or the number of noise values 5 with the same value among multiple adjacent noise values 5 does not exceed a threshold value.
[0096] The following example uses the addition of two-bit noise values to perform dithering.
[0097] The hash table 331 can be set to record the noise values 5 of 2, 0, 1, 3 in the first row (taking two-bit binary as an example, representing 10, 00, 01, 11). When the image sensor 4 performs horizontal scanning and inputs the first valid horizontal row of the real-time image, the processor 31 can use the noise values 5 of 2, 0, 1, 3, 2, 0, 1, 3, 2, 0, 1, 3, ... to calibrate each pixel in the first valid horizontal row in sequence based on the first row of the hash table 331. For another example, the content of the second row in the hash table 331 can be 0, 1, 3, 2 (taking two-bit binary as an example, representing 00, 01, 11, 10). When the image sensor 4 inputs the second valid horizontal line of the real-time image, the processor 31 can use the noise value 5 of 0, 1, 3, 2, 0, 1, 3, 2, 0, 1, 3, 2, ... to calibrate each pixel in the second valid horizontal line in sequence based on the second line of the hash table 331.
[0098] In addition, when the image sensor 4 performs vertical scanning of the image, the processor 31 of the correction device 3 can also adopt a logic similar to the above to retrieve the corresponding noise value 5 from the noise table 331 to correct each pixel in the image in sequence, and make the corrected image have the technical effect of the present invention as described above.
[0099] The above is only a specific implementation example of the present invention, but the present invention is not limited thereto.
[0100] Due to the limited capacity of the storage unit 31 of the calibration device 3, the number of noise values 5 in the hash table 331 may be less than the number of pixels in the real-time image. In one embodiment, the calibration device 3 determines which noise value 5 of the hash table 331, the adjusted hash table 332, or the adjusted hash table 333 to use based on the position of each pixel in the real-time image.
[0101] Please also see Figure 2 , Figure 3 and Figure 5 ,in Figure 5 This is the first specific embodiment of the image correction flow chart of the present invention. Figure 5 To illustrate theFigure 3 In step S16 of , how does the calibration device 3 obtain the corresponding noise value 5 to calibrate each pixel point in the live image respectively?
[0102] As Figure 5 shown, first, the processor 31 reads one pixel point from the currently received live image through the calculation module 312, and obtains the coordinate position of this pixel point in the live image (step S160). Among them, the coordinate position includes the X-axis coordinate and the Y-axis coordinate of this pixel point in the coordinate system adopted by the live image. In an embodiment, the coordinate position represents the position of this pixel point in the live image. For example, if the coordinate position of the first pixel point is (5, 5), it means that the first pixel point is located at the position of the 5th row and the 5th column in the live image. If the coordinate position of the second pixel point is (101, 100), it means that the second pixel point is located at the position of the 101st row and the 100th column in the live image, and so on.
[0103] Next, the calculation module 312 calculates the first modulus (mod) of the X-axis coordinate of this pixel point and the total number of columns of the adjusted noise table (step S162), and calculates the second modulus of the Y-axis coordinate and the total number of rows of the adjusted noise table (step S164). Finally, the calculation module 312 extracts the corresponding noise value from the corresponding position in the adjusted noise table according to the first modulus and the second modulus (step S166), and adds the noise value to the least significant bit of this pixel point (step S168).
[0104] As Figure 4 shown, the noise table 331 in the present invention is a table composed of several rows and several columns. Compared with the noise table 331, the adjusted noise tables 332 and 333 are only the position transformation of several noise values 5 in the table fields, but the size of the adjusted noise tables 332 and 333 is the same as the size of the noise table 331, that is, the total number of columns and the total number of rows are the same.
[0105] Taking the third frame image of the currently processed live image as an example, the processor 31 can obtain the adjusted noise table 333 through the calculation module 312. Next, the calculation module 312 obtains the coordinate position of one pixel point in the live image. For the convenience of description, the pixel point with the coordinate position of (101, 100) is taken as an example below. First, the calculation module 312 calculates the first modulus of the X-axis coordinate (that is, 101) and the total number of columns of the adjusted noise table 333 (that is, 6), that is, 101 mod 6 = 5. And, the calculation module 312 calculates the second modulus of the Y-axis coordinate (that is, 100) and the total number of rows of the adjusted noise table 333 (that is, 4), that is, 100 mod 4 = 0.
[0106] It is worth mentioning that since the miscellaneous sequence table 331 has the same size as the adjusted miscellaneous sequence tables 332 and 333, the calculation module 312 can perform modulo calculation based on the total number of columns and rows of any one of the miscellaneous sequence tables 331, 332, and 333. Moreover, the processor 31 can generate the adjusted miscellaneous sequence tables 332 and 333 first and then perform modulo calculation, or perform modulo calculation first and then generate the adjusted miscellaneous sequence tables 332 and 333, without limitation.
[0107] Accordingly, based on the first modulus and the second modulus, the calculation module 312 obtains the noise value 5 at the position (5, 0) in the adjusted miscellaneous sequence table 333 (in the Figure 4 embodiment of, it is 2, and in binary representation it is 10). In Figure 5 step S168, the calculation module 312 can add the two-bit noise value "10" to the least significant bit of this pixel point to complete the correction of this pixel point. If the value of the noise value 5 is greater than 3, since it exceeds the range that can be represented by two bits, the calculation module 312 needs to represent it with more bits and add it to the least significant bit of the pixel point.
[0108] Conversely, if the value of the noise value 5 exceeds the range that can be represented by two bits, but the quantization error of the real-time image to be corrected is not serious, the calculation module 312 can also only take the last two bits of this noise value 5 to correct this pixel point. For example, if the determined noise value 5 is 6 (in binary representation it is 110), the calculation module 312 can only take the last two bits (i.e., 10, in decimal representation it is 2) to correct this pixel point. And the above is only part of the specific implementation examples of the present invention, but not limited thereto.
[0109] In one embodiment, the noise value 5 can be recorded in the miscellaneous sequence table 331 in binary form. In another embodiment, the noise value 5 can be recorded in the miscellaneous sequence table 331 in decimal form. If the noise value 5 is recorded in the miscellaneous sequence table 331 in decimal form, then in the above step S168, the calculation module 312 first converts the noise value obtained in step S166 into binary and then adds the converted noise value to the least significant bit of the pixel point.
[0110] After step S168, the processor 31 determines whether all pixel points in the real-time image have been corrected (step S170). If not, the processor 31 executes steps S160 to S168 again to correct other pixel points in the real-time image. Moreover, after all pixel points in the real-time image have been corrected, the processor 31 can generate a corrected image based on all the corrected pixel points (step S172).
[0111] It is worth mentioning that the present invention only needs to be executed asFigure 3 The calibration process shown can reduce the overall resource consumption of an image processing system (not shown in the figure). For example, the present invention can perform the calibration process when the image has been converted with high and low precision and serious quantization errors occur. For another example, the present invention can perform the calibration process when the original image itself has serious hierarchical differences (such as the occurrence of Figure 1 the fault 21 shown).
[0112] In one embodiment, the calibration device 3 of the present invention further has an input unit (such as Figure 2 the input unit 35 shown) connected to the processor 31. The input unit 35 can be a human machine interface (HMI), such as a button, a touch panel, etc., but is not limited thereto.
[0113] In this embodiment, the user can continuously view the live image generated and output by the image sensor 4 on the display connected to the calibration device 3. When the user believes that there is a problem with the live image, such as seeing the Figure 1 fault 21 shown, the input unit 35 can be manually triggered. In this embodiment, after the input unit 35 is triggered, the calibration device 3 controls the processor 31 to execute Figure 3 and Figure 5 the steps shown to perform dithering processing on the live image, thereby eliminating various phenomena generated by the image due to quantization errors.
[0114] In another embodiment, when receiving and outputting the live image generated by the image sensor 4, the calibration device 3 continuously analyzes the content of the live image through the processor 31 and automatically determines whether dithering processing needs to be performed on the image.
[0115] Specifically, the processor 31 can sample each image in a series of images separately and calculate the standard deviation of the pixel values of multiple pixel points within multiple specific ranges in the same image. For example, taking a range composed of 3x3, a total of nine pixel points as an example, the processor 31 calculates the standard deviation of the pixel values of these nine pixel points. In this embodiment, the processor 31 can sample multiple different specific ranges in the same image. When the number of specific ranges with too small a standard deviation in an image exceeds a preset number, the processor 31 can determine that dithering correction needs to be performed on subsequent images.
[0116] As described above, when the calculation result of the standard deviation meets the activation condition (for example, the number of specific ranges with too small a standard deviation exceeds the preset number), the processor 31 can determine that the quantization error of the image is serious and automatically execute Figure 3 and Figure 5The steps shown are used to perform color dithering on the real-time image. For example, the processor 31 can determine that the start condition is met when the standard deviation of ten specific ranges among the twenty sampled specific ranges is less than a preset threshold value.
[0117] It is worth mentioning that performing the dithering process only when a single image meets the above-mentioned activation condition may result in inaccurate analysis. Therefore, in other embodiments, the processor 31 may also start performing the dithering process on the real-time image when the calculation results of the standard deviation of multiple consecutive images all meet the activation condition.
[0118] The above description is only an example of the specific implementation of the present invention. The preset threshold value will be different as the image content sensed by the image sensor 4 is different. For example, if the colors of multiple parts of the object sensed by the image sensor 4 are very similar (such as a whole piece of copper foil), the pixel values of multiple pixels in the real-time image will be very close. In this case, the preset threshold value must be lowered to avoid misjudgment.
[0119] For example, the standard deviation of a general image within the specific range may be 100, and when a quantization error occurs, it may be reduced to 80, so the preset threshold value may be set to 85. For example, for copper foil, the standard deviation of its image within the specific range may be only 60, and when a quantization error occurs, it may be reduced to 50. In this case, the preset threshold value needs to be lowered (for example, from 85 to 55) to avoid misjudgment.
[0120] The calibration device 3 and calibration method of the present invention adjust the contents of the hash table through the time parameters of the real-time image, and can more effectively generate and use random noise values to perform color dithering on the real-time image. In this way, it is not necessary to spend a lot of hardware resources to perform real-time noise calculation, so it is easier to implement on simple, low-cost hardware.
[0121] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A correction device for correcting an instant image through dithering processing, characterized in that, it includes: a receiving unit, connected to an image sensor, receiving an instant image generated by the image sensor, and recording a time parameter of the instant image; a storage unit, storing a miscellaneous sequence table, and the miscellaneous sequence table records a number of noise values used for correcting a number of pixel points in the instant image; a processor, connected to the receiving unit and the storage unit, including: a displacement module, displacing the number of noise values in the miscellaneous sequence table according to the time parameter to generate an adjusted miscellaneous sequence table; and a calculation module, respectively obtaining corresponding noise values from corresponding positions of the adjusted miscellaneous sequence table according to the coordinate positions of each pixel point in the instant image, and respectively adding the corresponding noise values to a least significant bit of each pixel point to generate a corrected image; and an output unit, connected to the processor, outputting the corrected image.
2. The correction device for correcting an instant image through dithering processing according to claim 1, characterized in that, the time parameter is a frame count of the instant image, or a time count or a clock pulse of the image sensor.
3. The correction device for correcting an instant image through dithering processing according to claim 1, characterized in that, the miscellaneous sequence table is a table composed of a number of rows and a number of columns, and the number of noise values are respectively recorded in each field of the table. The calculation module calculates a first modulus of an x-axis coordinate of each pixel point and a total number of columns of the adjusted miscellaneous sequence table, and a second modulus of a y-axis coordinate of each pixel point and a total number of rows of the adjusted miscellaneous sequence table, and takes out the corresponding noise value from the corresponding position in the adjusted miscellaneous sequence table according to the first modulus and the second modulus.
4. The correction device for correcting an instant image through dithering processing according to claim 1, characterized in that, the displacement module performs a horizontal displacement or a vertical displacement on the number of noise values in the miscellaneous sequence table, and a displacement amount of the horizontal displacement and the vertical displacement is positively correlated with the time parameter.
5. The correction device for correcting an instant image through dithering processing according to claim 1, characterized in that, the calculation module performs a step-up processing or a step-down processing on the instant image to increase or decrease the number of bits of the instant image, and adds the obtained noise value to the least significant bit of each pixel point in the instant image to generate the corrected image.
6. A correction method for correcting an instant image through dithering processing, characterized in that, it includes: Step a) obtaining an instant image through an image sensor and recording a time parameter of the instant image; Step b) reading a miscellaneous sequence table, where the miscellaneous sequence table records a number of noise values used for correcting a number of pixel points in the instant image; Step c) displacing the number of noise values in the miscellaneous sequence table according to the time parameter to generate an adjusted miscellaneous sequence table; Step d) respectively obtaining corresponding noise values from corresponding positions of the adjusted miscellaneous sequence table according to the coordinate positions of each pixel point in the instant image; Step e) adding the corresponding noise value to the least significant bit of each of the pixel points to generate a corrected image; and Step f) outputting the corrected image.
7. The correction method for correcting an instantaneous image by dithering according to claim 6, wherein,[[]]END]] the time parameter is a frame count of the instantaneous image, or a time count or a clock pulse of the image sensor.
8. The correction method for correcting an instantaneous image by dithering according to claim 6, wherein,[[]]END]] the noise table is a table composed of a plurality of rows and a plurality of columns, and the plurality of noise values are respectively recorded in each field of the table, and step d) includes:[[]]END]] d1) obtaining the coordinate position of each of the pixel points in the instantaneous image, wherein the coordinate position includes an x-axis coordinate and a y-axis coordinate; d2) calculating a first modulus of the x-axis coordinate and a total number of columns of the adjusted noise table; d3) calculating a second modulus of the y-axis coordinate and a total number of rows of the adjusted noise table; and d4) taking out the corresponding noise value from the corresponding position in the adjusted noise table according to the first modulus and the second modulus.
9. The correction method for correcting an instantaneous image by dithering according to claim 6, wherein,[[]]END]] in step c), a horizontal displacement or a vertical displacement is performed on the plurality of noise values in the noise table according to the time parameter, and a displacement amount of the horizontal displacement and the vertical displacement is positively correlated with the time parameter.
10. The correction method for correcting an instantaneous image by dithering according to claim 6, wherein,[[]]END]] before step e), it further includes: e0) performing a boosting process or a reducing process on the instantaneous image to increase or decrease the number of bits of the instantaneous image; wherein, in step e), the obtained noise value is added to the least significant bit of each of the pixel points in the instantaneous image to generate the corrected image.
Citation Information
Patent Citations
System and method for imaging device modelling and calibration
CN105379264A
Crosstalk compensation method and display apparatus using the same
TW201423706A