[go: up one dir, main page]

CN115988333B - Correction method and correction device for correcting instant image through dithering - Google Patents

Correction method and correction device for correcting instant image through dithering Download PDF

Info

Publication number
CN115988333B
CN115988333B CN202111169848.3A CN202111169848A CN115988333B CN 115988333 B CN115988333 B CN 115988333B CN 202111169848 A CN202111169848 A CN 202111169848A CN 115988333 B CN115988333 B CN 115988333B
Authority
CN
China
Prior art keywords
image
real
noise
time
adjusted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111169848.3A
Other languages
Chinese (zh)
Other versions
CN115988333A (en
Inventor
王常余
曾英彰
梁景泓
许家良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mingli Technology Co ltd
Original Assignee
Mingli Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mingli Technology Co ltd filed Critical Mingli Technology Co ltd
Priority to CN202111169848.3A priority Critical patent/CN115988333B/en
Publication of CN115988333A publication Critical patent/CN115988333A/en
Application granted granted Critical
Publication of CN115988333B publication Critical patent/CN115988333B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention provides a correction method and a correction device for correcting an instant image through dithering, wherein the correction device comprises a receiving unit, a storage unit, a displacement module, a calculation module and an output unit. The correction device is connected with the image sensor through the receiving unit to receive the real-time image generated by the image sensor and record the time parameter of the real-time image. The storage unit stores a noise table, and the noise table records a plurality of noise values for correcting the image. The shift module shifts a plurality of noise values in the noise table according to the time parameter to generate an adjusted noise table. The calculation module obtains corresponding noise values from the adjusted noise table according to the coordinate positions of the pixel points in the real-time image, and adds the noise values to the pixel values of the pixel points respectively to generate a corrected image. The output unit outputs the corrected image.

Description

Correction method and correction device for correcting instant image through dithering
Technical Field
The present invention relates to image correction, and more particularly, to a method and apparatus for correcting an image in real time by dithering.
Background
In general, quantization errors occur after high and low precision conversion of an image. For the user, the image can generate fault visually after conversion, and the user can feel uncomfortable.
For example, if the color depth of the original image is six bits (bit), and the display for outputting the image is eight bits, the original image is upscaled from six bits to eight bits in order to meet the specification of the display. Similarly, if the color depth of the original image is ten bits, but the display for outputting the image is eight bits, the original image must be reduced from ten bits to eight bits. After the precision conversion, the image will generate the quantization error.
Please refer to fig. 1, which is a schematic diagram of the banding effect. As shown in fig. 1, when the original image 1 is processed to increase or decrease the number of bits, and then the converted image 2 is generated, the user views the converted image 2 with the naked eye, and visually perceives a fault 21 generated by a banding effect (banding effect), and the fault 21 is the quantization error. In order to make the image after the upscales/downscales look smooth, further processing is necessary for the image after the upscales/downscales.
Disclosure of Invention
The main objective of the present invention is to provide a correction method and a correction device for correcting an instant image by dithering, which can solve quantization errors generated after high and low precision conversion of the image by adding noise values generated by random numbers to a plurality of pixels in the image.
In order to achieve the above object, a correction device of the present invention includes:
a receiving unit connected with an image sensor for receiving an instant image generated by the image sensor and recording a time parameter of the instant image;
A storage unit for storing a hash table (hash table) for recording a plurality of noise values for correcting a plurality of pixels in the real-time image;
a processor, coupled to the receiving unit and the storage device, comprising:
a shift module for shifting the noise values in the noise table according to the time parameter to generate an adjusted noise table, and
A calculation module for obtaining the corresponding noise value from the corresponding position of the adjusted noise table according to the coordinate position of each pixel in the real-time image, and adding the corresponding noise value to the lowest bit of each pixel to generate a corrected image, and
And an output unit connected with the processor for outputting the corrected image.
As described above, the time parameter is a frame count of the real-time image, or a time count or clock of the image sensor.
As described above, the noise table is a table formed by a plurality of rows and a plurality of columns, the noise values are recorded in each column of the table, the calculating module calculates a first modulus of an x-axis coordinate of each pixel point and a total column number of the adjusted noise table, and a second modulus of a y-axis coordinate of each pixel point and a total column number of the adjusted noise table, and the corresponding noise value is taken out from the corresponding position in the adjusted noise table according to the first modulus and the second modulus.
As described above, the shift module performs a horizontal shift or a vertical shift on the noise values in the noise table, and a shift amount of the horizontal shift and the vertical shift is positively correlated with the time parameter.
As described above, the computing module performs an up-scaling process or a down-scaling process on the real-time image to increase or decrease the number of bits of the real-time image, and adds the obtained noise value to the lowest bit of each pixel in the real-time image to generate the corrected image.
In order to achieve the above object, the calibration method of the present invention comprises the steps of:
a) Obtaining an instant image by an image sensor and recording a time parameter of the instant image;
b) Reading a noise table, wherein the noise table records a plurality of noise values for correcting a plurality of pixels in the real-time image;
c) Shifting the noise values in the noise sequence table according to the time parameter to generate an adjusted noise sequence table;
d) Respectively obtaining the corresponding noise value from the corresponding position of the adjusted noise table according to the coordinate position of each pixel point in the real-time image;
e) Adding the corresponding noise value to the least significant bit of each pixel to generate a corrected image, and
F) Outputting the corrected image.
As described above, the time parameter is a frame count of the real-time image, or a time count or clock of the image sensor.
As described above, the noise table is a table formed by a plurality of rows and a plurality of columns, the noise values are respectively recorded in each column of the table, and the step d) includes:
d1 Obtaining the coordinate position of each pixel point in the real-time image, wherein the coordinate position comprises an x-axis coordinate and a y-axis coordinate;
d2 Calculating a first modulus of a total column number of the x-axis coordinate and the adjusted miscellaneous table;
d3 Calculating a second modulus of the y-axis coordinate and a total number of rows of the adjusted hash table, and
D4 According to the first modulus and the second modulus, the corresponding noise value is taken out from the corresponding position in the adjusted noise sequence table.
As described above, the step c) is to perform a horizontal displacement or a vertical displacement on the 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.
As described above, the step e) further comprises e 0) performing an upscaling process or a downscaling process on the real-time image to increase or decrease a bit number of the real-time image;
wherein, the step e) adds the obtained noise value to the lowest bit of each pixel point in the real-time image to generate the corrected image.
The invention adjusts the noise sequence table according to the time parameter of the image, and then obtains the corresponding noise value from the adjusted noise sequence table to correct each pixel point in the image. Therefore, the same noise value is prevented from being added to the same pixel point in a plurality of images which are adjacent in time, and the correction effect of the dithering treatment is reduced. In this way, the continuous image can be smoothed visually by the human eye.
Drawings
FIG. 1 is a schematic illustration of a banding effect;
FIG. 2 is a block diagram of a calibration apparatus according to a first embodiment of the present invention;
FIG. 3 is a first embodiment of a flow chart of a correction method of the present invention;
FIG. 4 is a first embodiment of an adjustment scheme of the hetero-sequence table according to the present invention;
Fig. 5 is a flowchart of an image correction method according to a first embodiment of the present invention.
Wherein, the reference numerals:
original image;
2. converted images;
Tomosynthesis;
correction means;
a processor;
311.a displacement module;
A computing module;
a receiving unit;
Storage unit;
331. table of miscellaneous sequences;
332. 333. the adjusted miscellaneous table;
an output unit;
An input unit;
image sensor;
noise value;
S10-S20, S160-S172.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and specific examples, which are not intended to limit the invention, so that those skilled in the art may better understand the invention and practice it.
Referring to fig. 2, a first embodiment of a block diagram of a calibration device according to the present invention is shown. The invention discloses a correction device (hereinafter referred to as correction device 3) for correcting an instant image through dithering (dithering). The correction device 3 may correct the converted image by dithering under the use environment where high-precision and low-precision conversion is required, and then output the corrected image. The dithering process refers to adding random noise values to each pixel point in the image, so as to eliminate quantization errors generated after high-low precision conversion of the image, and make the output continuous image look smoother.
As shown in fig. 2, 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, wherein the processor 31 is electrically connected to the receiving unit 32, the storage unit 33 and the output unit 34 for integrating and controlling the units 32-34.
In one embodiment, the processor 31 may be implemented as a micro control unit (Micro Control Unit, MCU), a central processing unit (Central Process Unit, CPU), a field programmable gate array (Field Programmable GATE ARRAY, FPGA), or an Application SPECIFIC INTEGRATED Circuit (ASIC). The processor 31 has computer readable program code recorded therein, and after the processor 31 executes the computer readable program code, various functions required by the calibration device 3 of the present invention can be realized.
Based on the functions realized by the processor 31, the calibration device 3 virtually generates a plurality of functional modules inside the processor 31, and mainly includes a displacement module 311 and a calculation module 312 (described in detail below). In the present embodiment, the displacement module 311 and the calculation module 312 are software modules implemented by the processor 31 by executing computer readable program codes, but are not limited thereto.
In one embodiment, the receiving unit 32 may be a connection port, such as a universal serial bus (Universal Serial Bus, USB) connection port, a serial peripheral interface (SERIAL PERIPHERAL INTERFACE, SPI) connection port, a Low-Voltage differential signal (Low-Voltage DIFFERENTIAL SIGNALING, LVDS) connection port, a mobile industrial processing interface (Mobile Industry Processor Interface, MIPI) connection port, etc., but not limited thereto. The correction device 3 is connected to the 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, the image sensor 4 is activated to continuously sense the external environment and continuously generate a plurality of images. After the calibration device 3 is started, the receiving unit 32 can continuously receive the continuous images generated by the image sensor 4.
The correction device 3 of the present invention corrects the image by dithering, which mainly adds random noise values to each pixel in the image to smooth the continuous image. In order to achieve the above objective, the correction device 3 adjusts the noise value to be added according to the time parameter of the current real-time image to be corrected, thereby avoiding that the same noise value is added in the previous and the next images by the same pixel point, and reducing the correction effect of the color jittering treatment. Therefore, the receiving unit 32 records the time parameter of the live video at the same time when receiving the live video.
In one embodiment, the time parameter is a frame count (frame) of the currently received live video. Since the receiving unit 32 receives only one frame image at a time, the time parameters corresponding to different frame images are necessarily different. In another embodiment, the time parameter is, but not limited to, a time count (timer) or a clock (clock) of the image sensor 4 generating the real-time image.
The image sensor 4 may be, for example, a camera, an infrared sensor, a laser sensor, etc., for sensing the external image in real time and integrating 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 human body images, but is not limited thereto.
The storage unit 33 may be, for example, but not limited to, a Hard disk (Hard-DRIVE DISK, HDD), a Solid-state disk (Solid-state disk) (Solid-STATE DISK, SSD), a FLASH Memory (FLASH Memory), a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Non-Volatile Memory (Non-Volatile Memory), etc. The storage unit 33 stores a hash table 331 in advance, and the hash table 331 records a plurality of noise values for correcting a plurality of pixels in an image.
In one embodiment, the user may generate a plurality of noise values and an arrangement order of the plurality of noise values through an algorithm in advance based on the required specification, and generate the noise table 331 based on the plurality of noise values and the corresponding arrangement order. Specifically, the noise table 331 is a table formed by a plurality of rows and a plurality of columns, and each noise value is recorded in a corresponding column (for example, as shown in fig. 4) in the noise table 331 according to a corresponding arrangement sequence.
In the present invention, the correction device 3 corrects the real-time image by the processor 31 and generates a corrected image, and outputs the corrected image by the output unit 34. In one embodiment, the output unit 34 may be an image output port, such as a high-resolution multimedia interface (High Definition Multimedia Interface, HDMI) output port, a serial digital interface (SERIAL DEFENSE INITIATIVE, SDI) output port, etc., and the calibration device 3 is connected to an external display through the output unit 34 to display the calibrated image. In another embodiment, the output unit 34 may be a display configured on the correction device 3 for directly displaying the corrected image. The foregoing is only a part of the specific embodiments of the present invention, but is not limited thereto.
The display may be, for example, a medical display for displaying real-time images sensed and generated by the image sensor 4 (e.g., a medical endoscope).
If the color depth (e.g., six bits) of the image generated by the image sensor 4 is smaller than the color depth (e.g., eight bits) of the display, the correction device 3 needs to perform the upscaling process on the image before outputting, and adds a noise value to the low bits of the image after the upscaling process, thereby eliminating the quantization error generated by the upscaling process.
For example, if the pixel value 20 (in six-bit binary representation, namely 010100) of a pixel in the image is increased to eight bits by the up-scaling process, the number of bits of the pixel is increased by two bits, and the pixel value becomes 80 (namely 01010000). In the present invention, the correction device 3 extracts the corresponding noise values, such as 0,1,2 and 3 (in two-bit binary representation, i.e. 00, 01, 10 and 11), from the noise table 331 after the step-up processing, and adds the noise values to the low-bit portion of the pixel point so that the pixel value becomes one of 80 (i.e. 01010000), 81 (01010001), 82 (01010010) and 83 (01010011).
If the color depth (e.g., ten bits) of the image generated by the image sensor 4 is greater than the color depth (e.g., eight bits) of the display, the correction device 3 needs to perform the order reduction processing on the image before outputting, and after the order reduction processing, adds a noise value to the low bits of the image after the order reduction processing, thereby eliminating the quantization error generated by the order reduction processing.
For example, if a pixel value of a pixel in an image is 320 (in ten-bit binary representation, that is, 0101000000), the number of bits of the pixel is reduced by two bits after the image is reduced to eight bits by the reduction process, and the pixel value becomes 80 (that is, 01010000). In the present invention, the correction device 3 extracts the corresponding noise values, such as 0, 1, 2, 3 (in binary representation of two bits, i.e. 00, 01, 10, and 11), from the noise table 331 after the step down processing, and adds the noise values to the low-order bit portion of the pixel point, so that the pixel value becomes one of 80 (i.e. 01010000), 81 (01010001), 82 (01010010), and 83 (01010011).
As described above, by adding different noise values to the same pixel point in different images, when continuous image playing is performed, the effect of repeatedly flickering the image can be achieved by using the persistence effect of human eyes (for example, the same pixel point can be continuously switched between the pixel values 80, 81, 82 and 83), thereby enabling the output image to achieve higher resolution. The foregoing description is only illustrative of the present invention, but is not limited thereto.
As described above, the present invention employs a spatial dithering method to achieve the effect of persistence of vision, so the correction device 3 needs to ensure that the same pixel point is used to correct each of a plurality of images adjacent in time by using different noise values.
As described above, the processor 31 can execute the computer readable program codes to form the virtual displacement module 311 and the calculation module 312. The displacement module 311 can obtain the current time parameter of the real-time image from the receiving unit 32, and obtain the pre-stored miscellaneous table 331 from the storage unit 33. And, the shift module 311 shifts the noise values in the noise table 331 according to the time parameter to generate an adjusted noise table. In the present invention, the arrangement order of the noise values in the adjusted noise table is positively correlated with the time parameter of the real-time image, and the processor 31 corrects the real-time image (i.e. color dithering) according to the adjusted noise table.
The calculating module 312 obtains the coordinate positions of each pixel in the real-time image, and obtains the corresponding noise values from the corresponding positions in the adjusted noise table according to the coordinate positions. Then, the computing module 312 adds the obtained noise values to the least significant bit portion of each pixel to generate a plurality of corrected pixels, and generates a corrected image according to the corrected pixels. Finally, the processor 31 transmits the corrected image to the output unit 34 for output by the output unit 34.
In the present invention, the number of bits of the corrected image is different from that of the real-time image, and meets the specification of the display (or the output unit 34). Although the corrected images are subjected to the up/down process, each image is subjected to the dithering process, and thus appears smooth to the human eye.
Referring to fig. 2 and 3, fig. 3 is a flowchart of a calibration method according to a first embodiment of the present invention. The present invention further discloses a correction method for correcting the real-time image through dithering (hereinafter, referred to as correction method). The correction method is mainly applied to the correction device 3 shown in fig. 2, and the correction device 3 can execute the correction method to implement the dithering process, thereby correcting the real-time image.
As shown in fig. 3, first, the calibration device 3 obtains an instant image through the connected image sensor 4 and records a time parameter of the instant image (step S10), and the processor 31 reads the noise table 331 from the storage unit 33 and shifts a plurality of noise values in the noise table 331 according to the time parameter to generate an adjusted noise table (step S12). The noise table 331 is a table composed of a plurality of rows and a plurality of columns, and a plurality of noise values are respectively recorded in each column of the table.
In one embodiment, the time parameter is a frame count of the real-time image. In step S10, the calibration device3 determines which frame in the continuous images the currently received live image is, through the receiving unit 32 or the processor 31. In step S12, the processor 31 performs horizontal displacement, vertical displacement or both horizontal displacement and vertical displacement on the noise values in the noise table 331 according to the frame count (e.g. the first frame, the second frame, the third frame, etc.) of the real-time image.
By shifting the recording positions of the noise values in the noise table 331, the same noise value can be avoided from being used to correct the same pixel point in the plurality of images adjacent in time. Or the same pixel point in the multiple images is corrected by using the same noise value, and the same times of the correction do not exceed the threshold value, so that the corrected images are still within the acceptable range of naked eyes of users.
In another embodiment, the time parameter is a time count or clock of the image sensor 4. In step S10, the calibration 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 performs horizontal displacement, vertical displacement or both horizontal displacement and vertical displacement on the noise values in the noise table 331 according to the time count or clock.
After step S12, the processor 31 obtains the coordinate positions of each pixel point in the real-time image, and obtains the corresponding noise values at the corresponding positions of the adjusted noise table according to the coordinate positions respectively (step S14). After the execution of step S14, the processor 31 may respectively correspond each pixel point in the real-time image to a noise value. And, the processor 31 adds the corresponding noise value to the least significant bit of each pixel in the real-time image, thereby generating the corrected image (step S16). In one embodiment, the pixel value of each pixel is represented by a binary number, and the processor 31 converts the noise value into a binary number in step S16, and then adds the binary number to the lowest bit of the pixel.
It should be noted that the dithering process is to solve quantization errors generated after the high-precision and low-precision conversion of the image. Therefore, the correction device 3 and the correction method of the present invention can perform the color dithering process only in the use environment where the image is required to be subjected to the up-scaling process or the down-scaling process, and the processed image is required to be corrected due to the fault 21 shown in fig. 1.
In the present invention, the correction device 3 mainly determines whether to perform the up-scaling process (i.e. increasing the number of bits of the real-time image) or the down-scaling process (i.e. decreasing the number of bits of the real-time image) based on the difference between the color depth of the real-time image and the color depth of the output display. If the up-scaling or down-scaling of the real-time image is required, the correction device 3 may perform the up-scaling or down-scaling on the real-time image at any time point from the step S10 to the step S16 to obtain the processed image. Specifically, the correction device 3 may perform an upscaling process on the real-time image through the computing module 312 in the processor 31 to increase the number of bits of each pixel in the real-time image. Alternatively, the correction device 3 may perform the step down process by the calculation module 312 to reduce the number of bits of each pixel in the real-time image.
It should be noted that, in the step-up process, the processor 31 increases the set number of bits at the least significant bit of each pixel. In the order reduction process, the processor 31 deletes the set number of bits from the lowest bit of each pixel. In step S16, the processor 31 adds a corresponding noise value to the least significant bit of each pixel in the processed image, thereby generating a corrected image.
After step S16, the correction device 3 outputs a corrected image through the output unit 34 (step S18), wherein the color depth of the corrected image matches the specification of the display (or the output unit 34) used to output the image.
After step S18, the processor 31 determines whether the next image is subjected to dithering (step S20), that is, the processor 31 determines whether the correction device 3 is turned off or whether the image sensor 4 stops transmitting images. If no in step S20, the processor 31 executes steps S10 to S18 again to perform dithering on the next image. Thus, the continuous images outputted from the correction device 3 look smoother.
Referring to fig. 2, 3 and 4, fig. 4 is a first embodiment of an adjustment schematic diagram of a hetero-sequence table according to the present invention. As shown in fig. 4, the noise table 331 is a table formed by a plurality of rows and a plurality of columns, and a plurality of noise values 5 are stored in the table. Since different images have different time parameters, the content of the misconnection table 331 used by the processor 31 to correct the real-time images obtained at different time points is also different.
As shown in fig. 4, if the time parameter of the first real-time image (for example, the first frame in the continuous image or the 0.01ms corresponding to the image sensor 4) is 1, the processor 31 does not adjust the miscellaneous table 331, but can directly correct the first real-time image according to the content of the pre-stored miscellaneous table 331.
The temporal parameter of the second real-time image (e.g., the second frame of the continuous image or the 0.02ms corresponding to the image sensor 4) is 2, and the processor 31 performs horizontal displacement and/or vertical displacement on the noise values 5 in the noise table 331 to generate the adjusted noise table 332. And, the processor 31 corrects the second real-time image based on the content of the adjusted miscellaneous table 332. In this embodiment, the processor 31 performs a unit horizontal shift (right shift in fig. 4 for example) on all the noise values 5 in the noise table 331, and then performs a unit vertical shift (up shift in fig. 4 for example) on all the noise values 5 in the first row to generate the adjusted noise table 332.
The temporal parameter of the third real-time image (e.g., the third frame in the continuous image or the 0.03ms corresponding to the image sensor 4) is 3, and the processor 31 performs horizontal displacement or/and vertical displacement on the noise values 5 in the adjusted noise table 332 to generate the adjusted noise table 333. And, the processor 31 corrects the third real-time image based on the content of the adjusted misclassification table 333. In this embodiment, the processor 31 performs a unit of horizontal displacement on all the noise values 5 in the adjusted noise table 332, and then performs a unit of vertical displacement on all the noise values 5 in the first row to generate the adjusted noise table 333.
In the embodiment shown in fig. 4, the numerical value, the arrangement order and the displacement of each noise value 5 are only used as examples, and are not meant to limit the scope of the present invention.
The values and the arrangement order of the noise values 5 in the noise table 331 may be preset, so that the processor 31 may use different noise values 5 to correct a plurality of pixel points (adjacent left and right or adjacent up and down) in the image that are adjacent in position when performing the dithering process. Therefore, adjacent pixel points at a plurality of positions in the corrected image have small differences, and when a user looks at the corrected image with naked eyes, the fault sense can not appear, so that the main purpose of color shaking treatment can be achieved.
More specifically, the noise values 5 in the noise table 331 may be generated by a random number generator. When using the random number generator, the user can set the random number generator so that the generated random numbers (i.e., the noise value 5) have a predetermined characteristic. For example, two adjacent noise values 5 are different from each other, or the number of noise values 5 having the same value does not exceed a threshold value among a plurality of adjacent noise values 5.
The dithering process is performed by adding two bits of noise values, for example.
The noise table 331 is configured to record noise values 5 (e.g., two-bit binary representing 10, 00, 01, 11) of 2,0, 1, 3 in the first column. When the image sensor 4 performs horizontal scanning and inputs the first effective horizontal line of the real-time image, the processor 31 may sequentially correct each pixel point in the first effective horizontal line with the noise value 5 of 2,0, 1, 3, 2,0, 1, 3. For another example, the contents of the second row in the miscellaneous table 331 may be 0, 1, 3, 2 (e.g., two-bit binary, i.e., representing 00, 01, 11, 10). When the image sensor 4 inputs the second effective horizontal line of the real-time image, the processor 31 may sequentially correct each pixel point in the second effective horizontal line with the noise value 5 of 0, 1, 3, 2,0, 1, 3, 2.
In addition, when the image sensor 4 performs the vertical scanning of the image, the processor 31 of the correction device 3 may also use logic similar to that described above to extract the corresponding noise value 5 from the noise table 331 so as to correct each pixel point in the image in sequence, and make the corrected image have the technical effects of the present invention described above.
The foregoing is merely an example of the present invention, but is not limited thereto.
The amount of noise 5 in the noise table 331 may be less than the number of pixels in the real-time image, limited by the capacity of the storage unit 31 of the correction device 3. In one embodiment, the correction device 3 determines which one of the noise table 331 and the adjusted noise table 332, 333 is to be used for the noise value 5 based on the position of each pixel in the instant image.
Referring to fig. 2, 3 and 5, fig. 5 is a first embodiment of an image correction flowchart of the present invention. Fig. 5 is a diagram illustrating how the correction device 3 obtains the corresponding noise value 5 to correct each pixel point in the real-time image in step S16 in fig. 3.
As shown in fig. 5, first, the processor 31 reads one of the pixels from the currently received instant image through the calculating module 312, and obtains the coordinate position of the pixel in the instant image (step S160). Wherein, the coordinate position includes the X-axis coordinate and the Y-axis coordinate of the pixel in the coordinate system adopted by the real-time image. In one embodiment, the coordinate location represents the location of the pixel in the instant image. For example, if the coordinate position of the first pixel is (5, 5), it represents that the first pixel is located at the 5 th row and 5 th column of the real-time image. If the coordinate position of the second pixel is (101, 100), it represents that the second pixel is located at the position of the 101 st row and 100 th column in the real-time image, and so on.
Next, the calculating module 312 calculates a first modulus (mod) of the X-axis coordinate of the pixel and the total column number of the adjusted hybrid list (step S162), and calculates a second modulus of the Y-axis coordinate and the total column number of the adjusted hybrid list (step S164). Finally, the calculating module 312 extracts the corresponding noise value from the adjusted noise table according to the first module and the second module (step S166), and adds the noise value to the lowest bit of the pixel point (step S168).
As shown in fig. 4, the table 331 is composed of a plurality of rows and columns, and the adjusted tables 332 and 333 are only the positions of the noise values 5 in the table columns are changed compared with the table 331, but the sizes of the adjusted tables 332 and 333 are the same as the size of the table 331, i.e. the total column number is the same as the total column number.
Taking the currently processed live image as the third frame image for example, the processor 31 may obtain the adjusted miscellaneous table 333 through the calculation module 312. Next, the calculating module 312 obtains the coordinate position of one of the pixels in the real-time image, and for convenience of description, the pixel with the coordinate position (101, 100) is taken as an example. First, the calculation module 312 calculates a first modulus of the X-axis coordinate (i.e., 101) and the total column number of the adjusted miscellaneous table 333 (i.e., 6), i.e., 101 mod 6=5. And, the calculation module 312 calculates a second modulus of the Y-axis coordinate (i.e., 100) and the total number of rows of the adjusted miscellaneous table 333 (i.e., 4), i.e., 100 mod 4 = 0.
It should be noted that, since the size of the mixed sequence table 331 is the same as that of the adjusted mixed sequence tables 332, 333, the calculation module 312 can perform the modulus calculation based on the total column number and the total row number of any one of the mixed sequence tables 331, 332, 333. The processor 31 may generate the adjusted miscellaneous tables 332 and 333 before performing the modulus calculation, or may generate the adjusted miscellaneous tables 332 and 333 after performing the modulus calculation, which is not limited.
Accordingly, the calculation module 312 obtains the noise value 5 (2 in the embodiment of fig. 4, and 10 in binary representation) at the position (5, 0) in the adjusted noise table 333 according to the first modulus and the second modulus. In step S168 of fig. 5, the calculation module 312 may add the noise value "10" of two bits to the lowest bit of the pixel to complete the correction of the pixel. If the value of the noise value 5 is greater than 3, the calculation module 312 is required to be represented by more bits and added to the lowest bit of the pixel because the value exceeds the range represented by two bits.
Otherwise, if the value of the noise value 5 exceeds the range represented by two bits, but the quantization error of the real-time image to be corrected is not serious, the calculation module 312 may only take the last two bits of the noise value 5 to correct the pixel. For example, if the determined noise value 5 is 6 (110 in binary), the calculation module 312 may take only the last two bits (10 in decimal) to correct the pixel. The foregoing is only a part of the specific embodiments of the present invention, but is not limited thereto.
In one embodiment, the noise value 5 may be recorded in binary form in the noise table 331. In another embodiment, the noise value 5 may be recorded in the noise table 331 in the form of decimal bits. If the noise value 5 is recorded in the noise table 331 in the decimal form, in the step S168, the calculation module 312 converts the noise value obtained in the step S166 into a binary value, and then adds the converted noise value to the lowest bit of the pixel.
After step S168, the processor 31 determines whether all pixels in the real-time image have been corrected (step S170). If not, the processor 31 again executes steps S160 to S168 to correct other pixels in the real-time image. After all the pixels in the real-time image are corrected, the processor 31 can generate a corrected image according to all the corrected pixels (step S172).
It should be noted that, the present invention only needs to execute the correction process shown in fig. 3 when the quality of the image needs to be improved, so as to reduce the overall resource consumption of the image processing system (not shown). For example, the present invention can perform the correction processing when the image is subjected to high-and low-precision conversion and a serious quantization error is generated. For another example, the present invention may perform the correction process when the original image itself has a serious level difference (e.g., the fault 21 shown in fig. 1 appears).
In an embodiment, the calibration device 3 of the present invention further has an input unit (such as the input unit 35 shown in fig. 2) connected to the processor 31, and the input unit 35 may be a Human interface (Human MACHINE INTERFACE, HMI), such as a button, a touch panel, etc., but is not limited thereto.
In this embodiment, the user can continuously view the real-time image generated and outputted by the image sensor 4 on the display connected to the calibration device 3. The input unit 35 may be manually activated when the user considers the live image to be problematic, such as when seeing the fault 21 as shown in fig. 1. In this embodiment, after the input unit 35 is triggered, the control processor 31 executes the steps shown in fig. 3 and 5 to perform dithering on the real-time image, thereby eliminating various phenomena generated by quantization errors.
In another embodiment, when receiving and outputting the real-time image generated by the image sensor 4, the calibration device 3 continuously analyzes the content of the real-time image by the processor 31 and automatically determines whether the image needs to be color-jittered.
Specifically, the processor 31 may sample each of the continuous images, and calculate standard deviations of pixel values of a plurality of pixels within a plurality of specific ranges in the same image. For example, taking a range of nine pixels 3×3 as an example, the processor 31 calculates a standard deviation of pixel values of the nine pixels. In this embodiment, the processor 31 can sample a plurality of different specific ranges in the same image. When the number of specific ranges with too small standard deviation in one image exceeds the preset number, the processor 31 can determine that the dithering correction is needed for the subsequent image.
As described above, when the calculation result of the standard deviation meets the start condition (for example, the number of the specific ranges with too small standard deviation exceeds the preset number), the processor 31 can determine that the quantization error of the image is serious, and automatically execute the steps shown in fig. 3 and 5 to perform the dithering process on the real-time image. For example, the processor 31 may determine that the start condition is met when the standard deviation of ten specific ranges out of the sampled twenty specific ranges is smaller than a predetermined threshold value.
It should be noted that, the dithering process may be performed only when a single image meets the above starting conditions, which may cause an inaccurate analysis. Therefore, in other embodiments, the processor 31 may start the dithering process on the real-time image when the calculation results of the standard deviations of the continuous images all meet the starting conditions.
The above description is only an example of the present invention, and the predetermined threshold value may be different according to the content of the image sensed by the image sensor 4. For example, if the colors of the multiple parts of the object sensed by the image sensor 4 are close (e.g. a copper foil), the pixel values of the multiple pixels in the real-time image are close. At this time, the preset threshold value must be adjusted down to avoid erroneous judgment.
For example, the standard deviation of the specific range of the general image may be 100, and the quantization error may be reduced to 80 when it occurs, so the predetermined threshold value may be set to 85, for example. For example, the standard deviation of the image may be only 60 in the specific range, and may be reduced to 50 when quantization error occurs. In this case, the predetermined threshold value is adjusted down (e.g., from 85 to 55) to avoid erroneous determination.
The correction device 3 and the correction method of the invention can more effectively generate and use random noise values by adjusting the content of the noise sequence table through the time parameter of the real-time image so as to carry out dithering treatment on the real-time image. Thus, the real-time noise calculation is performed without spending a lot of hardware resources, so that the implementation is easier on simple and low-cost hardware.
The above-described embodiments are merely preferred embodiments for fully explaining the present invention, and the scope of the present invention is not limited thereto. Equivalent substitutions and modifications will occur to those skilled in the art based on the present invention, and are intended to be within the scope of the present invention. The protection scope of the invention is subject to the claims.

