Ink droplet image contrast enhancement method and device, equipment and storage medium
By using a histogram sorting accuracy balance model and image entropy calculation, pixel noise in ink droplet images can be removed quickly, solving the problem of high time complexity in existing technologies and achieving efficient and accurate ink droplet image contrast enhancement.
Patent Information
- Application Number
- CN202511118418.7
- 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 techniques for removing pixel noise in high-resolution ink droplet images have high time complexity, which cannot meet real-time requirements and affects the rapid completion of ink droplet observation.
A histogram sorting accuracy balance model is adopted. By converting integer images to floating-point images, determining appropriate gray-level intervals and ranges, calculating the proportion of outliers using image entropy values, removing pixel noise, and finally normalizing the data into integer images.
It achieves efficient and accurate contrast enhancement of ink droplet images, improves the speed and accuracy of ink droplet observation, and meets the requirements of real-time processing.
Smart Images

Figure CN120997105A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of inkjet printing flying ink droplet observation technology, and particularly relates to an ink droplet image contrast enhancement method and device, equipment and a storage medium. BACKGROUND
[0002] In the field of inkjet printing, microfluidic control or other technologies involving micro-droplet generation and observation, it is crucial to accurately obtain the morphology, size, speed and other parameters of the ink droplet. For this purpose, high-speed cameras and other imaging devices are often used to capture and analyze flying ink droplets. Since the ink droplets are in a high-speed flight state, the ink droplet edge gray scale is often close to the background, so the existing technology often needs to improve the contrast of the captured ink droplet image to more clearly distinguish the difference between the ink droplet and the background.
[0003] Currently, when improving the contrast of the ink droplet image, it is necessary to exclude the pixel noise in the ink droplet image, and then stretch and enhance the contrast. In order to remove the pixel noise in the ink droplet image, the gray scale of the pixels in the ink droplet image needs to be sorted first, so as to remove a certain proportion of pixels with the largest gray scale, and to remove the gray outliers, i.e. pixel noise.
[0004] However, in the related art, the traditional sorting method based on numerical size is often used to remove outliers, and the time complexity is O(Nlog N), which is too time-consuming for high-resolution images (such as 4K), and cannot meet the real-time requirements. SUMMARY
[0005] The present application provides an ink droplet image contrast enhancement method, device, equipment and storage medium, which can solve the problem that the existing technology cannot quickly complete the focusing of the observation camera and the flying ink droplet.
[0006] In a first aspect, the present application provides an ink droplet image contrast enhancement method, which adopts the following technical solution:
[0007] An ink droplet image contrast enhancement method, comprising the following steps:
[0008] Obtaining a floating-point target image corresponding to an integer-point target image;
[0009] Based on the size of the target image and the gray scale range of the target image, determining the number of gray scale intervals and the gray scale range of each gray scale interval for histogram sorting of the pixel gray scale data of the floating-point target image through a preset histogram sorting precision balance model;
[0010] According to the number of gray scale intervals, the gray scale range of the gray scale intervals, and the pixel gray scale data of the floating-point target image, the number of pixels corresponding to each gray scale interval in the floating-point target image is counted and a histogram is formed;
[0011] According to the histogram, the cumulative distribution function corresponding to each gray scale in the histogram is calculated;
[0012] The cumulative distribution functions are normalized to obtain the proportion of the number of pixels corresponding to each gray scale;
[0013] According to a preset outlier proportion calculation model, the outlier removal proportion of the floating-point target image is determined; wherein the outlier proportion calculation model is related to the image entropy value of the target image and the image entropy values of a plurality of previous target images;
[0014] According to the outlier removal proportion, the pixel gray scale data corresponding to the percentage before and after the histogram is removed, and the pixel gray scale data of the optimized floating-point target image is obtained;
[0015] The pixel gray scale data of the optimized floating-point target image is normalized to a preset target gray scale range and converted into integer type image data to obtain a result image.
[0016] In combination with the first aspect, in an implementation, the determination of the number of gray scale intervals and the gray scale range of each gray scale interval for histogram sorting of the pixel gray scale data of the floating-point target image based on the size of the target image and through a preset histogram sorting precision balance model includes the following steps:
[0017] It is judged whether the size of the target image exceeds a set value;
[0018] If it exceeds, the gray scale range of each gray scale interval is calculated according to a preset number of gray scale intervals; wherein the preset number of gray scale intervals is 2 n , and n is a natural number not less than 8;
[0019] If it does not exceed, the corresponding number of gray scale intervals is calculated based on the size of the target image, and the gray scale range of each gray scale interval is calculated according to the number of gray scale intervals.
[0020] In combination with the first aspect, in an implementation, the determination of the outlier removal proportion of the floating-point target image according to a preset outlier proportion calculation model includes the following steps:
[0021] The historical image of the floating-point target image is obtained, and the historical average entropy and the historical maximum entropy of the floating-point target image are determined according to the historical image;
[0022] According to the image entropy, the historical average entropy, the historical maximum entropy of the floating-point target image and a preset outlier ratio calculation model, the outlier removal ratio of the floating-point target image is determined.
[0023] In combination with the first aspect, in an implementation, the outlier removal ratio of the floating-point target image is determined according to the preset outlier ratio calculation model, and the following formula is adopted:
[0024] dPercent=M*[1+(S-S avg ) / S max ]
[0025] In the formula, dPercent is the outlier removal ratio of the floating-point target image, M is a preset empirical value related to the floating-point target image, S is the image entropy of the floating-point target image, S avg is the historical average entropy of the floating-point target image, and S max is the historical maximum entropy of the floating-point target image.
[0026] In combination with the first aspect, in an implementation, the pixel gray data of the optimized floating-point target image is normalized to a preset target gray range and converted into integer type image data to obtain a result image, including the following steps:
[0027] The pixel gray data of the optimized floating-point target image is stretched to target gray data corresponding to the target gray range.
[0028] The abnormal gray data in the target gray data that does not belong to the target gray range is adjusted to obtain result gray data and convert it into corresponding result image.
[0029] In combination with the first aspect, in an implementation, the pixel gray data of the optimized floating-point target image is mapped to target gray data corresponding to the target gray range, including the following steps:
[0030] The difference between the gray data of any pixel point in the optimized floating-point target image and the minimum gray data in the pixel gray data of the optimized floating-point target image is determined.
[0031] The difference is weighted calculated with the upper limit of the gray range of the target gray range, and the settlement result is proportionally converted with the difference between the minimum gray data and the maximum gray data in the pixel gray data of the optimized floating-point target image to obtain the target gray data corresponding to the target gray range of each pixel point.
[0032] In combination with the first aspect, in an implementation manner, the adjusting the abnormal gray data not belonging to the target gray range in the target gray data to obtain result gray data and converting the result gray data into a corresponding result image comprises the following steps:
[0033] adjusting the abnormal gray data greater than the target gray range in the target gray data to an upper limit value of the gray range of the target gray range, and adjusting the abnormal gray data less than the target gray range in the target gray data to a lower limit value of the gray range of the target gray range to obtain result gray data;
[0034] converting the result gray data into integer type gray data and obtaining a result image.
[0035] In a second aspect, the embodiments of the present application provide a contrast enhancement device of ink drop image, which adopts the following technical scheme:
[0036] A contrast enhancement device of ink drop image comprises:
[0037] an image conversion module configured to acquire a floating-point target image corresponding to an integer target image;
[0038] an ordering module configured to determine, based on the size of the target image and the gray range of the target image, the number of gray intervals and the gray range of each gray interval for histogram ordering of the pixel gray data of the floating-point target image through a preset histogram ordering precision balance model; and according to the number of gray intervals, the gray range of each gray interval and the pixel gray data of the floating-point target image, count the number of pixels corresponding to each gray interval in the floating-point target image and form a histogram;
[0039] an optimization module configured to calculate, according to the histogram, the cumulative distribution function corresponding to each gray scale in the histogram; normalize each cumulative distribution function to obtain the proportion of the number of pixels corresponding to each gray scale; determine the outlier removal proportion of the floating-point target image according to a preset outlier proportion calculation model, wherein the outlier proportion calculation model is related to the image entropy value of the target image and the image entropy values of a plurality of previous target images; and remove the corresponding percentage of pixel gray data before and after the histogram according to the outlier removal proportion to obtain the pixel gray data of the optimized floating-point target image;
[0040] a contrast enhancement module configured to normalize the pixel gray data of the optimized floating-point target image to a preset target gray range and convert the pixel gray data into integer image data to obtain a result image.
[0041] In a third aspect, an ink drop image contrast enhancement device is provided in embodiments of the present application, which adopts the following technical scheme:
[0042] An ink drop image contrast enhancement device, comprising a processor, a memory, and an ink drop image contrast enhancement program stored in the memory and executable by the processor, wherein the ink drop image contrast enhancement program, when executed by the processor, implements the steps of the ink drop image contrast enhancement method as described above.
[0043] In a fourth aspect, a storage medium is provided in embodiments of the present application, which adopts the following technical scheme:
[0044] A storage medium, having an ink drop image contrast enhancement program stored thereon, wherein the ink drop image contrast enhancement program, when executed by a processor, implements the steps of the ink drop image contrast enhancement method as described above.
[0045] The technical scheme provided in embodiments of the present application has the following beneficial effects:
[0046] The ink drop image contrast enhancement method, device, equipment and storage medium provided by the present application firstly convert the target image from a whole point type image with low gray scale precision to a floating point type target image with higher gray scale precision, and then determine the appropriate interval precision for histogram sorting based on the attributes of the target image, so as to realize the histogram sorting of the target image in a more delicate and accurate sorting manner. Since the histogram sorting is relatively faster than the traditional numerical size comparison sorting manner, the high-precision gray scale sorting can be completed more quickly. After the gray scale sorting is completed, the subsequent application further determines the appropriate discrete point removal ratio, and removes the pixel gray scale data corresponding to the front and rear ratios in the histogram sorting, so as to obtain the pixel gray scale data after noise point removal. Since each interval in the histogram has high precision, the removal of the corresponding ratio of gray scale data can be more accurately completed when the discrete points are removed according to the discrete point removal ratio, so as to ensure that the final data can more smoothly and accurately complete the ink drop image contrast enhancement process. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 It is a whole flowchart of an embodiment of the ink drop image contrast enhancement method of the present application;
[0048] Figure 2 It is a flowchart of step S600 in the ink drop image contrast enhancement method of the present application;
[0049] Figure 3 It is a functional module diagram in an embodiment of the ink drop image contrast enhancement device of the present application;
[0050] Figure 4 A hardware structure diagram of the ink drop image contrast enhancement device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to enable personnel in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0052] The ink drop image contrast enhancement method, device, equipment and storage medium provided by the embodiment of the present application, the focus method, device, equipment and storage medium for observing flying ink drops provided by the present application, utilize histogram sorting to achieve fast completion of pixel gray scale sorting in the target image, and by first converting the target image into a higher-precision floating-point image, and determining the gray scale interval of the histogram sorting to a high-precision gray scale interval that matches the target image properties, the completed sorting histogram is more delicate in each gray scale interval, and when removing outliers in the pixels, the required removed pixel points can be better determined according to the actual required removed outlier ratio, ensuring more accurate removal of pixel noise in the target image, and finally achieving more efficient and accurate contrast enhancement of the target image, helping to more quickly and accurately carry out ink drop observation.
[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0054] In a first aspect, the embodiment of the present application provides an ink drop image contrast enhancement method.
[0055] In an embodiment, with reference to Figure 1 , Figure 1 A flowchart of the first embodiment of the ink drop image contrast enhancement method of the present application. The ink drop image contrast enhancement method comprises:
[0056] S100, obtaining a floating-point target image corresponding to an integer-point target image;
[0057] Through step S100, the target image is converted from integer image data with low precision value to floating point image with more bits and higher precision, such as CV_32F, so as to ensure that the subsequent sorting and outlier removal process can be performed more accurately. Specifically, the target image in this embodiment is an 8-bit integer image, and the corresponding gray scale range is 0-255. The target image will be converted to a 32-bit floating point target image in step S100, and the gray scale range is 0.0-255.0.
[0058] S200, based on the size of the target image, the gray scale range of the target image, and the preset histogram sorting precision balance model, the number of gray scale intervals for histogram sorting of the pixel gray scale data of the floating point target image is determined, and the gray scale range of each gray scale interval is determined.
[0059] Through step S200, the appropriate number of gray scale intervals bins and the appropriate gray scale range of each gray scale interval in the histogram sorting are determined before sorting the pixel gray scale data of the target image, so that the corresponding proportion or quantity of the gray scale data to be removed can be found more accurately by using the histogram sorting when removing the outliers of the maximum gray scale or the minimum gray scale according to the proportion or the quantity in the subsequent process, and the problem that it is difficult to find the data interval of the corresponding quantity or the corresponding proportion in the histogram sorting due to the coarse gray scale interval is avoided.
[0060] Specifically, step S200 includes the following steps:
[0061] S210, determining whether the size of the target image exceeds a set value;
[0062] S220, if it exceeds, calculating the gray scale range of each gray scale interval according to the preset number of gray scale intervals; wherein the preset number of gray scale intervals is 2 n , and n is a natural number not less than 8;
[0063] S230, if it does not exceed, calculating the corresponding number of gray scale intervals based on the size of the target image, and then calculating the gray scale range of each gray scale interval according to the number of gray scale intervals.
[0064] The specific calculation process can refer to the following formula:
[0065] hist_size=min(2 n , N / 100) bin_width=X / hist_size
[0066] In the formula, hist_size is the number of gray scale intervals, n is a natural number not less than 8, N is the size of the target image, bin_width is the gray scale precision of a single gray scale interval, and X is the upper limit of the gray scale range of the target image.
[0067] It can be seen that the number of gray scale intervals will gradually increase as the size of the target image increases until N / 100 exceeds 2 n To avoid too small gray scale precision, resulting in too many gray scale intervals affecting the subsequent histogram sorting, more storage and computing costs are required, the gray scale number of the present application will not be increased, and the value will be kept at 2 n In the present embodiment, n is preferably 16, i.e. 65536. Ultimately, the number and precision of gray scale intervals can change with the size of the target image, making it more suitable for images of different sizes, while also ensuring overall computing cost, balancing sorting precision and computing cost. In other embodiments, the value of n can be adjusted according to the precision requirement and computing cost, which is not limited in the present application.
[0068] S300, according to the number of gray scale intervals, the gray scale range of the gray scale interval and the pixel gray scale data of the floating point target image, counting the number of pixels corresponding to each gray scale interval in the floating point target image and forming a histogram;
[0069] Through step S300, a large number of gray scale data can be sorted in a faster way, and the high interval precision can also be more accurate when removing part of the gray scale data in the subsequent process.
[0070] S400, according to the histogram, calculating the cumulative distribution function corresponding to each gray scale in the histogram;
[0071] Specifically, each gray scale in the histogram is a certain gray scale value, and the purpose of step S400 is to quantify the number of image pixels below a certain brightness value, and the specific value corresponding to each gray scale is the upper limit of the gray scale interval. When calculating the cumulative distribution function corresponding to each gray scale in the histogram, the following formula is used:
[0072] C(i) = C(i-1) + H(i),
[0073] Where C(i) is the cumulative distribution function of the i-th gray scale in the histogram, and H(i) is the number of pixel points corresponding to the i-th gray scale interval in the histogram.
[0074] S500, normalizing each of the cumulative distribution functions to obtain the proportion of the number of pixels corresponding to each gray scale;
[0075] By step S500, the number of pixels below a certain brightness value is converted into the proportion of pixels below a certain brightness value in the total number, providing a basis for the subsequent stage of removing extreme outliers. The present embodiment normalizes each of the cumulative distribution functions by the following algorithm to obtain the proportion of pixel number corresponding to each gray scale:
[0076] CDF(i) = C(i) / C(hist_size)
[0077] In the formula, CDF(i) is the proportion of pixel number of the i-th gray scale in the histogram, and C(hist_size) is the number of all pixels involved in the histogram.
[0078] S600, according to a preset outlier proportion calculation model, determine the outlier removal proportion of the floating-point target image; wherein, the outlier proportion calculation model is related to the image entropy value of the target image and the image entropy values of the previous multiple target images;
[0079] In this way, the number of outliers that need to be removed in the subsequent stage can be matched according to the actual quality of the image, and then when the image quality is high, i.e. the noise is less, the proportion of gray data removal can be minimized to avoid removing too many normal pixels in the ink drop image, and when the image quality is low, i.e. the noise is more, a higher proportion of gray data removal can be used to remove as many outliers as possible to ensure that the subsequent contrast enhancement of the image has a significant effect.
[0080] Specifically, referring to Figure 2 , step S600 includes the following steps in the present embodiment:
[0081] S610, obtain the history image of the floating-point target image, and determine the history average entropy and the history maximum entropy of the floating-point target image according to the history image;
[0082] S620, according to the image entropy, the history average entropy, the history maximum entropy of the floating-point target image and the preset outlier proportion calculation model, determine the outlier removal proportion, specifically using the following formula:
[0083] dPercent = M * [1 + (S - S avg ) / S max ]
[0084] In the formula, dPercent is the outlier removal proportion of the floating-point target image, M is a preset experience value related to the floating-point target image, S is the image entropy of the floating-point target image, S avg is the history average entropy of the floating-point target image, and S max is the history maximum entropy of the floating-point target image.
[0085] S700, removing pixel gray data corresponding to a percentage of the front and back of the histogram according to the outlier removal ratio, to obtain pixel gray data of the optimized floating-point target image;
[0086] S800, normalizing the pixel gray data of the optimized floating-point target image to a preset target gray range, and converting it into integer type image data to obtain a result image.
[0087] Through step S800, after removing the gray data corresponding to the outliers in front of and behind the pixel gray data, the remaining data will more effectively represent the gray situation of the ink droplets in the ink droplet image and the background. At this time, further mapping these data to a larger target gray range can further separate the pixel gray of the ink droplets involved from the pixel gray of the image background, that is, the contrast between the ink droplets and the background in the ink droplet image is enhanced.
[0088] Specifically, step S800 in this embodiment includes the following steps:
[0089] S810, stretching the pixel gray data of the optimized floating-point target image to target gray data corresponding to the target gray range, specifically including the following steps:
[0090] S811, determining the difference between the gray data of any pixel point in the optimized floating-point target image and the minimum gray data in the pixel gray data of the optimized floating-point target image;
[0091] S812, weighting the difference with the upper limit of the gray range of the target gray range, and then proportionally converting the settlement result with the difference between the minimum gray and the maximum gray in the pixel gray data of the optimized floating-point target image, to obtain target gray data corresponding to the target gray range for each pixel point
[0092] In this embodiment, the pixel gray data of the optimized floating-point target image will be normalized to a gray range of [0, 255], specifically using the following formula:
[0093] dst(x, y) = (src(x, y) - new_min) * T max / (new_max - new_min)
[0094] In the formula, src(x, y) is the gray data of the pixel point with coordinates (x, y) in the optimized floating-point target image, dst(x, y) is the gray data of the pixel point with coordinates (x, y) in the optimized floating-point target image after stretching, new_min is the minimum gray in the pixel gray data of the optimized floating-point target image, new_max is the maximum gray in the pixel gray data of the optimized floating-point target image, T max is the upper limit of the gray of the target gray range, that is, 255.
[0095] S820, adjusting the abnormal gray data in the target gray data that does not belong to the target gray range to obtain result gray data and convert the result gray data into a corresponding result image.
[0096] Specifically, in the execution process of step S820, the embodiment adjusts the abnormal gray data greater than the target gray range in the target gray data to the upper limit value of the gray of the target gray range, and adjusts the abnormal gray data less than the target gray range in the target gray data to the lower limit value of the gray of the target gray range to obtain result gray data, so as to eliminate the obviously erroneous data appearing in the data conversion process and finally affect the quality of the subsequent result image. Subsequently, the result gray data can be converted into integer gray data and a result image with enhanced contrast between ink droplets and background is obtained.
[0097] In a second aspect, the embodiment of the present application further provides a contrast enhancement device of an ink droplet image.
[0098] In an embodiment, with reference to Figure 3 , Figure 3 is a functional module schematic diagram of an embodiment of the contrast enhancement device of the ink droplet image of the present application. As shown in Figure 3 , the contrast enhancement device of the ink droplet image comprises:
[0099] An image conversion module configured to obtain a floating-point target image corresponding to an integer target image;
[0100] An ordering module configured to determine the number of gray intervals and the gray range of each gray interval for histogram ordering of the pixel gray data of the floating-point target image based on the size of the target image and the gray range of the target image through a preset histogram ordering precision balance model, and to count the number of pixels corresponding to each gray interval in the floating-point target image and form a histogram according to the number of gray intervals, the gray range of the gray intervals, and the pixel gray data of the floating-point target image.
[0101] The optimization module is configured to calculate, according to the histogram, a cumulative distribution function corresponding to each gray scale in the histogram; normalize each cumulative distribution function to obtain a proportion of pixel numbers corresponding to each gray scale; determine a removal proportion of outliers of the floating-point target image according to a preset outlier proportion calculation model; wherein the outlier proportion calculation model is related to an image entropy value of the target image and image entropy values of previous target images; remove pixel gray data corresponding to a percentage before and after the histogram according to the removal proportion of outliers, to obtain pixel gray data of an optimized floating-point target image;
[0102] The contrast enhancement module is configured to normalize the pixel gray data of the optimized floating-point target image to a preset target gray scale range, and convert the pixel gray data into integer-type image data to obtain a result image.
[0103] The functions of each module in the contrast enhancement device for the ink droplet image correspond to the steps in the contrast enhancement method for the ink droplet image, and the functions and implementation processes will not be repeated here.
[0104] In a third aspect, the embodiments of the present application provide a contrast enhancement device for an ink droplet image. The contrast enhancement device for the ink droplet image can be a personal computer (PC), a notebook computer, a server, or other devices with data processing functions.
[0105] Reference Figure 4 , Figure 4 is a hardware structure diagram of the contrast enhancement device for the ink droplet image involved in the embodiments of the present application. In the embodiments of the present application, the contrast enhancement device for the ink droplet image can include a processor, a memory, a communication interface, and a communication bus.
[0106] The communication bus can be of any type, used to interconnect the processor, the memory, and the communication interface.
[0107] The communication interface includes an input / output (I / O) interface, a physical interface, and a logical interface, and other interfaces used to interconnect devices inside the contrast enhancement device for the ink droplet image, and interfaces used to interconnect the contrast enhancement device for the ink droplet image with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber interface, an ATM interface, etc.; the user device can be a display (Display), a keyboard (Keyboard), etc.
[0108] The 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), and the like.
[0109] The processor can be a general-purpose processor, which can invoke a contrast enhancement program of the ink drop image stored in the memory and execute the contrast enhancement method of the ink drop image provided by the embodiments of the present application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the contrast enhancement program of the ink drop image is invoked can refer to the embodiments of the contrast enhancement method of the ink drop image of the present application, which will not be described here.
[0110] Those skilled in the art can understand that the hardware structure shown in the above-mentioned embodiments is not a limitation of the present application, and can include more or less components than the drawings, or combine certain components, or different component arrangements. Figure 4
[0111] In a fourth aspect, the embodiments of the present application further provide a storage medium.
[0112] The storage medium of the present application stores a contrast enhancement program of the ink drop image, wherein when the contrast enhancement program of the ink drop image is executed by the processor, the steps of the contrast enhancement method of the ink drop image as described above are implemented.
[0113] The method implemented when the contrast enhancement program of the ink drop image is executed can refer to the embodiments of the contrast enhancement method of the ink drop image of the present application, which will not be described here.
[0114] It should be noted that the above-mentioned sequence number of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments.
[0115] The terms "comprise", "comprising", "include", "including", "have" and "having" and any variations thereof in the specification and in the claims are intended to cover both the express and implicit meaning of the terms. For example, the process, method, system, product or apparatus that includes a series of steps or units is not limited to the listed steps or units but can optionally also include other steps or units not listed. The terms "first", "second" and "third" and the like are used to distinguish different objects and are not limited to the order of precedence. The terms "first", "second" and "third" and the like are used to distinguish different objects and are not limited to the order of precedence.
[0116] In the description of the embodiments of the present application, "exemplary", "for example", "for instance" or "such as" are used to represent that the embodiments or designs described are examples, illustrations or descriptions. Any embodiment or design scheme described as "exemplary", "for example", "for instance" or "such as" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplary", "for example", "for instance" or "such as" are used in the sense of presenting a related concept in a specific manner.
[0117] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text only describes the relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0118] In some of the processes described in the embodiments of the present application, a plurality of operations or steps are included in a specific order, but it should be understood that these operations or steps can be executed or performed in parallel or in an order different from that in which they appear in the embodiments of the present application. The serial number of the operation is only used to distinguish different operations, and the serial number itself does not represent any execution order. In addition, these processes can include more or fewer operations, and these operations or steps can be executed in sequence or in parallel, and these operations or steps can be combined.
[0119] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a plurality of instructions for making a terminal device execute the method described in each embodiment of the present application.
[0120] The preferred embodiments of the present application have been described above with the illustrated embodiments, and are not intended to limit the scope of patent protection for the present application. Any equivalent structure or equivalent process variations, which directly or indirectly incorporate the contents of the specification and drawings of the present application, are also intended to be included within the scope of patent protection for the present application.
Claims
1. A method for enhancing the contrast of ink droplet images, characterized in that, It includes the following steps: Obtain the floating-point target image corresponding to the integer-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. Based on the histogram, calculate the cumulative distribution function corresponding to each gray level in the histogram; Normalize each of the cumulative distribution functions to obtain the percentage of pixels corresponding to each gray level; The outlier removal ratio of the floating-point target image is determined according to a preset outlier ratio calculation model; wherein, the outlier ratio calculation model is related to the image entropy value of the target image and the image entropy values of the previous target images; 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 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 enhancing the contrast of an ink droplet image as described in claim 1, characterized in that, The process of determining the number of grayscale intervals and the grayscale range of each interval for histogram sorting of pixel grayscale data of the floating-point target image based on the size of the target image and 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.
3. The method for enhancing the contrast of an ink droplet image as described in claim 1, characterized in that, The step of determining the outlier removal ratio of the floating-point target image based on a preset outlier ratio calculation model includes the following steps: Obtain historical images of the floating-point target image, and determine the historical average entropy and historical maximum entropy of the floating-point target image based on the historical images; The outlier removal ratio is determined based on the image entropy, historical average entropy, historical maximum entropy of the floating-point target image, and a preset outlier ratio calculation model.
4. The method for enhancing the contrast of ink droplet images as described in claim 3, characterized in that, The outlier removal ratio of the floating-point target image is determined according to a preset outlier ratio calculation model, 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.
5. The method for enhancing the contrast of an ink droplet image 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.
6. The method for enhancing the contrast of an ink droplet image as described in claim 5, characterized in that, The step of mapping the optimized floating-point target image's pixel grayscale data to target grayscale data corresponding to the target grayscale range includes the following steps: Determine the difference between the grayscale data of any pixel in the optimized floating-point target image and the minimum grayscale value among the pixel grayscale data of the optimized floating-point target image; The difference is weighted by the upper limit of the target grayscale range, and the result is proportionally converted to the difference between the minimum and maximum grayscale values in the pixel grayscale data of the optimized floating-point target image to obtain the target grayscale data for each pixel corresponding to the target grayscale range.
7. The method for enhancing the contrast of an ink droplet image as described in claim 5, characterized in that, The process of adjusting abnormal grayscale data that does not belong to the target grayscale range in the target grayscale data to obtain result grayscale data and converting it into a corresponding result image includes the following steps: The abnormal grayscale data in the target grayscale data that are larger than the target grayscale range are adjusted to the upper limit of the target grayscale range, and the abnormal grayscale data in the target grayscale data that are smaller than the target grayscale range are adjusted to the lower limit of the target grayscale range to obtain the result grayscale data. The resulting grayscale data is converted into integer grayscale data to obtain the resulting image.
8. A contrast enhancement device for ink droplet images, characterized in that, It includes: The image conversion module is configured to acquire the floating-point target image corresponding to the integer target image; The sorting module is configured 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 size and grayscale range of the target image, using a preset histogram sorting accuracy balance model; and to count the number of pixels corresponding to each grayscale interval in the floating-point target image and form a histogram 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. An optimization module is configured to: calculate the cumulative distribution function corresponding to each gray level in the histogram; normalize each cumulative distribution function to obtain the pixel quantity ratio corresponding to each gray level; determine the outlier removal ratio of the floating-point target image according to a preset outlier ratio calculation model; wherein, the outlier ratio calculation model is related to the image entropy value of the target image and the image entropy values of several previous target images; and remove the corresponding percentage of pixel grayscale data before and after the histogram according to the outlier removal ratio to obtain the optimized pixel grayscale data of the floating-point target image. The contrast enhancement module is configured to 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.
9. A contrast enhancement device for ink droplet images, characterized in that, The contrast enhancement device for the ink droplet image includes a processor, a memory, and a contrast enhancement program for the ink droplet image stored in the memory and executable by the processor, wherein when the contrast enhancement program for the ink droplet image is executed by the processor, it implements the steps of the contrast enhancement method for the ink droplet image as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores a contrast enhancement program for an ink droplet image, wherein when the contrast enhancement program for the ink droplet image is executed by a processor, the steps of the contrast enhancement method for an ink droplet image as described in any one of claims 1 to 7 are implemented.