Ink droplet image optimization method and device, equipment and storage medium
By acquiring background images to identify fixed defects and brightness correction, converting image types, and optimizing grayscale data, the problems of defects and uneven brightness in ink droplet images during inkjet printing were solved, achieving a highly efficient contrast enhancement effect.
Patent Information
- Application Number
- CN202511118415.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-21
AI Technical Summary
Existing inkjet printing techniques suffer from issues such as background fixation defects, uneven brightness, and low contrast enhancement efficiency in flying ink droplet images. In particular, high-resolution image processing is time-consuming and cannot meet real-time requirements.
By acquiring multiple background images, the location information and brightness correction coefficient of fixed defects are determined. The target image is then processed to remove fixed defects and uniformize the brightness. The image is converted from integer to floating point, and the gray level range is determined using a histogram sorting accuracy balance model. The gray level data is then optimized based on the outlier removal ratio and finally normalized to an integer image.
It improves image quality, achieves fast and high-precision contrast enhancement, ensures the contrast uniformity and clarity of ink droplet images, and meets the requirements of real-time processing.
Smart Images

Figure CN120997104A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of inkjet printing flying ink droplet observation technology, specifically to an optimization method, apparatus, device, and storage medium for ink droplet images. Background Technology
[0002] In inkjet printing, microfluidic control, or other technologies involving the generation and observation of tiny droplets, accurately acquiring parameters such as the morphology, size, and velocity of ink droplets is crucial. This typically requires the use of imaging equipment such as high-speed cameras to capture and analyze ink droplets in flight. Because ink droplets are traveling at high speeds, the grayscale of their edges is often quite similar to the background. Therefore, existing technologies often require contrast enhancement of the captured droplet images to more clearly distinguish the differences between the droplets and the background.
[0003] However, when acquiring and analyzing images of flying ink droplets, on the one hand, ink droplet images are susceptible to fixed defects in the optical system. Specifically, stains on the surface of the optical lens, dust adhering to the sensor sensing area, and residues inside the lens barrel can form permanent background defect areas in the acquired images. On the other hand, during ink droplet observation, uneven illumination from the light source and differences in the response of optical components (such as lenses and filters) often lead to locally overly bright or dark areas in the acquired images, such as over-brightening of the central area of the light source or weakening of the edge areas. Both fixed defects in the ink droplet image and uneven brightness in different areas will affect the subsequent contrast enhancement process, reducing the contrast between the background and the ink droplets in the subsequent ink droplet image.
[0004] Furthermore, when improving the contrast of ink droplet images, it is necessary to eliminate pixel noise in the ink droplet image before performing contrast stretching and enhancement. To remove pixel noise from the ink droplet image, the pixels in the image need to be sorted by their grayscale value first. This allows the removal of pixels with the highest grayscale value, thus eliminating grayscale outliers, i.e., pixel noise. However, related technologies often rely on traditional numerical sorting methods to remove outliers, which have a time complexity of O(Nlog N). This is too time-consuming for high-resolution images (such as 4K) and cannot meet real-time requirements.
[0005] Therefore, the ink droplet images captured by the existing technology have at least some fixed defects, uneven brightness, and low efficiency and poor effect of contrast enhancement, which need to be further improved. Summary of the Invention
[0006] This application provides a method, apparatus, device, and storage medium for optimizing ink droplet images, which can solve the problems existing in the prior art, such as background fixation defects, uneven brightness distribution, and low efficiency and poor effect of contrast enhancement in flying ink droplet images.
[0007] In a first aspect, embodiments of this application provide a method for optimizing ink droplet images, employing the following technical solution:
[0008] An optimization method for ink droplet images, comprising the following steps:
[0009] Acquire multiple background images taken under set standard shooting conditions and target images obtained by shooting flying ink droplets under the same conditions;
[0010] Based on multiple observed background images, determine the location information and brightness correction coefficient of the fixed defects under the standard shooting conditions;
[0011] The target image is processed using the brightness correction coefficient and the location information of the fixed defects to obtain a transition image;
[0012] Convert the integer-type transition image into a floating-point type target image;
[0013] Based on the size and grayscale range of the target image, a preset histogram sorting accuracy balance model is used to determine the number of grayscale intervals and the grayscale range of each grayscale interval for histogram sorting of the pixel grayscale data of the floating-point target image.
[0014] Based on the number of grayscale intervals, the grayscale range of the grayscale intervals, and the pixel grayscale data of the floating-point target image, the number of pixels corresponding to each grayscale interval in the floating-point target image is counted and a histogram is formed.
[0015] The pixel grayscale data of the optimized floating-point target image are obtained by removing the corresponding percentage of pixel grayscale data before and after the histogram according to the set outlier removal ratio.
[0016] The pixel grayscale data of the optimized floating-point target image is normalized to a preset target grayscale range and then converted into integer image data to obtain the result image.
[0017] In conjunction with the first aspect, in one embodiment, determining the location information and brightness correction coefficient of the fixed defect under the standard shooting conditions based on multiple observed background images includes the following steps:
[0018] Based on multiple observed background images, a mean background image is obtained;
[0019] Based on the background mean image and the set fixed defect detection algorithm, the location information of fixed defects in the background is determined;
[0020] Based on the location information of the fixed defects, the fixed defects in the background mean image are eliminated to obtain a background mean image without fixed defects;
[0021] Determine the brightness distribution information of the background mean image without fixed defects;
[0022] Calculate the brightness reference value of the background of the flying ink droplet observation based on the brightness values of some pixel regions in the brightness distribution information;
[0023] The brightness correction coefficient is calculated based on the brightness reference value.
[0024] In conjunction with the first aspect, in one embodiment, the step of calculating the brightness correction coefficient based on the brightness reference value,
[0025] The brightness correction coefficient for each pixel in the target image is determined based on the ratio between the brightness reference value and the brightness of any pixel in the mean background image without fixed defects.
[0026] In conjunction with the first aspect, in one embodiment, the step of determining the number of grayscale intervals for histogram sorting of the pixel grayscale data of the floating-point target image and the grayscale range of each grayscale interval based on the size and grayscale range of the target image, using a preset histogram sorting precision balance model, includes the following steps:
[0027] Determine whether the size of the target image exceeds a set value;
[0028] If the number exceeds the limit, the grayscale range of each grayscale interval is calculated based on the preset number of grayscale intervals; where the preset number of grayscale intervals is 2. n And n is a natural number that is not less than 8;
[0029] If the number of grayscale intervals does not exceed the target image size, the corresponding number of grayscale intervals is calculated based on the target image size, and then the grayscale range of each grayscale interval is calculated based on the number of grayscale intervals.
[0030] In conjunction with the first aspect, in one embodiment, the pixel grayscale data of the optimized floating-point target image is obtained by removing the corresponding percentage of pixel grayscale data before and after the histogram according to a set outlier removal ratio. The outlier removal ratio is calculated by a preset outlier ratio calculation model based on the image entropy information of the target image and historical images of the target image.
[0031] In conjunction with the first aspect, in one embodiment, the outlier removal ratio is calculated by a preset outlier ratio calculation model based on the image entropy information of the target image and its historical images, using the following formula:
[0032] dPercent=M*[1+(SS avg ) / S max ]
[0033] In the formula, dPercent is the outlier removal ratio of the floating-point target image, M is a preset empirical value for the floating-point target image, S is the image entropy of the floating-point target image, and S avg S is the historical average entropy of a floating-point target image. max This represents the historical maximum entropy of the floating-point target image.
[0034] In conjunction with the first aspect, in one embodiment, the step of normalizing the pixel grayscale data of the optimized floating-point target image to a preset target grayscale range and converting it into integer image data to obtain the result image includes the following steps:
[0035] The pixel grayscale data of the optimized floating-point target image is stretched to target grayscale data corresponding to the target grayscale range;
[0036] The abnormal grayscale data that does not belong to the target grayscale range in the target grayscale data are adjusted to obtain the result grayscale data and converted into the corresponding result image.
[0037] Secondly, embodiments of this application provide an optimization device for ink droplet images, employing the following technical solution:
[0038] An apparatus for optimizing ink droplet images, comprising:
[0039] The acquisition module is configured to acquire multiple background images taken under set standard shooting conditions and target images obtained by shooting flying ink droplets under the same conditions.
[0040] The first optimization module is configured to determine the location information and brightness correction coefficient of the fixed defect under the standard shooting conditions based on multiple observed background images; and process the target image using the brightness correction coefficient and the location information of the fixed defect to obtain a transition image.
[0041] The sorting module is configured to convert the integer-type transition image into a floating-point type target image; based on the size and grayscale range of the target image, and through a preset histogram sorting accuracy balance model, determine the number of grayscale intervals and the grayscale range of each grayscale interval for histogram sorting of the pixel grayscale data of the floating-point type target image; according to the number of grayscale intervals, the grayscale range of the grayscale intervals, and the pixel grayscale data of the floating-point type target image, count the number of pixels corresponding to each grayscale interval in the floating-point type target image and form a histogram;
[0042] The second optimization module is configured to remove a percentage of pixel grayscale data before and after the histogram according to a set outlier removal ratio to obtain optimized floating-point target image pixel grayscale data; normalize the optimized floating-point target image pixel grayscale data to a preset target grayscale range and convert it into integer image data to obtain the result image.
[0043] Thirdly, embodiments of this application provide an optimization device for ink droplet images, employing the following technical solution:
[0044] An ink droplet image optimization device includes a processor, a memory, and an ink droplet image optimization program stored in the memory and executable by the processor, wherein when the ink droplet image optimization program is executed by the processor, it implements the steps of the ink droplet image optimization method as described above.
[0045] Fourthly, embodiments of this application provide a storage medium, employing the following technical solution:
[0046] A storage medium storing an optimization program for an ink droplet image, wherein when the optimization program for the ink droplet image is executed by a processor, the steps of the ink droplet image optimization method as described above are implemented.
[0047] The beneficial effects of the technical solutions provided in this application include:
[0048] The method, apparatus, device, and storage medium for optimizing ink droplet images provided in this application firstly utilize multiple background images without ink droplets to predetermine the location information and brightness correction coefficient of fixed defects in the background. After processing the target image with ink droplet image using the location information and brightness correction coefficient of the fixed defects, a transition image with no fixed defects and good brightness uniformity can be obtained. This improves the quality of the transition image and also enables subsequent contrast enhancement operations to be carried out smoothly through the transition image.
[0049] Subsequently, by converting the transition image from a low-grayscale integer image to a higher-grayscale floating-point target image, and then determining the appropriate interval precision for histogram sorting based on the attributes of the target image, the transition image is sorted using a more refined and precise histogram sorting method. Since histogram sorting is faster than traditional numerical comparison-based sorting, high-precision grayscale sorting can be completed more quickly. After grayscale sorting, this application further removes pixel grayscale data of corresponding proportions before and after the histogram sorting by setting a discrete point removal ratio. This yields pixel grayscale data with noise removal. Because each interval within the histogram has high precision, removing discrete points according to the discrete point removal ratio allows for more accurate removal of corresponding proportions of grayscale data, ensuring that the final data can more smoothly and accurately complete the contrast enhancement process of the ink droplet image. Attached Figure Description
[0050] Figure 1 This is a schematic diagram of the overall process of an embodiment of the ink droplet image optimization method of this application;
[0051] Figure 2 This is a flowchart illustrating step S200 in the method for optimizing ink droplet images in this application.
[0052] Figure 3 This is a flowchart illustrating step S700 in the ink droplet image optimization method of this application;
[0053] Figure 4 This is a flowchart illustrating step S800 in the method for optimizing ink droplet images in this application.
[0054] Figure 5 This is a schematic diagram of the functional modules in one embodiment of the ink droplet image optimization device of this application;
[0055] Figure 6 This is a schematic diagram of the hardware structure of the ink droplet image optimization device involved in the embodiments of this application. Detailed Implementation
[0056] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0057] The key point of the invention of the ink droplet image optimization method, apparatus, device and storage medium provided in the embodiments of this application is that, firstly, multiple background images without ink droplets are used to determine the position information and brightness correction coefficient of fixed defects in the background in advance. After processing the target image with ink droplet image using the position information and brightness correction coefficient of fixed defects, a transition image with no fixed defects and good brightness uniformity can be obtained. While improving the quality of the transition image, subsequent contrast enhancement operations can also be smoothly carried out through the transition image.
[0058] Subsequently, by converting the transition image from a low-grayscale integer image to a higher-grayscale floating-point target image, and then determining the appropriate interval precision for histogram sorting based on the attributes of the target image, the transition image is sorted using a more refined and precise histogram sorting method. Since histogram sorting is faster than traditional numerical comparison-based sorting, high-precision grayscale sorting can be completed more quickly. After grayscale sorting, this application further removes pixel grayscale data of corresponding proportions before and after the histogram sorting by setting a discrete point removal ratio. This yields pixel grayscale data with noise removal. Because each interval within the histogram has high precision, removing discrete points according to the discrete point removal ratio allows for more accurate removal of corresponding proportions of grayscale data, ensuring that the final data can more smoothly and accurately complete the contrast enhancement process of the ink droplet image.
[0059] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the ink droplet image optimization method of this application. The ink droplet image optimization method includes:
[0060] S100: Acquire multiple background images taken under the set standard shooting conditions and target images obtained by shooting flying ink droplets under the same conditions;
[0061] Specifically, the shooting conditions for each observation background image and the target image with the flying ink droplet pattern are consistent, both being under the set shooting conditions to ensure that the size and brightness attributes of the background area captured in each image are consistent. As for the shooting conditions, they are determined by technicians according to shooting requirements, and this application does not impose any restrictions here, as long as it ensures that an observation background image and a target image with the ink droplet pattern that can be normally analyzed and processed can be obtained under the shooting conditions.
[0062] S200. Based on multiple observed background images, determine the location information and brightness correction coefficient of fixed defects in the captured image obtained under the standard shooting conditions;
[0063] This setup utilizes multiple background images without ink droplets to pre-determine the location information and brightness correction coefficients of fixed imperfections in the background. This facilitates subsequent processing of fixed imperfections and brightness uniformity issues in the target image containing ink droplets. For details, refer to... Figure 2 In some embodiments, step S200 includes the following steps S210 to S260:
[0064] S210. Based on the multiple observed background images, obtain the mean background image;
[0065] Specifically, this step involves calculating the average grayscale value of each pixel in the background using multiple observed background images, ultimately obtaining a background average image. It's worth noting that in this embodiment, the multiple observed background images are taken consecutively to minimize differences caused by external factors, thus obtaining a background average image that best reflects the true background. In some embodiments provided in this application, the number of observed background images required is 10 to 20 consecutively taken images.
[0066] S220. Based on the background mean image and the set fixed defect detection algorithm, determine the location information of fixed defects in the background; specifically, the fixed defect detection algorithm is a pre-established algorithm that can effectively detect the location of fixed defects in the background mean image, and may vary in different embodiments. For example, in this embodiment, the fixed defect algorithm specifically uses the YOLOv8 algorithm, which includes the following steps S221 to S227 during execution:
[0067] S221. Load model parameters
[0068] S222. Input image BigImg, i.e., the background mean image;
[0069] S223.BigImg is divided into multiple smaller images of 512 pixels each;
[0070] S224.BigImg is divided into multiple smaller images of 512 pixels each;
[0071] S225. Each small image is fed into the YOLOv8 inference network;
[0072] S226. Output the detection results of fixed defects in a single small image, and stitch the detection results of all small images together to form the final detection result;
[0073] S227. Provide the final detection result image and the detection coordinate information of the ink droplets, that is, obtain the location information of the fixed defects in the background.
[0074] After obtaining the location information of the fixed defect in the background, the next step S230 can be executed:
[0075] S230. Based on the location information of the fixed defects, eliminate the fixed defects in the background mean image to obtain a background mean image without fixed defects;
[0076] Specifically, the removal of fixed defects will be based on a pre-set image inpainting algorithm to obtain a defect-free background mean image. This image can then be used to represent the current true brightness state, unaffected by the fixed defects. Different algorithms can be used in different embodiments for image inpainting. For example, in this embodiment, the Navier-Stokes algorithm is used, and the algorithm process includes the following steps:
[0077] S231. Based on the obtained location information of the fixed defect, generate a mask binary image that corresponds to the same region as the location information of the fixed defect;
[0078] S232. Simultaneously feed the mask binary image, the location information of the fixed defects, and the image containing the fixed defects into the Navier-Stokes algorithm.
[0079] S233. Output the image after fixed defect removal.
[0080] After obtaining the mean background image without fixed flaws, step S240 can be performed:
[0081] S240. Determine the brightness distribution information of the background mean image without fixed defects;
[0082] S250. Calculate the brightness reference value of the background of the flying ink droplet observation based on the brightness values of some pixel regions in the brightness distribution information;
[0083] Specifically, since the central region of the image has the best brightness in the captured image during ink droplet observation, in this embodiment, the average brightness value of the 100*100 pixel region in the center of the image without fixed defects will be used as the brightness reference value fCenterMean for the background of flying ink droplet observation. In other embodiments, the brightness quality of different regions in the image can also be selected. At the same time, the size of the region can be confirmed by the technician. When the region is the central region of the image, the size of the region shall not exceed 1 / 10 of the image width.
[0084] S260. Calculate the brightness correction coefficient based on the brightness reference value.
[0085] In this embodiment, step S260 determines the brightness correction coefficient corresponding to each pixel in the target image based on the ratio between the brightness reference value and the brightness of any pixel in the average background image without fixed defects, specifically referring to the following formula:
[0086]
[0087] In the formula, CorrCoe f(x,y) is the brightness correction coefficient corresponding to the pixel with coordinates (x,y) in the target image, fCenterMean is the brightness reference value, and oBgImgClean(x,y) is the brightness of the pixel in the mean background image without fixed defects that is consistent with the position information of the target pixel.
[0088] After determining the location information of the defects and the brightness correction coefficients, the target image can be processed by taking the following steps:
[0089] S300: Process the target image using the brightness correction coefficient and the location information of the fixed defects to obtain a transition image;
[0090] The method for removing fixed defects from the target image based on the location information of the fixed defects is the same as the method for removing fixed defects from the observed background image, and will not be repeated here; however, when processing the target image using the brightness correction coefficient, the following formula is specifically used:
[0091] oDWCorrImg(x,y)=oDWImg(x,y)×CorrCoef(x,y)
[0092] In the formula, oDWCorrImg(x,y) is the brightness of the pixel with coordinates (x,y) in the transition image; oDWImg(x,y) is the brightness of the pixel with coordinates (x,y) in the target image without fixed defects; and CorrCoef(x,y) is the brightness correction coefficient of the pixel.
[0093] After obtaining a transition image with no fixed defects and optimized brightness uniformity, subsequent contrast enhancement steps can be performed, including the following steps:
[0094] S400: Convert the integer-type transition image into a floating-point type target image;
[0095] Specifically, step S400 converts the transition image from low-precision integer image data into a higher-precision floating-point image, such as CV_32F, ensuring more accurate execution in subsequent sorting and outlier removal processes. Specifically, in this embodiment, the transition image is an 8-bit integer image with a grayscale range of 0–255, which will be converted into a 32-bit floating-point target image with a grayscale range of 0.0–255.0 in step S100.
[0096] S500: Based on the size and grayscale range of the target image, the number of grayscale intervals and the grayscale range of each grayscale interval are determined by using a preset histogram sorting accuracy balance model to perform histogram sorting on the pixel grayscale data of the floating-point target image.
[0097] Step S500 determines the appropriate number of grayscale intervals (bins) and the appropriate grayscale range for each grayscale interval before sorting the pixel grayscale data of the target image. This ensures that when removing outliers of the largest or smallest grayscale based on proportion or quantity, the corresponding proportion or quantity of grayscale data to be removed can be found more accurately using histogram sorting. This avoids the difficulty in accurately finding the corresponding number or proportion of data intervals in histogram sorting due to excessively coarse grayscale intervals.
[0098] Specifically, the S500 includes the following steps:
[0099] S510. Determine whether the size of the target image exceeds a set value;
[0100] S520. If the number exceeds the limit, calculate the grayscale range of each grayscale interval based on the preset number of grayscale intervals; wherein, the preset number of grayscale intervals is 2. n And n is a natural number that is not less than 8;
[0101] S530. If it does not exceed the specified value, calculate the corresponding number of grayscale intervals based on the size of the target image, and then calculate the grayscale range of each grayscale interval based on the number of grayscale intervals.
[0102] Steps S510 to S530 can be referenced from the following formulas:
[0103] hist_size = min(2 n , N / 100)bin_width=X / hist_size
[0104] In the formula, hist_size is the number of grayscale intervals, n is a natural number that is not less than 8, N is the size of the target image, bin_width is the grayscale precision of a single grayscale interval, and X is the upper limit of the grayscale range of the target image.
[0105] It can be seen that the number of grayscale intervals gradually increases as the size of the target image increases, until N / 100 exceeds 2. n To avoid excessively low grayscale precision, which would lead to an excessive number of grayscale intervals and consequently increase the storage and computing costs required for subsequent histogram sorting, this application will not increase the number of grayscale intervals and will maintain a value of 2. n In this embodiment, n is preferably 16, or 65536. Ultimately, the number and precision of grayscale intervals can be changed according to the size of the target image, making it more adaptable to images of different sizes, while also ensuring overall computational cost, thus achieving a balance between sorting accuracy and computational cost. In other embodiments, the value of n can be adjusted according to the accuracy requirements and computational cost, and this application does not impose any restrictions on this.
[0106] S600. Based on the number of grayscale intervals, the grayscale range of the grayscale intervals, and the pixel grayscale data of the floating-point target image, count the number of pixels corresponding to each grayscale interval in the floating-point target image and form a histogram.
[0107] Step S600 enables faster interval sorting of a large amount of grayscale data, and the high interval accuracy allows for accurate removal of grayscale data as needed in the future.
[0108] S700: Remove the corresponding percentage of pixel grayscale data before and after the histogram according to the set outlier removal ratio to obtain the optimized floating-point target image pixel grayscale data.
[0109] The set outlier removal ratio is calculated by a preset outlier removal ratio calculation model based on the image entropy information of the target image and its historical images. This allows the model to match the number of outliers to be removed based on the actual image quality. When the image quality is high (i.e., less noise), the grayscale data removal ratio can be minimized to avoid excessive removal of normal pixels within the ink droplet image. Conversely, when the image quality is low (i.e., more noise), a higher grayscale data removal ratio can be used to remove as many outliers as possible, ensuring a significant effect when subsequent image contrast enhancement is performed. The specific formula used is as follows:
[0110] dPercent=M*[1+(SS avg ) / S max ]
[0111] In the formula, dPercent is the outlier removal ratio of the floating-point target image, M is a preset empirical value for the floating-point target image, S is the image entropy of the floating-point target image, and Savg S is the historical average entropy of a floating-point target image. max This represents the historical maximum entropy of the floating-point target image.
[0112] To further ensure the ability to quickly remove outliers from the histogram according to the specified pixel grayscale data, refer to... Figure 3 Step S700 further includes the following steps:
[0113] S710. Based on the histogram, calculate the cumulative distribution function corresponding to each gray level in the histogram;
[0114] Specifically, each gray level in the histogram represents a certain gray value, and the purpose of step S400 is to quantize the number of image pixels below a certain brightness value. The specific value corresponding to each gray level is the upper limit of the gray level in each gray range. The following formula is used to calculate the cumulative distribution function corresponding to each gray level in the histogram:
[0115] C(i) = C(i-1) + H(i),
[0116] In the formula, C(i) is the cumulative distribution function of the i-th gray level in the histogram, and H(i) is the number of pixels corresponding to the i-th gray level interval in the histogram.
[0117] S720. Normalize each of the cumulative distribution functions to obtain the percentage of pixels corresponding to each gray level;
[0118] In step S720, the number of pixels below a certain brightness value is converted into the proportion of pixels below that brightness value to the total number of pixels, providing a basis for the subsequent stage of removing extreme outliers. This embodiment obtains the pixel count proportion corresponding to each gray level by normalizing each of the cumulative distribution functions using the following algorithm:
[0119] CDF(i) = C(i) / C(hist_size)
[0120] In the formula, CDF(i) is the percentage of pixels at the i-th gray level in the histogram, and C(hist_size) is the total number of pixels involved in the histogram.
[0121] S800: Normalize the pixel grayscale data of the optimized floating-point target image to a preset target grayscale range and convert it into integer image data to obtain the result image.
[0122] By step S800, after removing the grayscale data of the corresponding outliers before and after the pixel grayscale data, the remaining data will more effectively represent the grayscale situation of the ink droplet and the background in the ink droplet image. At this time, by further mapping these data to a larger target grayscale range, the grayscale of the pixels involved in the ink droplet and the pixels involved in the image background can be further separated, which means that the contrast between the ink droplet and the background in the ink droplet image is enhanced.
[0123] Reference Figure 4 Specifically, step S800 in this embodiment includes the following steps:
[0124] S810. Stretch the pixel grayscale data of the optimized floating-point target image into target grayscale data corresponding to the target grayscale range;
[0125] Specifically, in this embodiment, the optimized floating-point target image's pixel grayscale data will be normalized to the grayscale range of [0, 255], using the following formula:
[0126] dst(x,y)=(src(x,y)-new_min)*T max / (new_max-new_min)
[0127] In the formula, src(x,y) is the grayscale data of the pixel at coordinates (x,y) in the optimized floating-point target image, dst(x,y) is the stretched grayscale data of the pixel at coordinates (x,y) in the optimized floating-point target image, new_min is the minimum grayscale value in the pixel grayscale data of the optimized floating-point target image, new_max is the maximum grayscale value in the pixel grayscale data of the optimized floating-point target image, and T max This is the upper limit of the target grayscale range, which is 255.
[0128] S820. Adjust the abnormal grayscale data in the target grayscale data that does not belong to the target grayscale range to obtain the result grayscale data and convert it into the corresponding result image.
[0129] Specifically, during step S820, this embodiment adjusts abnormal grayscale data in the target grayscale data that are larger than the target grayscale range to the upper limit of the target grayscale range, and adjusts abnormal grayscale data in the target grayscale data that are smaller than the target grayscale range to the lower limit of the target grayscale range, thus obtaining the result grayscale data. This process eliminates obviously erroneous data that occurs during the data conversion process, which ultimately affects the quality of the resulting image. Subsequently, the result grayscale data can be converted into integer grayscale data to obtain the resulting image with enhanced contrast between the ink droplets and the background.
[0130] Secondly, embodiments of this application also provide an apparatus for optimizing ink droplet images.
[0131] In one embodiment, reference is made to Figure 5 , Figure 5 This is a functional module diagram of an embodiment of the ink droplet image optimization device of this application. Figure 5 As shown, the device for optimizing ink droplet images includes:
[0132] The acquisition module is configured to acquire multiple background images taken under set standard shooting conditions and target images obtained by shooting flying ink droplets under the same conditions.
[0133] The first optimization module is configured to determine the location information and brightness correction coefficient of the fixed defect under the standard shooting conditions based on multiple observed background images; and process the target image using the brightness correction coefficient and the location information of the fixed defect to obtain a transition image.
[0134] The sorting module is configured to convert the integer-type transition image into a floating-point type target image; based on the size and grayscale range of the target image, and through a preset histogram sorting accuracy balance model, determine the number of grayscale intervals and the grayscale range of each grayscale interval for histogram sorting of the pixel grayscale data of the floating-point type target image; according to the number of grayscale intervals, the grayscale range of the grayscale intervals, and the pixel grayscale data of the floating-point type target image, count the number of pixels corresponding to each grayscale interval in the floating-point type target image and form a histogram;
[0135] The second optimization module is configured to remove a percentage of pixel grayscale data before and after the histogram according to a set outlier removal ratio to obtain optimized floating-point target image pixel grayscale data; normalize the optimized floating-point target image pixel grayscale data to a preset target grayscale range and convert it into integer image data to obtain the result image.
[0136] The functions of each module in the above-mentioned ink droplet image optimization device correspond to the steps in the above-mentioned ink droplet image optimization method embodiment, and their functions and implementation processes will not be described in detail here.
[0137] Thirdly, embodiments of this application provide an ink droplet image optimization device, which can be a device with data processing capabilities such as a personal computer (PC), a laptop computer, or a server.
[0138] Reference Figure 6 , Figure 6This is a schematic diagram of the hardware structure of the ink droplet image optimization device involved in the embodiments of this application. In the embodiments of this application, the ink droplet image optimization device may include a processor, a memory, a communication interface, and a communication bus.
[0139] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.
[0140] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting internal devices within the ink droplet image optimization device, as well as interfaces used for interconnecting the ink droplet image optimization device with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.
[0141] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0142] The processor can be a general-purpose processor, which can call the optimization program for the ink droplet image stored in the memory and execute the ink droplet image optimization method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the ink droplet image optimization program is called can be referred to in the various embodiments of the ink droplet image optimization method of this application, and will not be repeated here.
[0143] Those skilled in the art will understand that Figure 6 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0144] Fourthly, embodiments of this application also provide a storage medium.
[0145] The present application stores an optimization program for an ink droplet image on a storage medium, wherein when the optimization program for the ink droplet image is executed by a processor, the steps of the ink droplet image optimization method described above are implemented.
[0146] The method implemented when the ink droplet image optimization procedure is executed can be referred to in various embodiments of the ink droplet image optimization method of this application, and will not be repeated here.
[0147] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0148] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0149] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0150] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0151] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0152] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0153] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for optimizing ink droplet images, characterized in that, It includes the following steps: Acquire multiple background images taken under set standard shooting conditions and target images obtained by shooting flying ink droplets under the same conditions; Based on multiple observed background images, determine the location information and brightness correction coefficient of the fixed defects under the standard shooting conditions; The target image is processed using the brightness correction coefficient and the location information of the fixed defects to obtain a transition image; Convert the integer-type transition image into a floating-point type target image; Based on the size and grayscale range of the target image, a preset histogram sorting accuracy balance model is used to determine the number of grayscale intervals and the grayscale range of each grayscale interval for histogram sorting of the pixel grayscale data of the floating-point target image. Based on the number of grayscale intervals, the grayscale range of the grayscale intervals, and the pixel grayscale data of the floating-point target image, the number of pixels corresponding to each grayscale interval in the floating-point target image is counted and a histogram is formed. The pixel grayscale data of the optimized floating-point target image are obtained by removing the corresponding percentage of pixel grayscale data before and after the histogram according to the set outlier removal ratio. The pixel grayscale data of the optimized floating-point target image is normalized to a preset target grayscale range and then converted into integer image data to obtain the result image.
2. The method for optimizing ink droplet images as described in claim 1, characterized in that, The step of determining the location information and brightness correction coefficient of fixed defects under the standard shooting conditions based on multiple observed background images includes the following steps: Based on multiple observed background images, a mean background image is obtained; Based on the background mean image and the set fixed defect detection algorithm, the location information of fixed defects in the background is determined; Based on the location information of the fixed defects, the fixed defects in the background mean image are eliminated to obtain a background mean image without fixed defects; Determine the brightness distribution information of the background mean image without fixed defects; Calculate the brightness reference value of the background of the flying ink droplet observation based on the brightness values of some pixel regions in the brightness distribution information; The brightness correction coefficient is calculated based on the brightness reference value.
3. The method for optimizing ink droplet images as described in claim 2, characterized in that, In the calculation of the brightness correction coefficient based on the brightness reference value, The brightness correction coefficient for each pixel in the target image is determined based on the ratio between the brightness reference value and the brightness of any pixel in the mean background image without fixed defects.
4. The method for optimizing ink droplet images as described in claim 1, characterized in that, The process of determining the number of grayscale intervals and the grayscale range of each grayscale interval for histogram sorting of the pixel grayscale data of the floating-point target image based on the size and grayscale range of the target image, using a preset histogram sorting accuracy balance model, includes the following steps: Determine whether the size of the target image exceeds a set value; If the number exceeds the limit, the grayscale range of each grayscale interval is calculated based on the preset number of grayscale intervals; where the preset number of grayscale intervals is 2. n And n is a natural number that is not less than 8; If the number of grayscale intervals does not exceed the target image size, the corresponding number of grayscale intervals is calculated based on the target image size, and then the grayscale range of each grayscale interval is calculated based on the number of grayscale intervals.
5. The method for optimizing ink droplet images as described in claim 1, characterized in that, The process involves removing a percentage of pixel grayscale data from the histogram before and after the target image based on a set outlier removal ratio, resulting in optimized floating-point target image pixel grayscale data. The outlier removal ratio is calculated by a preset outlier ratio calculation model based on the image entropy information of the target image and its historical images.
6. The method for optimizing ink droplet images as described in claim 5, characterized in that, The outlier removal ratio is calculated by a preset outlier ratio calculation model based on the image entropy information of the target image and its historical images, using the following formula: dPercent=M*[1+(S-S avg ) / S max ] In the formula, dPercent is the outlier removal ratio of the floating-point target image, M is a preset empirical value for the floating-point target image, S is the image entropy of the floating-point target image, and S avg S is the historical average entropy of a floating-point target image. max This represents the historical maximum entropy of the floating-point target image.
7. The method for optimizing ink droplet images as described in claim 1, characterized in that, The process of normalizing the pixel grayscale data of the optimized floating-point target image to a preset target grayscale range and converting it into integer image data to obtain the result image includes the following steps: The pixel grayscale data of the optimized floating-point target image is stretched to target grayscale data corresponding to the target grayscale range; The abnormal grayscale data that does not belong to the target grayscale range in the target grayscale data are adjusted to obtain the result grayscale data and converted into the corresponding result image.
8. An optimization device for ink droplet images, characterized in that, It includes: The acquisition module is configured to acquire multiple background images taken under set standard shooting conditions and target images obtained by shooting flying ink droplets under the same conditions. The first optimization module is configured to determine the location information and brightness correction coefficient of the fixed imperfection under the standard shooting conditions based on multiple observed background images; The target image is processed using the brightness correction coefficient and the location information of the fixed defects to obtain a transition image; The sorting module is configured to convert the integer-type transition image into a floating-point type target image; based on the size and grayscale range of the target image, and through a preset histogram sorting accuracy balance model, determine the number of grayscale intervals and the grayscale range of each grayscale interval for histogram sorting of the pixel grayscale data of the floating-point type target image; according to the number of grayscale intervals, the grayscale range of the grayscale intervals, and the pixel grayscale data of the floating-point type target image, count the number of pixels corresponding to each grayscale interval in the floating-point type target image and form a histogram; The second optimization module is configured to remove a percentage of pixel grayscale data before and after the histogram according to a set outlier removal ratio to obtain optimized floating-point target image pixel grayscale data; normalize the optimized floating-point target image pixel grayscale data to a preset target grayscale range and convert it into integer image data to obtain the result image.
9. An optimization device for ink droplet images, characterized in that, The ink droplet image optimization device includes a processor, a memory, and an ink droplet image optimization program stored in the memory and executable by the processor, wherein when the ink droplet image optimization program is executed by the processor, it implements the steps of the ink droplet image optimization method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores an optimization program for an ink droplet image, wherein when the optimization program for the ink droplet image is executed by a processor, the steps of the ink droplet image optimization method as described in any one of claims 1 to 7 are implemented.