Claims (10)

1.一种通过抖色处理对即时影像进行校正的校正装置,其特征在于,包括:1. A correction device for correcting a real-time image by color dithering, characterized by comprising: 一接收单元,连接一影像感测器,接收该影像感测器产生的一即时影像,并记录该即时影像的一时间参数;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; 一储存单元,储存一杂序表,该杂序表记录用以对该即时影像中的若干像素点进行校正的若干杂讯值;A storage unit stores a hash table, wherein the hash table records a plurality of noise values used to calibrate a plurality of pixel points in the real-time image; 一处理器,连接该接收单元及该储存单元,包括:A processor, connected to the receiving unit and the storage unit, comprising: 一位移模组,依据该时间参数对该杂序表中的该若干杂讯值进行位移,以产生一调整后杂序表;及a shift module, shifting the plurality of noise values in the hash table according to the time parameter to generate an adjusted hash table; and 一计算模组,依据各该像素点于该即时影像中的坐标位置分别从该调整后杂序表的对应位置上取得对应的该杂讯值,并且分别于各该像素点的一最低位元添加对应的该杂讯值,以产生一校正后影像;及a calculation module, which obtains the corresponding noise value from the corresponding position of the adjusted noise table according to the coordinate position of each pixel point in the real-time image, and adds the corresponding noise value to a lowest bit of each pixel point to generate a corrected image; and 一输出单元,连接该处理器,输出该校正后影像。An output unit is connected to the processor to output the corrected image. 2.根据权利要求1所述的通过抖色处理对即时影像进行校正的校正装置,其特征在于,该时间参数为该即时影像的一帧计数,或该影像感测器的一时间计数或一时脉。2. The correction device for correcting real-time images by color dithering processing according to claim 1, wherein the time parameter is a frame count of the real-time image, or a time count or a clock of the image sensor. 3.根据权利要求1所述的通过抖色处理对即时影像进行校正的校正装置,其特征在于,该杂序表为由若干行及若干列构成的一表格,该若干杂讯值分别记录于该表格中的各个栏位,该计算模组计算各该像素点的一x轴坐标与该调整后杂序表的一总列数的一第一模数,以及各该像素点的一y轴坐标与该调整后杂序表的一总行数的一第二模数,并且依据该第一模数及该第二模数从该调整后杂序表中的对应位置取出对应的该杂讯值。3. According to claim 1, the correction device for correcting real-time images by color dithering processing is characterized in that 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 column of the table, and 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 noise table, and a second modulus of a y-axis coordinate of each pixel point and a total number of rows of the adjusted noise table, and extracts the corresponding noise value from the corresponding position in the adjusted noise table according to the first modulus and the second modulus. 4.根据权利要求1所述的通过抖色处理对即时影像进行校正的校正装置,其特征在于,该位移模组对该杂序表中的该若干杂讯值进行一水平位移或一垂直位移,并且该水平位移与该垂直位移的一位移量与该时间参数正相关。4. The correction device for correcting real-time images by color dithering processing according to claim 1 is characterized in that the displacement module performs a horizontal displacement or a vertical displacement on the plurality of noise values in the noise table, and a displacement amount of the horizontal displacement and the vertical displacement is positively correlated with the time parameter. 5.根据权利要求1所述的通过抖色处理对即时影像进行校正的校正装置,其特征在于,该计算模组对该即时影像执行一升阶处理或一降阶处理以增加或减少该即时影像的位元数,并且将所取得的该杂讯值添加至该即时影像中的各该像素点的该最低位元以产生该校正后影像。5. The correction device for correcting real-time images by dithering according to claim 1, characterized in that the computing module performs 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, and adds the obtained noise value to the lowest bit of each pixel in the real-time image to generate the corrected image. 6.一种通过抖色处理对即时影像进行校正的校正方法,其特征在于,包括:6. A correction method for real-time images by color dithering, characterized by comprising: 步骤a)通过一影像感测器获得一即时影像并记录该即时影像的一时间参数;Step a) obtaining a real-time image through an image sensor and recording a time parameter of the real-time image; 步骤b)读取一杂序表,其中该杂序表记录用以对该即时影像中的若干像素点进行校正的若干杂讯值;Step b) reading a hash table, wherein the hash table records a number of noise values used to calibrate a number of pixel points in the real-time image; 步骤c)依据该时间参数对该杂序表中的该若干杂讯值进行位移,以产生一调整后杂序表;Step c) shifting the plurality of noise values in the hash table according to the time parameter to generate an adjusted hash table; 步骤d)依据各该像素点于该即时影像中的坐标位置分别从该调整后杂序表的对应位置上取得对应的该杂讯值;Step d) obtaining the corresponding noise value from the corresponding position of the adjusted noise table according to the coordinate position of each pixel point in the real-time image; 步骤e)分别于各该像素点的一最低位元添加对应的该杂讯值,以产生一校正后影像;及Step e) adding the corresponding noise value to a least significant bit of each pixel point to generate a corrected image; and 步骤f)输出该校正后影像。Step f) outputting the corrected image. 7.根据权利要求6所述的通过抖色处理对即时影像进行校正的校正方法,其特征在于,该时间参数为该即时影像的一帧计数,或该影像感测器的一时间计数或一时脉。7. The method for correcting real-time images by color dithering according to claim 6, wherein the time parameter is a frame count of the real-time image, or a time count or a clock of the image sensor. 8.根据权利要求6所述的通过抖色处理对即时影像进行校正的校正方法,其特征在于,该杂序表为由若干行及若干列构成的一表格,该若干杂讯值分别记录于该表格中的各个栏位,该步骤d)包括:8. The method for correcting real-time images by dithering according to claim 6, wherein the noise table is a table consisting of a plurality of rows and a plurality of columns, the plurality of noise values are respectively recorded in respective fields of the table, and the step d) comprises: d1)取得各该像素点于该即时影像中的该坐标位置,其中该坐标位置包括一x轴坐标及一y轴坐标;d1) obtaining the coordinate position of each pixel point in the real-time image, wherein the coordinate position includes an x-axis coordinate and a y-axis coordinate; d2)计算该x轴坐标与该调整后杂序表的一总列数的一第一模数;d2) calculating a first modulus of the x-axis coordinate and a total number of rows in the adjusted hash table; d3)计算该y轴坐标与该调整后杂序表的一总行数的一第二模数;及d3) calculating a second modulus of the y-axis coordinate and a total number of rows in the adjusted hash table; and d4)依据该第一模数及该第二模数从该调整后杂序表中的对应位置取出对应的该杂讯值。d4) extracting the corresponding noise value from the corresponding position in the adjusted hash table according to the first modulus and the second modulus. 9.根据权利要求6所述的通过抖色处理对即时影像进行校正的校正方法,其特征在于,该步骤c)是依据该时间参数对该杂序表中的该若干杂讯值进行一水平位移或一垂直位移,并且该水平位移与该垂直位移的一位移量与该时间参数正相关。9. The method for correcting real-time images by dithering according to claim 6, wherein the step c) is to perform a horizontal displacement or a vertical displacement 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.根据权利要求6所述的通过抖色处理对即时影像进行校正的校正方法,其特征在于,该步骤e)之前还包括:e0)对该即时影像执行一升阶处理或一降阶处理以增加或减少该即时影像的一位元数;10. The method for correcting a real-time image by color dithering according to claim 6, characterized in that before step e), the method further comprises: e0) performing an upscaling process or a downscaling process on the real-time image to increase or decrease a bit number of the real-time image; 其中,该步骤e)将所取得的该杂讯值添加至该即时影像中的各该像素点的该最低位元以产生该校正后影像。Wherein, the step e) adds the obtained noise value to the lowest bit of each pixel in the real-time image to generate the corrected image.
CN202111169848.3A 2021-10-08 2021-10-08 Correction method and correction device for correcting instant image through dithering Active CN115988333B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111169848.3A CN115988333B (en) 2021-10-08 2021-10-08 Correction method and correction device for correcting instant image through dithering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111169848.3A CN115988333B (en) 2021-10-08 2021-10-08 Correction method and correction device for correcting instant image through dithering

