A method, apparatus, and device for automatically generating PIV particle image masks.
By automating the processing of PIV particle images, including filtering and fitting, a highly efficient and accurate mask is generated, solving the problems of low efficiency and poor repeatability in existing technologies. It is applicable to various geometries and working conditions.
Patent Information
- Application Number
- CN202511383339.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2045-09-26
AI Technical Summary
Existing PIV particle image mask generation technology is inefficient, has poor repeatability and low accuracy, and is greatly affected by individual subjective factors.
By performing minimum value filtering, normalization, standard deviation filtering, binarization, morphological processing, polygon fitting, and piecewise polynomial fitting on the original PIV particle image, the system automatically identifies the area to be occluded and generates a mask.
It improves the efficiency and accuracy of mask generation, achieves single-pixel-level boundary recognition, and has good versatility, applicable to occluded areas with regular and irregular geometries, and static and dynamic working conditions.
Smart Images

Figure CN121235909B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of flow field measurement technology, specifically to a method, apparatus, and device for automatically generating PIV particle image masks. Background Technology
[0002] Particle image velocimetry (PIV) is a non-contact optical flow field measurement technique. Its basic principle involves selecting appropriate tracer particles and introducing them into the fluid being measured. The fluid is then illuminated and photographed twice within a very short time interval, and the fluid velocity is indirectly calculated from the particle displacement. This technique is currently widely used in measuring various types of flows, from steady to unsteady, from low-speed to high-speed, and from single-phase to multiphase.
[0003] The main steps of PIV (Particle Image Transformation) technology include calibration, particle image capture, particle image preprocessing, cross-correlation calculation, and velocity field post-processing. In the particle image preprocessing stage, a mask needs to be generated in the particle image to obscure areas that do not require calculation (such as experimental models), preventing numerous erroneous vectors from appearing in the subsequently calculated velocity field. Existing technical solutions for PIV particle image mask generation mainly fall into two categories: one is input coordinate mask generation, where the area to be obscured in the image is manually identified, the coordinates of the area's boundaries are manually measured, and the coordinates are input to generate the mask. This method is typically used when the area to be obscured has a regular geometric shape (such as a circle or rectangle); the other is manual point selection mask generation, where the area to be obscured in the image is manually identified, multiple points are manually selected along the boundary of the area, and the polygon enclosed by these points serves as the mask. This method is typically used when the area to be obscured has an irregular geometric shape. The advantage of existing technical solutions is their versatility; the combination of the two methods can generate various types of PIV particle image masks. The disadvantages are that they all require manual identification of the areas in the image that need to be occluded, which is inefficient; the identification process is affected by individual subjective factors, resulting in poor repeatability; and the mask generated by manual measurement or manual point selection has errors with the actual area that needs to be occluded, resulting in low accuracy. Summary of the Invention
[0004] This application provides a method, apparatus, and device for automatically generating PIV particle image masks, which effectively solves the problems of low efficiency, poor repeatability, and low accuracy in the prior art, while also having good universality.
[0005] This application is achieved through the following technical solution: A method for automatically generating PIV particle image masks includes: Minimum filtering is applied to the original PIV particle image to obtain the background, and the background is then removed from the original PIV particle image. The image after removing the background is normalized. The normalized image is processed to generate an initial mask; Extract the contour of the initial mask; The extracted contour of the initial mask is fitted with polygons to generate the first mask; Based on the vertices of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to generate the final mask.
[0006] In some embodiments, the normalization process for the image after removing the background includes: Divide the gray value of each pixel in the image by the maximum gray value of the image and then multiply by 255.
[0007] In some embodiments, the processing of the normalized image includes: The image is filtered using standard deviation to distinguish between the tracer particle region and the region to be occluded; The image after standard deviation filtering is binarized to convert the image from grayscale format to binary format; Morphological processing is performed on the binarized image to generate an initial mask.
[0008] In some implementations, the binarization processing of the image after standard deviation filtering includes: Two thresholds are set, namely a first threshold and a second threshold; the first threshold and the second threshold are determined based on the grayscale distribution of the image. Pixels with gray values less than the first threshold and gray values greater than the second threshold are assigned a value of 1, and the remaining pixels are assigned a value of 0.
[0009] In some embodiments, the morphological processing of the binarized image includes: The image is subjected to image erosion, image dilation, and image filling processes. The image erosion process is used to remove image noise outside the area to be occluded. The image dilation process is used to connect the boundaries of the areas to be occluded. The image filling process is used to fill holes in the area to be occluded; The connected component with the largest area is then retained as the initial mask.
[0010] In some embodiments, extracting the contour of the initial mask includes: The initial mask is convolved using two orthogonal convolution kernels to obtain the horizontal and vertical convolution values of each pixel. The total convolution value of the pixel is then calculated based on the horizontal and vertical convolution values of each pixel. Determine whether the total convolution value of each pixel is greater than the contour threshold. If it is, then the pixel is the contour point of the initial mask. The set of all contour points is the contour of the initial mask.
[0011] In some embodiments, performing polygon fitting on the extracted contour of the initial mask includes: The contour points of the initial mask are sorted in a clockwise or counterclockwise order; Find the two points that are farthest apart from the sorted contour points, and denote them as follows: and The straight line formed by these two points is denoted as . These two points divide the contour of the initial mask into two curve segments, denoted as . and ; Then respectively in and Find the distance The farthest point is denoted as and At this time, the vertices of the polygon are... , , and It consists of four points, and the straight line formed by these four points is denoted as follows: , , and These four points divide the contour of the initial mask into four curve segments, denoted as follows: , , and Similarly, iteratively find the point on the curve segment that is farthest from the corresponding straight line and merge it into the polygon until the number of vertices of the polygon is greater than or equal to the number of vertices of the polygon to be fitted.
[0012] In some embodiments, the step of performing piecewise polynomial fitting on the contour of the initial mask based on the vertices of the first mask includes: The vertices of the first mask divide the contour of the initial mask into a finite number of curve segments; By combining the vertices of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to smooth its boundaries and generate the final mask. The polynomial fitting employs first-order and second-order polynomial fitting.
[0013] Secondly, this application proposes an apparatus for automatically generating PIV particle image masks, comprising: A filtering unit is used to perform minimum value filtering on the original PIV particle image to obtain the background and remove the background from the original PIV particle image; A normalization unit is used to normalize the image after removing the background; The image processing unit is used to process the normalized image and generate an initial mask; A contour extraction unit is used to extract the contour of the initial mask; A fitting unit is used to perform polygon fitting on the extracted contour of the initial mask to generate a first mask; And a smoothing unit, used to perform piecewise polynomial fitting on the contour of the initial mask based on the vertices of the first mask to generate the final mask.
[0014] Thirdly, this application proposes an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the above-described embodiments of the method.
[0015] This application provides a method for automatically generating PIV particle image masks. Utilizing the difference in grayscale distribution between the area to be occluded and the tracer particle area in a PIV particle image, an automatic recognition algorithm is used to automatically identify the area to be occluded and generate a mask, effectively shortening the time required for mask generation and improving efficiency. Furthermore, only the same particle image and algorithm parameters need to be input to generate identical masks, resulting in good repeatability. In addition, the algorithm's accuracy in identifying the boundary of the area to be occluded can reach the single-pixel level, which is more accurate than manual measurement or manual point selection. This application also possesses good universality. Spatially, it is applicable to both regular and irregular geometric shapes of the area to be occluded; temporally, it is applicable to both static conditions where the area to be occluded does not change over time and dynamic conditions where the area changes over time. Moreover, it has no requirement on the number of images, applicable to both single particle images and sequences of multiple particle images.
[0016] Correspondingly, the apparatus and device for automatically generating PIV particle image masks proposed in this application also have the same technical effects as described above. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the embodiments of this application and form part of this application, do not constitute a limitation on the embodiments of this application. In the drawings: Figure 1 This is the original PIV particle image; Figure 2 This is the velocity field calculated without a mask being generated. Figure 3 The mask generated using existing technical solutions (manual point selection) and the velocity field calculated subsequently; Figure 4 This is a schematic diagram of the method flow proposed in the embodiments of this application; Figure 5 This is a schematic diagram of the device proposed in the embodiments of this application; Figure 6 This is a schematic diagram of the system architecture proposed in an embodiment of this application; Figure 7 This is a schematic diagram of the electronic device proposed in the embodiments of this application; Figure 8 This is a schematic diagram of a computer-readable storage medium proposed in an embodiment of this application; Figure 9 The image after minimum value filtering and background removal; Figure 10 The image is filtered by standard deviation; Figure 11 The image after binarization; Figure 12 The initial mask is obtained after image erosion, image dilation, and image filling processes. Figure 13 The outline of the initial mask to be extracted; Figure 14 The first mask after polygon fitting; Figure 15 This is the final mask after polynomial fitting; Figure 16 The mask generated using the method proposed in the embodiments of this application and the subsequently calculated velocity field; Figure reference numerals and corresponding component names: 200 - Device, 201 - Filtering unit, 202 - Normalization unit, 203 - Image processing unit, 204 - Contour extraction unit, 205 - Fitting unit, 206 - Smoothing unit, 300 - System, 301 - Input device, 302 - Output device, 303 - Processor A, 304 - Memory A, 400 - Electronic device, 410 - Memory B, 420 - Processor B, 411 - Computer program A, 500 - Computer-readable storage medium, 511 - Computer program B. Detailed Implementation
[0018] In the following, the terms “comprising” or “may include” as used in the various embodiments of this application indicate the presence of a function, operation, or element of the invention and do not limit the addition of one or more functions, operations, or elements. Furthermore, as used in the various embodiments of this application, the terms “comprising,” “having,” and their cognates are intended only to indicate a specific feature, number, step, operation, element, component, or combination of the foregoing and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing, or adding one or more combinations of the foregoing.
[0019] In various embodiments of this application, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.
[0020] The terms used in the various embodiments of this application (such as "first," "second," etc.) may modify various constituent elements in the various embodiments, but do not limit the corresponding constituent elements. For example, the above terms do not limit the order and / or importance of the elements. The above terms are only used for the purpose of distinguishing one element from other elements. For example, a first user device and a second user device refer to different user devices, although both are user devices. For example, without departing from the scope of the various embodiments of this application, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element.
[0021] It should be noted that if a description is made of "connecting" one component to another, then the first component can be directly connected to the second component, and a third component can be "connected" between the first and second components. Conversely, when a component is "directly connected" to another component, it can be understood that there is no third component between the first and second components.
[0022] The terminology used in the various embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the various embodiments of this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. The terms (such as those defined in a generally used dictionary) are to be interpreted as having the same meaning as in the context of the relevant technical field and are not to be interpreted as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the embodiments and accompanying drawings. The illustrative embodiments and descriptions of this application are only for explaining this application and are not intended to limit this application.
[0024] Figures 1-3 This paper illustrates an existing technique for generating PIV particle image masks, wherein, Figure 1 This image shows an original PIV particle image obtained from a PIV experiment, where the area where the experimental model is located is the area to be occluded. Figure 2 This shows the velocity field calculated from the image without a mask, by... Figure 2 It can be seen that since there are no tracer particles distributed in the area to be occluded, a large number of erroneous vectors appear in the calculated velocity field. Figure 3 This demonstrates a mask generated using existing technology (i.e., manual point selection) and the subsequently calculated velocity field, by... Figure 3 It can be seen that generating the mask effectively removes erroneous vectors in the velocity field. However, as mentioned above, existing technical solutions suffer from problems such as low efficiency, poor repeatability, and low accuracy.
[0025] To address the aforementioned problems, this application proposes a method for automatically generating PIV particle image masks, such as... Figure 4 As shown, the method proposed in this application includes the following steps: Step 110: Perform minimum value filtering on the original PIV particle image with a window of a preset size to obtain the background and remove the background from the original PIV particle image. Step 120: Normalize the image after removing the background; Step 130: Process the normalized image to generate an initial mask; Step 140: Extract the contour of the initial mask; Step 150: Perform polygon fitting on the contour of the extracted initial mask to generate the first mask; Step 160: Based on the vertices of the first mask, perform piecewise polynomial fitting on the contour of the initial mask to generate the final mask.
[0026] Furthermore, the method proposed in this application embodiment also includes: The final mask is then overlaid onto the original PIV particle image to calculate the velocity field. It is understood that velocity field calculation is not the focus of this application and can be performed using existing techniques, which will not be elaborated upon here.
[0027] Furthermore, the original PIV particle images are obtained through PIV experiments, and are usually in formats such as jpg, png, and tif. The images contain areas to be occluded due to the experimental model.
[0028] In step 110 of this embodiment, a window size of 5 pixels × 5 pixels can be used to perform minimum value filtering on the original PIV particle image to obtain the background. Then, the background is subtracted from the original PIV particle image to improve image quality and reduce the impact of the background on subsequent image processing. Minimum value filtering replaces the gray value of a pixel with the minimum gray value in its neighborhood.
[0029] Furthermore, in step 120 of this application embodiment, the image grayscale value can be normalized to 0~255 to facilitate subsequent calculations. Specifically, the grayscale value of each pixel in the image is divided by the maximum grayscale value of the image and then multiplied by 255.
[0030] Furthermore, in step 130 of this embodiment, the initial mask generation process includes: The image is filtered using standard deviation filtering with a window of preset size to distinguish between tracer particle regions and areas to be occluded. Standard deviation filtering replaces the gray value of a pixel with the standard deviation of the gray values in its neighborhood. The calculation formula is:
[0031] in, This represents the total number of pixels in the neighborhood. It is the average gray value of the pixels in the neighborhood. For the neighboring region The grayscale value of each pixel. Optionally, the window size used in the standard deviation filtering process can be, but is not limited to, 5 pixels × 5 pixels.
[0032] The image after standard deviation filtering is binarized using a threshold, converting it from grayscale to binary format. Optionally, two thresholds can be set: a first threshold and a second threshold. Pixels with grayscale values less than the first threshold and greater than the second threshold are assigned a value of 1, while all other pixels are assigned a value of 0. Optionally, the two thresholds are determined based on the image's grayscale distribution during binarization. For example, a first threshold of 1 corresponds to the 50th quantile of the image's cumulative grayscale distribution function, and a second threshold of 10 corresponds to the 95th quantile of the image's cumulative grayscale distribution function.
[0033] Morphological processing is performed on the binarized image, including image erosion, image dilation, and image filling, to generate an initial mask. Image erosion removes noise outside the occluded area, image dilation connects the boundaries of the occluded area, and image filling fills holes within the occluded area. The initial mask is obtained by combining these three processes and preserving the connected component with the largest area. Optionally, the planar structuring element used for image erosion and image dilation is a circle with a radius of 3 pixels. It is understood that image erosion, image dilation, and image filling techniques are conventional image processing techniques and will not be elaborated upon here.
[0034] Furthermore, in step 140 of this embodiment, the process of extracting the contour of the initial mask includes: using two orthogonal convolution kernels. and Perform convolution operations on the initial mask image to obtain the horizontal convolution value for each pixel. Vertical convolution value and total convolution value If the total convolution value of a certain pixel is... Greater than the contour threshold If a pixel is selected, it becomes a contour point of the initial mask, and the set of all contour points constitutes the contour of the initial mask. Optionally, a contour threshold is applied. Set to 0.
[0035] Furthermore, in step 150 of this embodiment, the process of generating the first mask includes: Polygon fitting is performed on the contour of the initial mask to transform it into a polygon, which becomes the first mask. The contour of the initial mask is then divided into a finite number of curve segments using the vertices of the first mask. The polygon fitting process involves first sorting the contour points of the initial mask in a clockwise or counterclockwise order. Then, the two points that are furthest apart are found and denoted as... and The straight line formed by these two points is denoted as . The curve segment between two points is denoted as and Subsequently, in and Find the distance The farthest point is denoted as and At this time, the vertices of the polygon are... , , and The straight line formed by these four points is denoted as . , , and The initial mask contour is divided into , , and This process is repeated iteratively to find the point on the curve segment furthest from the corresponding straight line, and then merges it into the polygon until the number of vertices in the polygon is greater than or equal to the number of vertices in the polygon to be fitted. Optionally, the number of vertices of the polygon to be fitted. Set to 8~16.
[0036] Furthermore, in step 160 of this embodiment, the final mask generation process includes: By combining the vertices of the first mask contour (i.e., the polygon), a piecewise polynomial fit is performed on the initial mask contour to smooth its boundaries, generating the final mask. The formula for the polynomial fit is:
[0037] in, Let be the order of the polynomial. Let be the variable to be fitted. The coefficients are used. Optionally, embodiments of this application employ first-order and second-order polynomial fitting. It is understood that the polynomial fitting process is a conventional technique in the art and will not be described in detail here.
[0038] The method proposed in this application utilizes the difference in grayscale distribution between the area to be occluded and the tracer particle area in a PIV particle image. An automatic recognition algorithm identifies the area to be occluded and generates a mask, effectively shortening the time required for mask generation and improving efficiency. It only requires the same particle image and algorithm parameters to generate identical masks, significantly improving repeatability compared to existing technologies. The accuracy of identifying the boundary of the area to be occluded can reach the single-pixel level, effectively improving accuracy compared to existing technologies. It also possesses good versatility; spatially, it is applicable to both regularly and irregularly shaped areas to be occluded; temporally, it is applicable to both static conditions where the area to be occluded does not change over time and dynamic conditions where the area changes over time. Furthermore, it has no requirement regarding the number of images, applicable to both single particle images and sequences of multiple particle images.
[0039] In another embodiment, this embodiment also proposes an apparatus for automatically generating PIV particle image masks, such as... Figure 5 As shown, the device 200 includes: The filtering unit 201 is used to perform minimum value filtering on the original PIV particle image with a window of a preset size to obtain the background and remove the background from the original PIV particle image. The specific minimum value filtering method is as described in step 110 above, and will not be repeated here.
[0040] Normalization unit 202 is used to normalize the image after background removal. The specific normalization process is as described in step 120 above, and will not be repeated here.
[0041] Image processing unit 203 is used to process the normalized image to generate an initial mask. The specific initial mask generation process is as described in step 130 above, and will not be repeated here.
[0042] The contour extraction unit 204 is used to extract the contour of the initial mask. The specific contour extraction process of the initial mask is as described in step 140 above, and will not be repeated here.
[0043] Fitting unit 205 is used to perform polygon fitting on the contour of the extracted initial mask to generate the first mask. The specific process of generating the first mask is as described in step 150 above, and will not be repeated here.
[0044] Furthermore, the smoothing unit 206 is used to perform piecewise polynomial fitting on the contour of the initial mask based on the vertices of the first mask to generate the final mask. The specific final mask generation process is as described in step 160 above, and will not be repeated here.
[0045] Optionally, the apparatus 200 in this embodiment further includes: The computational unit is used to overlay the final mask onto the original PIV particle image and calculate the velocity field.
[0046] This application also proposes a system for automatically generating PIV particle image masks, such as... Figure 6 As shown, the system 300 proposed in this embodiment includes: The system comprises an input device 301, an output device 302, a processor A303, and a memory A304; wherein the number of processors A303 and memory A304 can be one or more. Figure 6 The following description uses a processor A303 and a memory A304 as an example. The input device 301, output device 302, processor A303, and memory A304 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0047] Specifically, by calling the operation instructions stored in memory A304, processor A303 executes the following steps: The original PIV particle image is subjected to minimum value filtering with a window of a preset size to obtain the background, and the background is removed from the original PIV particle image. Normalize the image after removing the background; The normalized image is processed to generate an initial mask; Extract the outline of the initial mask; The contour of the extracted initial mask is fitted with polygons to generate the first mask; Based on the vertices of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to generate the final mask.
[0048] Optionally, by calling the operation instructions stored in memory A304, processor A303 is also used to execute any of the embodiments in the corresponding examples of the above methods.
[0049] This application also proposes an electronic device, such as... Figure 7 As shown, the electronic device 400 includes: a memory B410, a processor B420, and a computer program A411 stored in the memory B410 and executable on the processor B420. When the processor B420 executes the computer program A411, it performs the following steps: The original PIV particle image is subjected to minimum value filtering with a window of a preset size to obtain the background, and the background is removed from the original PIV particle image. Normalize the image after removing the background; The normalized image is processed to generate an initial mask; Extract the outline of the initial mask; The contour of the extracted initial mask is fitted with polygons to generate the first mask; Based on the vertices of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to generate the final mask.
[0050] Optionally, when processor B420 executes computer program A411, it may implement any of the embodiments in the corresponding examples of the above method.
[0051] It should be noted that the electronic device proposed in this embodiment is a device used to implement the above method. Therefore, based on the above method proposed in this embodiment, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment. Therefore, how the electronic device specifically implements the above method will not be described in detail here. Any electronic device used by those skilled in the art to implement the above method falls within the scope of protection of this application.
[0052] This application also proposes a computer-readable storage medium, such as... Figure 8 As shown, the computer-readable storage medium 500 stores a computer program B511, which, when executed by a processor, performs the following steps: The original PIV particle image is subjected to minimum value filtering with a window of a preset size to obtain the background, and the background is removed from the original PIV particle image. Normalize the image after removing the background; The normalized image is processed to generate an initial mask; Extract the outline of the initial mask; The contour of the extracted initial mask is fitted with polygons to generate the first mask; Based on the vertices of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to generate the final mask.
[0053] Optionally, when the computer program B511 is executed by the processor, it can implement any of the embodiments corresponding to the above method.
[0054] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0055] The embodiments of this application are as follows: Figure 1 Taking the original PIV particle image shown as an example, its mask is automatically generated using the method proposed in the embodiments of this application. The specific process is as follows: The original PIV particle image is subjected to minimum value filtering and background removal to obtain the following result: Figure 9 The image shown; Then, normalization and standard deviation filtering are performed to obtain, as shown below. Figure 10 The image shown is from Figure 10 It can be seen that the portion of the area to be occluded that is illuminated by the laser has extremely high grayscale values and a large gradient, resulting in a large standard deviation and appearing white; while the unilluminated portion has no tracer particles distributed within it, has lower grayscale values and a smaller gradient, resulting in a smaller standard deviation and appearing black. These two portions together constitute the area to be occluded, and the standard deviation of the tracer particle region lies between these two portions. Then, binarization is performed to obtain, as shown below. Figure 11 The image shown; Then, image erosion, image dilation, and image filling processes are performed to obtain the following result: Figure 12 The image shown; Next, the contour of the initial mask is extracted. The extracted contour of the initial mask is as follows: Figure 13 As shown; Then, polygon fitting is performed on the contour of the initial mask to obtain the first mask, as shown below. Figure 14 As shown in the embodiment of this application, the number of polygon vertices is 14, that is, the initial mask is converted into a 14-sided polygon; Finally, combining the vertices (14) of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to generate the final mask, as shown below. Figure 15 As shown.
[0056] In addition, Figure 15 The final mask shown is overlaid on the original PIV particle image (e.g.) Figure 16 (Middle left figure), the final calculated velocity field is as follows Figure 16 The right-hand image shows that, compared to Figure 3 Compared with the mask generated by existing technical solutions and the velocity field calculated subsequently, the mask generated in this embodiment is closer to the wall of the test model, and the velocity field calculated subsequently contains more near-wall velocity vectors, resulting in higher accuracy.
[0057] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0058] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0059] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0060] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0061] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for automatically generating PIV particle image masks, characterized in that, include: Minimum filtering is applied to the original PIV particle image to obtain the background, and the background is then removed from the original PIV particle image. The image after removing the background is normalized. The normalized image is processed to generate an initial mask; Extract the contour of the initial mask; The extracted contour of the initial mask is fitted with polygons to generate the first mask; Based on the vertices of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to generate the final mask; The extraction of the contour of the initial mask includes: The initial mask is convolved using two orthogonal convolution kernels to obtain the horizontal and vertical convolution values of each pixel. The total convolution value of the pixel is then calculated based on the horizontal and vertical convolution values of each pixel. Determine whether the total convolution value of each pixel is greater than the contour threshold. If it is, then the pixel is the contour point of the initial mask. The set of all contour points is the contour of the initial mask; The aforementioned polygon fitting of the extracted contour of the initial mask includes: The contour points of the initial mask are sorted in a clockwise or counterclockwise order; Find the two points that are farthest apart from the sorted contour points, and denote them as follows: and The straight line formed by these two points is denoted as . These two points divide the contour of the initial mask into two curve segments, denoted as . and ; Then respectively in and Find the distance The farthest point is denoted as and At this time, the vertices of the polygon are... , , and It consists of four points, and the straight line formed by these four points is denoted as follows: , , and These four points divide the contour of the initial mask into four curve segments, denoted as follows: , , and Similarly, iteratively find the point on the curve segment that is farthest from the corresponding straight line and merge it into the polygon until the number of vertices of the polygon is greater than or equal to the number of vertices of the polygon to be fitted.
2. The method for automatically generating a PIV particle image mask according to claim 1, characterized in that, The normalization process for the image after removing the background includes: Divide the gray value of each pixel in the image by the maximum gray value of the image and then multiply by 255.
3. The method for automatically generating a PIV particle image mask according to claim 1, characterized in that, The processing of the normalized image includes: The image is filtered using standard deviation to distinguish between the tracer particle region and the region to be occluded; The image after standard deviation filtering is binarized to convert the image from grayscale format to binary format; Morphological processing is performed on the binarized image to generate an initial mask.
4. The method for automatically generating a PIV particle image mask according to claim 3, characterized in that, The binarization process of the image after standard deviation filtering includes: Two thresholds are set, namely a first threshold and a second threshold; the first threshold and the second threshold are determined based on the grayscale distribution of the image. Pixels with gray values less than the first threshold and gray values greater than the second threshold are assigned a value of 1, and the remaining pixels are assigned a value of 0.
5. The method for automatically generating a PIV particle image mask according to claim 3, characterized in that, The aforementioned morphological processing of the binarized image includes: The image is subjected to image erosion, image dilation, and image filling processing. The image erosion process is used to remove image noise outside the area to be occluded. The image dilation process is used to connect the boundaries of the areas to be occluded. The image filling process is used to fill holes in the area to be occluded; The connected component with the largest area is then retained as the initial mask.
6. The method for automatically generating a PIV particle image mask according to claim 1, characterized in that, The step of performing piecewise polynomial fitting on the contour of the initial mask based on the vertices of the first mask includes: The vertices of the first mask divide the contour of the initial mask into a finite number of curve segments; By combining the vertices of the first mask, a piecewise polynomial fit is performed on the contour of the initial mask to smooth its boundaries and generate the final mask. The polynomial fitting employs first-order and second-order polynomial fitting.
7. An apparatus for automatically generating a PIV particle image mask, used to implement the method for automatically generating a PIV particle image mask according to any one of claims 1-6, characterized in that, include: A filtering unit is used to perform minimum value filtering on the original PIV particle image to obtain the background and remove the background from the original PIV particle image; A normalization unit is used to normalize the image after removing the background; The image processing unit is used to process the normalized image and generate an initial mask; A contour extraction unit is used to extract the contour of the initial mask; A fitting unit is used to perform polygon fitting on the extracted contour of the initial mask to generate a first mask; And a smoothing unit, used to perform piecewise polynomial fitting on the contour of the initial mask based on the vertices of the first mask to generate the final mask.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1-6.
Citation Information
Patent Citations
Anti-counterfeiting image detection device and method, electronic equipment and storage medium
CN118262224A
