Method for calculating fogdrop parameters
By combining the Mask R-CNN model and the Tesseract OCR engine, the problems of low measurement accuracy and automation in fog droplet identification are solved. It achieves high-precision automated identification of fog droplet parameters and dual area calculation, adapts to different lighting conditions, and provides more comprehensive data support.
Patent Information
- Application Number
- CN202610050250.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies lack sufficient measurement accuracy in droplet identification and have a low degree of automation, failing to accurately represent the actual shape of droplets and adapt to different lighting conditions.
The Mask R-CNN model is used for fog droplet recognition. Multi-scale feature maps are extracted by combining ResNet50 and FPN. Candidate regions are processed by RPN and RoIAlign. The Tesseract OCR engine is used to extract scale information. Fog droplet parameters are obtained by dual area calculation.
It improves the accuracy of droplet measurement, provides pixel-level precision droplet masks, automatically adapts to different lighting conditions, supports large-scale batch processing, and offers dual evaluation of probabilistic and binary measurements, resulting in richer data dimensions.
Smart Images

Figure CN121527744A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image data processing or generation, and specifically relates to a method for calculating fog droplet parameters. Background Technology
[0002] By identifying cloud and fog droplet images and obtaining parameters such as droplet number, area, perimeter, and diameter, the microphysical structure characteristics of clouds and fog can be quantitatively analyzed. The number of cloud and fog droplets reflects the fog concentration, while the area and perimeter are used to calculate the surface area and boundary characteristics of cloud and fog droplets to assess their optical scattering ability. The diameter distribution is directly related to the cloud and fog droplet scale spectrum. These parameters together provide key basic data for studying the formation mechanism, evolution process, and artificial cloud and fog processes, and have important scientific and applied value for atmospheric science and related fields such as weather modification, meteorological monitoring, and atmospheric environment research.
[0003] Existing technologies primarily employ two methods for fog droplet identification. The first is based on the YOLO target detection network. This method only provides a rectangular bounding box as the detection result. The size of the fog droplet is approximated by using the coordinates of the top-left and bottom-right corners of the rectangle to approximate the droplet as an ellipse, and then applying the formula for calculating the size of an ellipse. The limitation of this method is that the YOLO network can only mark the target in the form of a rectangular bounding box, providing only the outermost range of the target, and cannot represent the actual shape of the target, leading to significant measurement errors. The second method is traditional image processing, which involves preprocessing steps such as brightness and contrast adjustment for fog droplet identification. This method requires manual adjustment of processing parameters for different image conditions, resulting in a complex and uncommon process. When processing different images with significant differences in brightness and contrast, parameters in the code need to be adjusted, processing each image individually, resulting in low automation. Summary of the Invention
[0004] The present invention is proposed based on the above-mentioned needs of the prior art. The technical problem to be solved by the present invention is to provide a method for calculating droplet parameters so as to obtain more comprehensive data while improving measurement accuracy.
[0005] To address the above problems, the technical solution provided by this invention includes: A method for calculating fog droplet parameters is provided, comprising: acquiring and preprocessing a fog droplet image; processing the fog droplet image using a pre-trained Mask R-CNN model to obtain a probability mask; including extracting multi-scale feature maps of the fog droplet image through the collaborative operation of ResNet50 and FPN; processing the multi-scale feature maps using RPN to obtain candidate regions that may contain fog droplet elements; aligning the features of the candidate regions using RoIAlign; performing parallel classification branch processing, bounding box regression branch processing, and mask branch processing on the feature-aligned candidate regions to finally obtain the element category, bounding box, confidence score, and probability mask within the candidate regions; determining the correspondence between the fog droplet image and the actual object size, including cropping the fog droplet image using ROI and marking the cropped region with red scale information; processing the cropped fog droplet image through a first processing step to change the red scale information to black scale information with a white background; and sending the processed image into Tesseract. The OCR engine uses specific configuration parameters to extract values on both sides of the equals sign and verifies their validity to obtain a pixel-to-micrometer scale. Based on the probability mask and scale, it obtains droplet parameters, including comparing the probability mask with preset values and converting the probability mask into a binary mask. It extracts the boundary contours of the two-dimensional mask, forming a sequence of points, and accumulates the Euclidean distance between adjacent points to obtain the droplet perimeter per pixel. It then superimposes the probability values of the probability masks corresponding to all pixels to form the droplet area under the first method, and superimposes the pixels with a binary mask value of 1 to form the droplet area under the second method. Based on the droplet parameters, it performs statistical analysis on the acquired droplet images, including performing individual statistics on each droplet image and merging the droplet data from all droplet images for global statistical analysis.
[0006] Preferably, the first processing step includes projecting the cropped droplet image into the HSV color space, performing dual-range masking processing on the red scale information, wherein the first range includes a red range from pure red to orange, and the second range includes a red range from magenta to pure red. After the masking processing, the red scale information becomes white scale information. By extracting and merging the two ranges and inverting them, the white scale information is converted into black scale information, with a white background.
[0007] Preferably, the step of extracting the values on both sides of the equal sign and verifying their rationality to obtain a pixel-micrometer scale includes: extracting a first capture group and a second capture group from the original text recognized by OCR using regular expressions, wherein the unit of the first capture group is pixels (px) and the unit of the second capture group is length (μm); verifying the first capture group and the second capture group; and if both capture groups are successfully verified, then calculating the pixel-micrometer scale.
[0008] Preferably, verifying the first capture group and the second capture group includes verifying whether the value of the first capture group is within a predetermined range; and verifying whether the value of the second capture group is a preset value.
[0009] Preferably, the step of comparing the probability mask with a preset value and converting the probability mask into a binary mask includes: when the probability mask is greater than the preset value, the pixel corresponding to the probability mask is considered to belong to the "fog droplet" part and is set to 1; when the probability mask is less than or equal to the preset value, the pixel corresponding to the probability mask is considered to belong to the "background" part and is set to 0.
[0010] Preferably, the method of obtaining the droplet perimeter per pixel unit by accumulating the Euclidean distances between adjacent points is expressed as: ,in, and It is the difference between two adjacent points. The droplet perimeter is given by the pixel-level droplet perimeter and the scale bar, which are then used to obtain the physical-scale droplet perimeter, expressed as: ,in, The droplet perimeter is the physical length. This is the scale.
[0011] Preferably, the droplet area under the first method is expressed as: ,in, Let (x, y) be the probability that the pixel at coordinates (x, y) is a fog droplet. The corresponding droplet area is given; the droplet area at the physical scale is obtained based on the droplet area in pixel units and the scale bar. The droplet area at the physical scale obtained in the first method is expressed as: The corresponding radius is expressed as: ,in, The area of the fog droplet on a physical scale. The radius is the radius on a physical scale.
[0012] Preferably, the droplet area of the second method is expressed as: ,in, This represents the binary mask value corresponding to the pixel with coordinates (x, y). The corresponding droplet area; the droplet area at the physical scale obtained in the second method is expressed as: The corresponding radius is expressed as: ,in, The area of fog droplets at the physical scale. The radius is the radius on a physical scale.
[0013] Preferably, the step of performing individual statistics on each fog droplet image includes calculating the average geometric parameters of each fog droplet image, including the average probability area, average binary area, average perimeter, average probability radius, average binary radius, and number of fog droplets.
[0014] Preferably, the step of merging the droplet data of all droplet images and performing global statistical analysis includes counting the number of droplet images, the total number of droplets in all droplet images, and the overall average and average difference of various parameters.
[0015] Compared to existing technologies, this invention employs a Mask R-CNN model to identify fog droplet images, generating pixel-level precision fog droplet masks that accurately represent the actual shape boundaries of the fog droplets, avoiding geometric errors caused by rectangular box approximations. Area calculation based on the precise mask eliminates the need for elliptical approximations, directly obtaining the true area through pixel accumulation, significantly improving measurement accuracy. Secondly, in terms of data processing, this method proposes a dual area calculation approach, providing both probabilistic and binary area calculations. The probabilistic area retains model uncertainty information, while the binary area provides a traditional geometric definition, offering richer data dimensions for analysis. This dual calculation approach not only improves measurement accuracy but also provides a more comprehensive data foundation for subsequent statistical analysis. Regarding automation, this method requires no manual parameter adjustment; the system automatically adapts to different lighting conditions and image quality. Trained on a large-scale dataset, the model exhibits excellent generalization performance, capable of handling fog droplet images under various complex backgrounds and lighting conditions. Compared to existing technologies, this method achieves significant improvements in several aspects. From rectangular box approximations to pixel-level precise masks, area measurement accuracy is significantly improved, especially when processing irregularly shaped fog droplets. It requires no manual intervention, supports large-scale batch processing, and significantly improves automation. It provides dual evaluation through both probabilistic and binary measurements, preserving model uncertainty information and enriching data dimensions, thus offering more possibilities for subsequent in-depth analysis. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings.
[0018] Figure 1 This is a flowchart illustrating the steps of a method for calculating droplet parameters according to an embodiment of the present invention;
[0019] Figure 2This is a flowchart illustrating the steps for determining the correspondence between a fog droplet image and the actual object size in an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the term "connected" should be interpreted broadly. For example, it can refer to a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.
[0023] Throughout the text, the terms “top,” “bottom,” “above,” “below,” and “on top” refer to the relative positions of components of the device, such as the relative positions of the top and bottom substrates within the device. It is understood that the device is multifunctional and independent of its spatial orientation.
[0024] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0025] This embodiment provides a method for calculating droplet parameters, such as... Figure 1 and Figure 2 As shown.
[0026] Acquire and preprocess the fog droplet image.
[0027] Acquiring object images involves collecting all supported image files from a specified folder, verifying file existence, and sorting them by name.
[0028] Preprocessing the fog droplet image involves converting the original RGB image into a tensor format.
[0029] The probability mask is obtained by processing the fog droplet image using a pre-trained Mask R-CNN model.
[0030] The pre-trained Mask R-CNN model is an instance segmentation model. It can perform not only object detection but also semantic segmentation. Object detection involves locating objects and marking them with bounding boxes, while semantic segmentation assigns a semantic category label to each pixel in the image, achieving pixel-level classification. The Mask R-CNN model is used to classify, locate, and segment fog droplet images.
[0031] Specifically, the Mask R-CNN model includes ResNet50, FPN, RPN, RoIAlign, and the Mask R-CNN detector head.
[0032] ResNet50, a 50-layer deep convolutional neural network, will serve as the feature extractor in this model to extract features, such as shape, from images.
[0033] Feature Pyramid Network (FPN) fuses deep semantic features with shallow detail features from top to bottom, generating a set of multi-scale feature maps. Specifically, since fog droplets vary in size within an image, FPN can simultaneously utilize the semantic information from the deep network and the detail information from the shallow network to accurately segment fog droplets of different sizes. The semantic information refers to what the target is (including whether the fog droplet is complete or partial), while the detail information corresponds to the precise boundaries of the target. FPN effectively detects objects of different sizes in an image. Whether the fog droplets are large or small, there are feature maps matching their scale for detection.
[0034] On each pixel of the feature map, multiple preset "anchor boxes" of different sizes and aspect ratios are placed. Each anchor box is determined to be either "foreground" (containing objects) or "background," and its coordinates are initially fine-tuned. RPN is used to quickly scan the anchor boxes in the feature map, initially determining "where objects might be," and generating a series of coarse candidate regions. Hundreds or thousands of high-quality candidate regions are output, which are then fed into subsequent networks for fine-tuning.
[0035] Since the candidate regions proposed from the RPN vary in shape and size, RoIAlign performs feature alignment to fix the size of each candidate region. Candidate regions processed by RoIAlign all have feature maps of the same size. Compared to RoIPooling used in existing technologies, RoIAlign eliminates the quantization operation and uses bilinear interpolation to accurately calculate the value of each sampling point. This perfectly preserves pixel-level spatial correspondence, enabling extremely high accuracy in mask prediction.
[0036] The candidate regions processed by RoIAlign are fed into three parallel head branches responsible for different tasks: a classification branch, a bounding box regression branch, and a mask branch. The classification branch, a fully connected layer, determines the specific category (e.g., "fog droplet" or "background") of the object within the candidate region and outputs a confidence score. The bounding box regression branch, also a fully connected layer, fine-tunes the coordinates of the coarse candidate regions proposed by the RPN, making them more closely and accurately fit the actual boundaries of the object. The mask branch is a small fully convolutional network. This means it has no fully connected layers, consisting entirely of convolutional and deconvolutional layers. Each pixel value in these probability masks is between 0 and 1, representing the probability that the pixel belongs to a fog droplet. The model generates a mask for both "maybe a fog droplet" and "maybe another category." Finally, the category result output from the classification branch is used to select the corresponding mask as the final output. This avoids competition between different categories in mask prediction, improving accuracy.
[0037] The acquired fog droplet images are fed into a pre-trained Mask R-CNN model. The ResNet50 and FPN in this model work together to generate rich, multi-scale feature maps. The RPN slides across these feature maps, quickly generating a large number of candidate regions that may contain objects. For each candidate region, the RoIAlign layer precisely crops the corresponding region from the FPN feature map and scales it to a fixed size to resolve misalignment issues. This fixed-size feature region is simultaneously fed into three head branches: a classification branch determines the feature region's identity and provides a confidence score; a regression branch refines its bounding box coordinates; and a mask branch predicts a pixel-level probability mask for each possible category. This probability mask preserves the model's uncertainty information, providing a richer data foundation for subsequent precise analysis. Post-processing steps (such as non-maximum suppression) filter out overlapping, low-confidence detection boxes and select the final mask based on the classification results. The output includes the bounding box, category, confidence score, and a high-precision segmentation mask for each fog droplet instance.
[0038] Determine the correspondence between the fog droplet image and its actual physical size, such as... Figure 2 As shown.
[0039] For foggy images, ROI cropping is performed to reduce the processing area, thereby improving processing speed and accuracy. Specifically, to prevent the introduction of a large amount of irrelevant interference information into subsequent color difference processing and OCR recognition, ROI cropping is performed, and scale information is marked on the cropped area in red.
[0040] Convert the cropped fog image to the HSV color space.
[0041] The original fog droplet image used the RGB (Red-Green-Blue) color space. However, RGB is very sensitive to changes in light, making it unsuitable for color segmentation. Therefore, it was converted to the HSV color space, which better matches human color perception and consists of three components: hue, saturation, and lightness. After conversion to HSV, specific colors can be selected very stably by setting the range of H values, unaffected by light intensity (V).
[0042] The red scale information is processed using a dual-range mask.
[0043] In the HSV color wheel, red is located near 0° (and equivalently 360°). This means that red actually spans both the beginning and end of the color wheel. Therefore, to capture all red hues in an image completely, two threshold intervals need to be defined: a first interval targeting the lower end of the red spectrum and a second interval targeting the higher end. The first interval captures reds ranging from pure red to orange-toned reds. The second interval captures reds ranging from magenta to pure red. Pixels within both intervals are white, and pixels outside the intervals are black. This converts red text to white text.
[0044] Extract and merge the corresponding masks of these two intervals and invert them.
[0045] By merging the red masks of the two intervals using a logical "OR" operation, a complete red area mask is obtained. At this point, all red parts in the image (including the scale bar text) are white.
[0046] The merged mask is negated by performing a logical NOT operation. This means that the originally white text becomes black, and the originally black background becomes white. The resulting "white background with black text" image is then adapted to the Tesseract OCR engine's default function for recognizing white background with black text.
[0047] The processed image is then fed into the Tesseract OCR engine using specific configuration parameters.
[0048] Specifically, this includes the single-block text recognition mode --psm 6 and a character whitelist. --psm 6 assumes the image is a single, uniform text block, which is well-suited for well-cropped, simply laid-out scaled text regions. It prevents the engine from incorrectly splitting text lines into multiple parts. The character whitelist includes only allowed numbers, decimal points, px, μm, equal signs, and spaces. The Tesseract OCR engine then identifies the corresponding text, greatly reducing the possibility of misidentification.
[0049] The original text is identified by OCR using regular expressions, and the two values on both sides of the equal sign are accurately extracted, ensuring the validity of the values.
[0050] The values on the left side of the equals sign, where the unit is pixels (px), are used as the first capture group, and the values on the right side of the equals sign, where the unit is length (μm), are used as the second capture group.
[0051] Verify the first capture group by checking that its values are between 70 and 130 pixels. This range is preset based on the typical size of a scaled image. Verify the second capture group by checking that its values correspond to 10 micrometers.
[0052] If both the first and second capture groups are successfully verified, the pixel-to-micrometer ratio is calculated by dividing the value of the first capture group by the value of the second capture group, resulting in the pixel-to-micrometer scale: L_ratio = L_px / L_μm. Here, L_ratio is the scale, L_px is the pixel value, and L_μm is the length value.
[0053] Droplet parameters are obtained based on probability masks and scale bars.
[0054] The probability mask is preprocessed and converted into a binary mask.
[0055] When the probability mask is greater than a preset value, the pixel corresponding to the probability mask is considered to belong to the "fog droplet" part and is set to 1; when the probability mask is less than or equal to the preset value, the pixel corresponding to the probability mask is considered to belong to the "background" part and is set to 0. Thus, the probability mask is converted into a binary mask that is either black or white.
[0056] The contour detection module extracts the boundary contour of the binary mask. This module generates a sequence of points; connecting these points sequentially forms the boundary line of the mask. This can be compared to using a string of very fine, connected lines to depict the edge of a fog droplet.
[0057] The perimeter value per pixel is obtained by calculating and summing the Euclidean distances between adjacent points, and is expressed as:
[0058] in, and It is the difference between two adjacent points. The perimeter of the fog droplet is in pixels.
[0059] The perimeter value in micrometers is obtained by using a scale bar and pixel units to calculate the perimeter value, providing a highly accurate approximation of the contour length. Since the contour is a polyline composed of discrete pixels, this method is more accurate than simply counting the number of boundary pixels.
[0060] There are two methods for calculating the area: the first method is based on probability masks, and the second method is based on binary masks.
[0061] The first method directly superimposes the probability values of the probability masks corresponding to all pixels, as follows: ,in, Let (x, y) be the probability that the pixel at coordinates (x, y) is a fog droplet. This represents the corresponding droplet area.
[0062] For example, if a pixel is 100% certain to be a fog droplet (p=1), then it will contribute 1; if there is only an 80% probability (p=0.8), then it will contribute 0.8. This method can reflect the confidence level of the model more delicately and preserve the uncertainty information of the model.
[0063] The second method involves overlaying all pixels with a binary mask value of 1. Each pixel identified as a fog droplet contributes 1, which is the most intuitive and commonly used definition of area. This method is expressed as: ,in, This represents the binary mask value corresponding to the pixel with coordinates (x, y). This represents the corresponding droplet area.
[0064] Based on the scale, all pixel unit measurements are converted into real physical units (micrometers, square micrometers), so that the measurement results correspond to the scale of the real world.
[0065] The perimeter will be transformed based on a linear relationship and expressed as: ,in, The droplet perimeter is the physical length. This is the scale.
[0066] The area conversion is based on the square relation. The conversion methods for the first method and the second method are expressed as follows: and ,in The droplet area at the physical scale of the first method. This represents the droplet area at the physical scale of the second method.
[0067] For ease of description and statistics, the area of any shape of fog droplet is equivalent to the radius of a circle with the same area, which is a very commonly used parameter.
[0068] Using the formula for the area of a circle By reverse reasoning, we can obtain Therefore, the radii corresponding to the first and second methods are expressed as: and ,in The radius is the physical scale of the first method. The radius is the physical scale of the second method.
[0069] The data integration and output will organize all the feature values calculated for a single fog droplet mask into a dictionary (key-value pair) structure. This includes all measurements in pixel units and physical units, providing a complete data foundation for subsequent statistical analysis.
[0070] Statistical analysis was performed on the acquired fog droplet images based on fog droplet parameters.
[0071] Each fog droplet image was analyzed separately.
[0072] The average geometric parameters for each fog droplet image are calculated, including the average probability area, average binary area, average perimeter, average probability radius, average binary radius, and number of fog droplets. These statistical values reflect the overall characteristic distribution of fog droplets in a single image.
[0073] The average probability area preserves the uncertainty information of the model; the average binary area provides a conventional geometric measurement.
[0074] Specifically, when the number of fog droplets in an image is When the average probability area is expressed as:
[0075] in, The area is the average probability area. Let be the droplet area of the i-th droplet at the physical scale of the first method.
[0076] The average binary area is expressed as:
[0077] in, The area is a binary probability area. Let be the droplet area of the i-th droplet at the physical scale of the second method.
[0078] Binary area is a traditional geometric measurement, simple and easy to use, but it may lose information about the model's uncertainties. Comparing it with the probability area can assess the robustness of the model's output.
[0079] Average perimeter:
[0080] in, For the average perimeter, Let be the perimeter of the i-th droplet at the physical scale.
[0081] Average probability radius:
[0082] in, The average probability radius, Let be the droplet radius of the i-th droplet at the physical scale of the first method.
[0083] Average binary radius:
[0084] in, The average probability radius, Let be the droplet radius of the i-th droplet at the physical scale of the second method.
[0085] The standard deviation of the area of probability (and others are similar):
[0086] in, Let be the standard deviation of the probability area.
[0087] Binary area standard deviation:
[0088] in, is the binary area standard deviation.
[0089] After completing the individual statistics for each image, the fog droplet data of all images are merged and a global statistical analysis is performed.
[0090] Calculate the population mean and standard deviation. The population mean provides the central tendency of the entire sample set, while the standard deviation reflects the dispersion of droplet size.
[0091] Special attention is paid to the differences between the two area measurement methods: probabilistic area preserves the uncertainty information of the model, while binary area provides a traditional geometric measurement. This dual calculation method provides a richer dimension of information for the analysis.
[0092] The probability area is calculated by summing the probability masks output by the model (each pixel has a value between 0 and 1). It preserves the model's uncertainty; for example, the probability area may be more accurate in regions with blurred boundaries. It is suitable for scenarios requiring quantified confidence levels.
[0093] Binary area calculations are based on a binary mask (pixel values are either 0 or 1), calculating the area by counting pixels. It is simple and fast, but may lose detail, especially in low-contrast areas. It is suitable for traditional geometric analysis.
[0094] The uncertainty in droplet size measurement is understood by comparing the two areas. Typically, the probabilistic area is slightly larger or smaller than the binary area, depending on the threshold selection.
[0095] The system then outputs the statistical results in a formatted format to the console, including the total number of images, the total number of fog droplets, and the overall mean and standard deviation of each parameter. These statistical results can be directly used in scientific research reports, providing quantitative data support for fog droplet analysis.
[0096] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for calculating droplet parameters, characterized in that, include: Acquire and preprocess fog droplet images; The fog droplet image is processed using a pre-trained Mask R-CNN model to obtain a probability mask; This includes extracting multi-scale feature maps of fog droplet images through the collaborative operation of ResNet50 and FPN; and processing the multi-scale feature maps with RPN to obtain candidate regions that may contain fog droplet elements. The candidate regions are processed using RoIAlign to align their features; The candidate regions after feature alignment are processed in parallel by classification branch, bounding box regression branch, and mask branch, and finally the element category, bounding box, confidence score, and probability mask of the candidate regions are obtained. Determining the correspondence between the droplet image and the actual object size includes cropping the droplet image using the ROI and marking the cropped area with red scale information; processing the cropped droplet image through a first processing step to change the red scale information to black scale information with a white background; feeding the processed image into the Tesseract OCR engine using specific configuration parameters; extracting the values on both sides of the equals sign and verifying the reasonableness of the values to obtain a pixel-to-micrometer scale. The droplet parameters are obtained based on the probability mask and scale bar; this includes comparing the probability mask with preset values and converting the probability mask into a binary mask; extracting the boundary contour of the two-dimensional mask to form a sequence of points; accumulating the Euclidean distance between adjacent points to obtain the droplet perimeter per pixel; superimposing the probability values of the probability masks corresponding to all pixels to form the droplet area under the first method; and superimposing the pixels with a binary mask value of 1 to form the droplet area under the second method. Statistical analysis of the acquired fog drop images is performed based on fog drop parameters, including individual statistical analysis of each fog drop image; The fog droplet data from all fog droplet images were merged for global statistical analysis.
2. The method for calculating droplet parameters according to claim 1, characterized in that, The first processing step includes projecting the cropped droplet image into the HSV color space, performing dual-range masking on the red scale information, wherein the first range includes a red range from pure red to orange, and the second range includes a red range from magenta to pure red. After the masking process, the red scale information becomes white scale information. By extracting and merging the two ranges and inverting them, the white scale information is converted into black scale information, with a white background.
3. The method for calculating droplet parameters according to claim 1, characterized in that, The step of extracting the values on both sides of the equal sign and verifying their rationality to obtain a pixel-to-micrometer scale includes: extracting a first capture group and a second capture group from the original text recognized by OCR using regular expressions, wherein the unit of the first capture group is pixels (px) and the unit of the second capture group is length (μm); verifying the first and second capture groups; and if both capture groups are successfully verified, calculating the pixel-to-micrometer scale.
4. The method for calculating droplet parameters according to claim 3, characterized in that, Verifying the first capture group and the second capture group includes verifying whether the value of the first capture group is within a predetermined range; and verifying whether the value of the second capture group is a preset value.
5. The method for calculating droplet parameters according to claim 1, characterized in that, The comparison of the probability mask and the preset value, and the conversion of the probability mask into a binary mask, includes considering the pixel corresponding to the probability mask as belonging to the "fog droplet" part when the probability mask is greater than the preset value, and setting the value to 1; When the probability mask is less than or equal to the preset value, the pixel corresponding to the probability mask is considered to belong to the "background" part, and the value is set to 0.
6. The method for calculating droplet parameters according to claim 1, characterized in that, The droplet perimeter per pixel, obtained by accumulating the Euclidean distances between adjacent points, is expressed as: ,in, and It is the difference between two adjacent points. The perimeter of the fog droplet in pixels; The droplet perimeter at the physical scale is obtained based on the droplet perimeter in pixel units and the scale bar, and is expressed as: ,in, The droplet perimeter is the physical length. This is the scale.
7. The method for calculating droplet parameters according to claim 1, characterized in that, The droplet area under the first method is expressed as follows: ,in, Let (x, y) be the probability that the pixel at coordinates (x, y) is a fog droplet. This represents the corresponding droplet area; The droplet area at the physical scale is obtained based on the droplet area in pixel units and the scale bar. The droplet area at the physical scale obtained in the first method is expressed as follows: The corresponding radius is expressed as: ,in, The area of the fog droplet on a physical scale. The radius is the radius on a physical scale.
8. The method for calculating droplet parameters according to claim 1, characterized in that, The droplet area in the second method is expressed as: ,in, This represents the binary mask value corresponding to the pixel with coordinates (x, y). This represents the corresponding droplet area; The droplet area at the physical scale obtained in the second method is expressed as follows: The corresponding radius is expressed as: ,in, The area of fog droplets at the physical scale. The radius is the radius on a physical scale.
9. The method for calculating droplet parameters according to claim 1, characterized in that, The individual statistical analysis of each droplet image includes calculating the average geometric parameters of each droplet image, including the average probability area, average binary area, average perimeter, average probability radius, average binary radius, and number of droplets.
10. The method for calculating droplet parameters according to claim 1, characterized in that, The process involves merging the droplet data from all droplet images and performing a global statistical analysis, including counting the number of droplet images, the total number of droplets in all droplet images, and the overall average and average difference of various parameters.
Citation Information
Patent Citations
Method for constructing glioma in-vitro 3D culture and analysis system and application
CN112921000A
ImagePy-based water-sensitive paper fog drop parameter measuring device and measuring method thereof
CN113222925A
Fogdrop deposition detection method, device and system
CN117197567A
Abnormal phased array radar echo image restoration method based on generative adversarial network
CN121073796A
Direct ionization in imaging mass spectrometry operation
US20210391161A1