Publications (2)

Publication Number Publication Date
CN115988333A CN115988333A (en) 2023-04-18
CN115988333B true CN115988333B (en) 2025-05-27

Family

ID=85958608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111169848.3A Active CN115988333B (en) 2021-10-08 2021-10-08 Correction method and correction device for correcting instant image through dithering

Country Status (1)

Country Link
CN (1) CN115988333B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201423706A (en) * 2012-12-07 2014-06-16 Innocom Tech Shenzhen Co Ltd Crosstalk compensation method and display apparatus using the same
CN105379264A (en) * 2013-07-02 2016-03-02 盖伊·马丁 Systems and methods for imaging device modeling and calibration

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7158654B2 (en) * 1993-11-18 2007-01-02 Digimarc Corporation Image processor and image processing method
US7050143B1 (en) * 1998-07-10 2006-05-23 Silverbrook Research Pty Ltd Camera system with computer language interpreter
US7551323B2 (en) * 2003-04-16 2009-06-23 Lexmark International, Inc. Systems and methods for error diffusion
US9314214B2 (en) * 2006-09-13 2016-04-19 Brainlab Ltd. Calibration of radiographic images
US9805442B2 (en) * 2012-10-03 2017-10-31 Avago Technologies General Ip (Singapore) Pte. Ltd. Fine-grained bit-rate control
JP2017136706A (en) * 2016-02-01 2017-08-10 株式会社リコー Image processing apparatus, image processing method, and image processing system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201423706A (en) * 2012-12-07 2014-06-16 Innocom Tech Shenzhen Co Ltd Crosstalk compensation method and display apparatus using the same
CN105379264A (en) * 2013-07-02 2016-03-02 盖伊·马丁 Systems and methods for imaging device modeling and calibration

Also Published As

Publication number Publication date
CN115988333A (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN111695554B (en) Text correction method and device, electronic equipment and storage medium
US8379976B2 (en) Image processing apparatus and method and a computer-readable recording medium on which an image processing program is stored
JP2020129276A5 (en)
CN113962892B (en) Method, device and photographic equipment for correcting wide-angle lens image distortion
CN111223061A (en) Image correction method, correction device, terminal device, and readable storage medium
CN115988333B (en) Correction method and correction device for correcting instant image through dithering
US10713757B2 (en) Image processing apparatus, control method thereof, and storage medium
TWI789012B (en) Method and device of calibrating real-time image through dithering process
JP2008107893A (en) Noise reduction apparatus and method
US11132776B2 (en) Image processing device, image processing method, and image processing program for maintaining sharpness of image
KR102521889B1 (en) Image processing device, image processing method and recording medium recording image processing program
CN115002344B (en) Error curved surface fitting method, device, equipment and medium
CN117201950A (en) Hue adjustment method, hue adjustment device, and readable storage medium
JP2012028893A (en) Contour emphasis device
Blasinski et al. Real-time, color image barrel distortion removal
JP6103655B2 (en) Projection display apparatus and projection display method
JP7299398B1 (en) Image processing device and image processing method
JP2003101884A (en) Shading correcting device and method
EP4354893A1 (en) Method for image processing, device and software
CN114915769B (en) Shadow correction method and shadow correction device for real-time image
US20150235349A1 (en) Image processing apparatus, image processing method, and computer-readable recording medium
JP6019782B2 (en) Image processing apparatus, image processing method, image processing program, and recording medium
CN118696207A (en) Information processing device, robot control system, and program
KR20160082367A (en) Efficient Image Rectification Method and Apparatus
JP2011076539A (en) Image processor and image processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant