Target measurement method, device, computer device and medium
The method uses deep learning and digital signal processing to enhance the precision and efficiency of target dimension measurement by segmenting and analyzing target regions in images, addressing the inefficiencies of existing methods.
Patent Information
- Application Number
- CN202210309682.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-03-28
AI Technical Summary
The existing target size measurement methods have problems with low measurement efficiency and low accuracy in display panel testing, especially when measuring the dimension information of transparent frame glue.
The deep learning network is used to perform binary processing on the image to be tested, and the contour data of the target area is extracted through the Burrito-Net and U-Net networks, and the size information of the target area is determined in combination with digital signal processing technology.
The accuracy and efficiency of target measurement are improved, and the dimension information of transparent frame adhesive can be determined more accurately.
Smart Images

Figure CN114757986B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of measurement and testing. More specifically, it relates to a target measurement method, device, computer device and medium. Background Art
[0002] Currently, there is a need for target size measurement in many test scenarios. For example, in the scenario of display panel testing, it is necessary to measure whether the size information of the strip-shaped optically clear adhesive (OCA) used for bonding the film layer meets the requirements, such as the coating width. Existing measurement methods, such as those based on target edge detection to determine target size information, have problems such as low measurement efficiency and low measurement accuracy. Summary of the Invention
[0003] The purpose of the present invention is to provide a target measurement method, device, computer device and medium to solve at least one of the problems existing in the prior art.
[0004] To achieve the above purpose, the present invention adopts the following technical solutions:
[0005] The first aspect of the present invention provides a target measurement method, including:
[0006] Performing binarization processing on a to-be-tested image containing a target to obtain a binarized image, where the binarized image includes a background region and a target region, and the target region extends to at least two image boundaries of the binarized image;
[0007] Performing digital signal processing on the binarized image to obtain contour data of the target region, and determining size information of the target region according to the contour data and the binarized image.
[0008] Further, the performing binarization processing on a to-be-tested image containing a target to obtain a binarized image includes: performing binarization processing on the to-be-tested image by using a trained Burrito-Net network;
[0009] The performing binarization processing on the to-be-tested image by using a trained Burrito-Net network further includes:
[0010] Inputting the to-be-tested image containing a target into a stacking layer of the Burrito-Net network, and the stacking layer splits and fills the to-be-tested image to obtain a multi-channel feature map, where the multi-channel feature map includes a plurality of row image blocks of the to-be-tested image stacked in sequence;
[0011] Input the multi-channel feature map output by the stacking layer into the extraction layer of the Burrito-Net network, and the extraction layer performs convolutional extraction on the multi-channel feature map and outputs a multi-layer feature map;
[0012] Input the multi-layer feature map output by the stacking layer into the expansion layer of the Burrito-Net network, and the expansion layer expands the multi-layer feature map to obtain the binary image.
[0013] Furthermore, the process that the stacking layer obtains the multi-channel feature map after splitting and padding the image to be measured further includes:
[0014] Traverse each row image of the image to be measured in sequence;
[0015] Fill the pixel values of each row image into an image block with a preset side length in sequence, where the unfilled pixel values in the image block are 0;
[0016] Stack the image blocks of all filled row images to generate a multi-channel feature map.
[0017] Furthermore, the extraction layer includes:
[0018] The first convolutional neural network, which includes at least two serially connected first convolutional neural network modules;
[0019] The residual network connected in series with the first convolutional neural network, which includes multiple serially connected residual modules;
[0020] The second convolutional neural network connected in series with the residual network, which includes at least two serially connected second convolutional neural network modules.
[0021] Furthermore, the process that the expansion layer expands the multi-layer feature map to obtain the binary image further includes:
[0022] Decode the single-layer feature map of each layer of the multi-layer feature map to obtain the image blocks of all filled row images;
[0023] Expand the image blocks of all filled row images into the row images of each row of the image to be measured respectively;
[0024] Stack the row images of each row to generate the binary image.
[0025] Furthermore, the process of obtaining the binary image by performing binary processing on the image to be measured containing the target further includes: performing binary processing on the image to be measured by using the trained U-Net network.
[0026] Further, the digital signal processing of the binary image to obtain the contour data of the target region, and determining the size information of the target region according to the contour data and the binary image further includes:
[0027] Search for the contour of the target region in the binary image to obtain the contour data of the target region;
[0028] Classify the contour data to obtain first contour data located at the first boundary of the target region and second contour data located at the second boundary of the target region, wherein the contour where the target region extends to the image boundary of the binary image forms the first boundary and the second boundary parallel to the first boundary;
[0029] Determine the size information of the target region according to the first contour data and the second contour data.
[0030] Further, the determining the size information of the target region according to the first contour data and the second contour data further includes:
[0031] Interpolate the first contour data and the second contour data so that the first contour data of the interpolated first boundary corresponds one-to-one to the second contour data of the interpolated second boundary;
[0032] Calculate the second distance between the corresponding first contour data and second contour data respectively to obtain a second distance set including a plurality of second distances;
[0033] Determine the size information of the target region according to the maximum second distance, the minimum second distance and the average second distance in the second distance set.
[0034] Further, the digital signal processing of the binary image to obtain the contour data of the target region, and determining the size information of the target region according to the contour data and the binary image further includes:
[0035] Perform dilation and erosion operation processing on the binary image respectively;
[0036] Obtain third contour data located at the third boundary of the target region and fourth contour data located at the fourth boundary of the target region according to the dilated binary image and the eroded binary image, wherein the contour where the target region extends to the image boundary of the binary image forms the third boundary and the fourth boundary parallel to the third boundary;
[0037] Fitting one of the third contour data and the fourth contour data to obtain a reference slope, and fitting the other contour data according to the reference slope, so as to determine the dimension information of the target area according to the fitted other contour data.
[0038] Further, fitting one of the third contour data and the fourth contour data to obtain a reference slope, and fitting the other contour data according to the reference slope, so as to determine the dimension information of the target area includes:
[0039] Select one of the third contour data or the fourth contour data to be fitted into a linear third boundary or fourth boundary after fitting, and the slope of the first-fitted third boundary or first-fitted fourth boundary obtained after fitting is the reference slope;
[0040] Using the reference slope to fit the other of the third contour data or the fourth contour data to obtain a later-fitted fourth boundary or later-fitted third boundary;
[0041] Determining the dimension information of the target area according to the third distance between the first-fitted third boundary and the later-fitted fourth boundary or the first-fitted fourth boundary and the later-fitted third boundary, and according to the contour data corresponding to the later-fitted fourth boundary or the later-fitted third boundary.
[0042] Further, the digital signal processing of the binary image to obtain the contour data of the target area, and determining the dimension information of the target area according to the contour data and the binary image further includes:
[0043] Performing dilation and erosion operation processing on the binary image respectively;
[0044] Obtaining fifth contour data of a fifth boundary located in the target area and sixth contour data of a sixth boundary located in the target area according to the dilated binary image and the eroded binary image, wherein the contour where the target area extends to the image boundary of the binary image forms the fifth boundary and the sixth boundary parallel to the fifth boundary;
[0045] Fitting the fifth contour data and the sixth contour data respectively, and determining the dimension information of the target area according to the fitted fifth contour data, the fitted sixth contour data, and according to the pixel value change in the binary image.
[0046] Further, the fitting the fifth contour data and the sixth contour data respectively, and determining the dimension information of the target area according to the fitted fifth contour data, the fitted sixth contour data, and according to the pixel value change in the binary image further includes:
[0047] Respectively fit the fifth contour data and the sixth contour data to obtain a linear fifth boundary and a sixth boundary;
[0048] Rotate the binary image according to the slope of the fifth boundary or the sixth boundary;
[0049] Scan the rotated binary image line by line, and determine the size information of the target area according to the change of pixel values in the binary image.
[0050] The second aspect of the present invention provides a target measurement device, including:
[0051] A to-be-measured image processing module, configured to perform binarization processing on a to-be-measured image including a target to obtain a binary image, where the binary image includes a background area and a target area, and the target area extends to at least two image boundaries of the binary image;
[0052] A size information determination module, configured to perform digital signal processing on the binary image to obtain contour data of the target area, and determine the size information of the target area according to the contour data and the binary image.
[0053] The third aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method provided by the first aspect of the present invention is implemented.
[0054] The fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method provided by the first aspect of the present invention is implemented.
[0055] The beneficial effects of the present invention are as follows:
[0056] The technical solution of the present invention, by performing binarization processing on a to-be-measured image including a target to obtain a binary image including a background area and a target area, and determining the size information of the target area by performing digital signal processing on the binary image in combination with contour data scanning, can effectively improve the target measurement accuracy and measurement efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The following further describes in detail the specific embodiments of the present invention with reference to the accompanying drawings.
[0058] Figure 1 A flowchart showing the target measurement method according to an embodiment of the present invention;
[0059] Figure 2 A schematic diagram showing a to-be-measured image according to an embodiment of the present invention;
[0060] Figure 3 Schematic diagram showing the binarized image obtained by the processing according to the embodiment of the present invention;
[0061] Figure 4a Schematic diagram showing the structure of the Burrito-Net network according to the embodiment of the present invention;
[0062] Figure 4b Schematic diagram showing the structure of the extraction layer according to the embodiment of the present invention;
[0063] Figure 5 Schematic diagram showing the flow of "performing binarization processing on the to-be-tested image by using the trained Burrito-Net network" according to an embodiment of the present invention;
[0064] Figure 6 Schematic diagram showing the flow of step S11 according to an embodiment of the present invention;
[0065] Figure 7 Schematic diagram showing the flow of step S13 according to an embodiment of the present invention;
[0066] Figure 8 Schematic diagram showing the structure of the U-Net network according to an embodiment of the present invention;
[0067] Figure 9 Schematic diagram showing the flow of step S2 according to the first embodiment of the present invention;
[0068] Figure 10 Schematic diagram showing the binarized image placed in a preset coordinate system according to the embodiment of the present invention;
[0069] Figure 11 Schematic diagram showing the contour coordinates numbered 310 - 320 during the contour scanning according to the embodiment of the present invention;
[0070] Figure 12 Schematic diagram showing the embodiment of the present invention Figure 11 The contour coordinates numbered 310 - 320 in the embodiment form distribution points in the coordinate system after being imaged;
[0071] Figure 13 Schematic diagram showing the flow of step S23 according to the first embodiment of the present invention;
[0072] Figure 14 Schematic diagram showing the flow of step S2 according to the second embodiment of the present invention;
[0073] Figure 15 Schematic diagram showing the flow of step S23 according to the second embodiment of the present invention;
[0074] Figure 16 Schematic diagram showing the embodiment of the present invention Figure 12Schematic diagram of the contour after fitting the third boundary in
[0075] Figure 17 showing an embodiment of the present invention Figure 12 Schematic diagram of the contour after fitting the binary image shown
[0076] Figure 18 Schematic flowchart showing step S2 of the third embodiment of the present invention
[0077] Figure 19 Schematic flowchart showing step S23 of the third embodiment of the present invention
[0078] Figure 20 Schematic diagram of the frame structure of the target measurement device showing another embodiment of the present invention
[0079] Figure 21 Schematic diagram of the structure of a computer device showing another embodiment of the present invention Detailed implementation manners
[0080] To more clearly illustrate the present invention, the present invention will be further described below in conjunction with embodiments and drawings. Similar components in the drawings are denoted by the same reference numerals. Those skilled in the art should understand that the content specifically described below is illustrative rather than restrictive, and should not be used to limit the protection scope of the present invention.
[0081] In scenarios such as display panel testing, it is necessary to measure whether the dimensional information of the strip-shaped optically clear adhesive (OCA) used for the bonding film layer meets the requirements, such as the width of the coated sealant. Existing measurement methods such as determining target dimensional information based on target edge detection have problems such as low measurement efficiency and low measurement accuracy.
[0082] Currently, the rapid development of machine learning has enabled various machine learning models to be applied in a variety of business scenarios. Deep learning collects prior data, performs fitting operations on complex functions based on past experience, and then applies them. Its training convergence speed is relatively fast and can handle complex situations.
[0083] In view of this, an embodiment of the present invention provides a target measurement method based on deep learning and digital signal processing technology to improve target measurement accuracy and measurement efficiency.
[0084] As Figure 1 shown, a target measurement method provided by an embodiment of the present invention includes:
[0085] S1. Binarize the test image containing the target to obtain a binarized image, where the binarized image includes a background region and a target region, and the target region extends to at least one or two image boundaries of the binarized image;
[0086] S2. Perform digital signal processing on the binarized image to obtain contour data of the target region, and determine size information of the target region based on the contour data and the binarized image.
[0087] In this embodiment, a deep learning network is used to improve the feature accuracy of the binarized image, and the size information of the target region is determined by performing digital signal processing on the binarized image. The entire process is a target measurement method based on deep learning and digital signal processing technologies, which can effectively improve the target measurement accuracy and measurement efficiency.
[0088] In a possible implementation manner, the target of the embodiment of the present invention is a strip-shaped optically clear adhesive (OCA) for bonding a film layer. In the related art, the sealant is formed between two relatively arranged substrates and has an annular structure. Figure 2 The test image including the sealant coated on the display panel is shown. The test image containing the target can be obtained by an image acquisition device such as an industrial camera on the test line to acquire an image of the region where the sealant is coated on the display panel. As Figure 2 shown, the test image includes a sealant coating region, i.e., the target region, and a non-sealant coating region, such as a border region.
[0089] As Figure 2 shown, the entire coating width of the sealant and a part of the sealant length extending in the vertical direction form the sealant coating region, i.e., the target region. The part of the sealant extending in the vertical direction extends to the upper and lower boundaries of the test image. That is, the target region extends to at least two image boundaries of the test image. The size information measured in the embodiment of the present invention is the distance between the two extended boundaries, that is, the width dimension of the sealant, which is also the size information of the target region to be determined in this embodiment.
[0090] In a specific example, the display device including the display panel can be any product or component with a display function, such as an electronic paper, a mobile phone, a tablet computer, a television, a monitor, a laptop computer, a digital photo frame, a navigator, etc.
[0091] Based on the above application scenario and the description of the test image containing the target as shown in Figure 2 In an optional embodiment, as shown in Figure 1 the following steps are included:
[0092] S1. Binarize the test image containing the target to obtain a binarized image.
[0093] In an optional embodiment, the binarized image includes a background region and a target region, and the target region extends to at least two image boundaries of the binarized image.
[0094] In the embodiment of the present invention, the binarized image obtained after binarization processing is as Figure 3 shown, where the black region is the background region, corresponding to the region where the sealing frame glue is not coated, and the white region is the coating region of the sealing frame glue, that is, the target region, as Figure 3 shown. The target region extends to the upper and lower image boundaries of the binarized image. The size parameter of the target region to be determined in the embodiment of the present invention is the distance between the two extension sides that vertically extend to the image boundaries of the binarized image in the target region, and is also the width of the target region.
[0095] In an optional embodiment, step S1 "Binarize the test image containing the target to obtain a binarized image" includes: performing binarization processing on the test image using the trained Burrito-Net network (folding network).
[0096] As Figure 4a shown, the Burrito-Net network in this embodiment includes: a stacking layer, an extraction layer, and an expansion layer connected in series in sequence. Exemplarily, the input of the stacking layer is Figure 2 the test image containing the target shown, and the output is a multi-channel feature map obtained by splitting and padding. The input of the extraction layer is the multi-channel feature map output by the stacking layer, and the extraction layer can output multiple layers of feature maps after feature extraction. The input of the expansion layer is the multiple layers of feature maps output by the extraction layer, and a binarized image as Figure 3 shown is obtained through decoding and expansion.
[0097] Further, based on the Figure 4a Burrito-Net network shown, in an optional embodiment, as Figure 5 shown, this step "Perform binarization processing on the test image using the trained Burrito-Net network" further includes:
[0098] S11. Input the test image containing the target into the stacking layer of the Burrito-Net network. The stacking layer splits and pads the test image to obtain a multi-channel feature map, and the multi-channel feature map includes multiple row image blocks of the test image stacked in sequence.
[0099] In an optional embodiment, as Figure 6As shown, step S11, "the stacking layer splits and fills the image to be measured to obtain a multi-channel feature map", further includes:
[0100] S111. Traverse the row images of each row of the image to be measured in sequence.
[0101] Exemplarily, the image length of the image to be measured is λ. In this embodiment, the length direction of the image is the extension direction from the left boundary to the right boundary of the target area, that is, the row direction. Therefore, a row image corresponding to a row in the image to be measured has λ pixel values. According to the row scanning order of the image to be measured from top to bottom, the image to be measured can be disassembled into n row images, and the image direction of each row image is the same as the length direction of the image to be measured.
[0102] S112. Fill the pixel values of each row image into an image block with a preset side length in sequence, and the pixel values not filled in the image block are 0.
[0103] Exemplarily, the preset side length of the image block in this embodiment is obtained according to the image length λ of the image to be measured. For example, the preset side length is obtained by taking the square root of the image length. That is to say, the preset side length is where using the method of rounding up. For example, when λ is 9, the length of the image block to be filled is 3*3. Another example is that when λ is 8, the length of the image block to be filled is still taking the length of the image block as 3*3.
[0104] Taking the row image of the first row of the image to be measured as an example, this row image includes λ pixel values, and all the pixels of this row image are filled into the image block. Exemplarily, when λ is 9, the 3*3 image block can fill all the pixel values in this row image without any vacant image block. In another example, when λ is 8, the number of pixel values in this row image is less than the number of filling areas in the image block, and there will be a vacancy in one filling area of the image block. In this case, the pixel values not filled in the image block are 0.
[0105] S113. Stack the image blocks of all the filled row images to generate a multi-channel feature map.
[0106] Furthermore, after all row images are filled using this filling method, the image blocks corresponding to all row images are obtained. Stacking all the image blocks forms a multi-channel feature map, which can retain all the features of the image to be measured and effectively ensure the measurement accuracy.
[0107] S12. Input the multi-channel feature maps output by the stacking layer into the extraction layer of the Burrito-Net network. The extraction layer performs convolutional extraction on the multi-channel feature maps and outputs multi-layer feature maps.
[0108] In an alternative embodiment, as Figure 4b shown, the extraction layer includes:
[0109] A first convolutional neural network, which includes at least two cascaded first convolutional neural network modules, and performs first feature extraction through the first convolutional neural network;
[0110] A residual network (ResNet) cascaded with the first convolutional neural network. The residual network includes multiple cascaded residual modules (ResNet Block). On the basis of the first feature extraction by the first convolutional neural network, the residual network, which is easier to optimize, further increases the depth of feature extraction, thereby improving the accuracy of feature extraction;
[0111] A second convolutional neural network cascaded with the residual network. The second convolutional neural network includes at least two cascaded second convolutional neural network modules. After being optimized by the residual network, the second convolutional neural network further extracts the optimized features to obtain multi-layer feature maps. Among them, each layer of feature maps corresponds to a channel feature map, which also corresponds to a row image, so as to achieve accurate extraction of all features of the image to be measured.
[0112] It should be noted that the embodiments of the present invention do not limit the number of the first convolutional neural network modules cascaded with the specific first convolutional network, nor the number of the residual modules cascaded with the residual network, nor the number of the second convolutional neural network modules cascaded with the second convolutional network. Those skilled in the art can design according to actual applications and will not be elaborated here.
[0113] S13. Input the multi-layer feature maps output by the stacking layer into the expansion layer of the Burrito-Net network. The expansion layer expands the multi-layer feature maps to obtain the binary image.
[0114] In this embodiment, the expansion layer takes the multi-layer feature maps as input, expands each layer of 1*1 feature maps into row images with a size of 1*λ, and expands the feature maps of each layer into single-row images in the order of stacking to form a binary image corresponding to the image to be measured. That is to say, the process executed by the expansion layer in this embodiment is the reverse operation of the stacking layer, so as to restore the multi-layer feature maps to a binary image.
[0115] In an alternative embodiment, as Figure 7As shown, step S13, "The expansion layer expands the multi-layer feature map to obtain the binary image", further includes:
[0116] S131. Decode the single-layer feature map of each layer of the multi-layer feature map to obtain image blocks of all the filled row images.
[0117] Exemplarily, the single-layer feature map is 1*1, and the size of the image block of the row image obtained after decoding is
[0118] S132. Expand the image blocks of all the filled row images into row images of each row of the image to be measured respectively.
[0119] Exemplarily, expanding and restoring the image block can obtain the row image of each row in this embodiment, and the size of this row image is 1*λ.
[0120] S133. Stack the row images of each row to generate the binary image.
[0121] What is obtained through the above steps is the row image of each row. After decoding and expanding the single-layer feature map of the multi-layer feature map in steps S131 and S132, the row images of all rows of the image to be measured can be obtained, and after stacking, a binary image including all the features of the image to be measured can be obtained.
[0122] In another optional embodiment, performing binary processing on the image to be measured including the target to obtain the binary image further includes: performing binary processing on the image to be measured by using a trained U-Net network.
[0123] In a specific example, the U-Net network is a trained U-Net network. The image set of the training samples includes multiple images with the image of the transparent sealing glue of a display panel as the target. Inputting the image including the transparent sealing glue of the display panel into the trained U-Net network, a binary image is output, for example, the area of the transparent sealing glue of the display panel is 1, and the background area except the area of the transparent sealing glue of the display panel is 0.
[0124] Among them, the network structure of the U-Net network is U-shaped, such as Figure 8As shown, its essence is an improved fully convolutional neural network (FCN). The U-Net network includes an encoder network 801 for downsampling and a decoder network 802 for upsampling. The input image is repeatedly convolved and shrunk by the encoder network 801 to obtain multiple feature maps, and then repeatedly deconvolved and enlarged by the decoder network 802. During this process, it is also concatenated with multiple corresponding feature maps of the encoder network 801 to combine deep and shallow features, refine the image, so as to obtain features on different dimensions of the input image, and further improve the effects of image segmentation and target recognition. Among them, if the sizes of the two feature maps to be concatenated are different, after copying the corresponding feature map of the encoder network 801, it needs to be cropped and then transmitted to the decoder network 802 for concatenation.
[0125] As Figure 8 shown, in this example:
[0126] In the order from shallow to deep, the encoder network 801 includes three downsampling layers, and the decoder network 802 includes three upsampling layers. It should be noted that the number of downsampling layers and the number of upsampling layers are not limited to three, but the number of downsampling layers and the number of upsampling layers should be the same.
[0127] Between the encoder network 801 and the decoder network 802, three feature propagation layers 8031, 8032, and 8033 are established in the order from shallow to deep ( Figure 8 from top to bottom on the left in ).
[0128] It should be noted that the U-Net network may also include a classification layer (not shown in the figure) after the decoder network 802. By setting a classifier, the probability that the pixel points in the corresponding feature map (FeatureMap) of the image data belong to different categories can be calculated, so as to realize the category prediction of the pixel points in the corresponding feature map of the image data, and thus perform pixel point classification, that is, image segmentation, to realize target recognition.
[0129] For the encoder network 801, the feature extraction of image data can be performed through several three downsampling layers, and the feature maps obtained by feature extraction are transmitted to the decoder network 802 via the three feature propagation layers 8031, 8032, and 8033.
[0130] Specifically, in this example, the downsampling layer includes two convolutional layers and one pooling layer, and the pooling layer is a max pooling layer. The image data is input into the shallowest downsampling layer of the encoder network 801 ( Figure 8 the uppermost on the left in ), and the input image data is convolved by the shallowest downsampling layer (such as Figure 8As shown, after two convolutions, the feature map corresponding to the shallowest downsampling layer is obtained, and after downsampling processing (max pooling downsampling processing), it is input to the second shallowest downsampling layer.
[0131] In the order from shallow to deep ( Figure 8 from top to bottom on the left in
[0132] Between the encoder network 801 and the decoder network 802, the feature propagation of the above-mentioned feature maps is respectively carried out through the feature propagation layers 8031, 8032, and 8033.
[0133] After the output of the deepest downsampling layer undergoes convolution processing ( Figure 8 shown by the horizontal hollow arrow at the bottom in Figure 8 the feature map is directly transmitted to the deepest upsampling layer in the decoder network 802 (
[0134] shown by the upward solid arrow at the bottom right in
[0135] Among them, as the encoder network level deepens, in the feature extraction of image data, it gradually abstracts from local description to global description, and then more accurately describes the image data, which is beneficial to ensuring the accuracy of image segmentation.
[0136] For the decoder network 802, not only does it perform feature extraction of image data through several upsamplings, but also it performs feature fusion on the image data.
[0137] Specifically, in this example, the first upsampling layer (the deepest upsampling layer) includes a transposed convolution layer (transpose convolution is also called deconvolution, or up-convolution), and the other upsampling layers include a transposed convolution layer and two convolution layers. The deepest upsampling layer performs transposed convolution upsampling processing on the feature map obtained after the output of the deepest downsampling layer undergoes convolution processing, to obtain the first feature map to be fused.
[0138] The first feature map to be fused is input to the second deepest upsampling layer, and after being fused with the feature map corresponding to the deepest downsampling layer transmitted through the transmission layer 8033, convolution processing is performed (such as Figure 8 shown as two convolutions) to obtain the second feature map to be fused.
[0139] In the order from deep to shallow ( Figure 8From the right bottom to the top on the right side, traverse the other two upsampling layers to obtain the feature maps corresponding to the traversed upsampling layers.
[0140] After completing the traversal, obtain the feature map corresponding to the image data from the feature map corresponding to the shallowest upsampling layer.
[0141] In the decoder network 802, the horizontal hollow arrows represent the convolution processing performed by the convolutional layer, and the upward solid arrows represent the transposed convolution upsampling processing performed by the transposed convolutional layer.
[0142] Through the above process, by combining the encoder network and the decoder network, not only is the computational complexity of image segmentation effectively reduced, which is beneficial to improving the segmentation efficiency, but also the accuracy of image segmentation is fully guaranteed.
[0143] That is to say, those skilled in the art can either choose to use the trained U-Net network of the embodiment of the present invention to perform binarization processing on the to-be-tested image, or choose to use the trained Burrito-Net network of the embodiment of the present invention to perform binarization processing on the to-be-tested image, so as to obtain a binarized image for subsequent processing of contour data.
[0144] S2. Perform digital signal processing on the binarized image to obtain the contour data of the target area, and determine the size information of the target area according to the contour data and the binarized image.
[0145] In an optional embodiment, as Figure 9 shown, step S2 "Perform digital signal processing on the binarized image to obtain the contour data of the target area, and determine the size information of the target area according to the contour data and the binarized image" further includes:
[0146] S21. Search for the contour of the target area in the binarized image to obtain the contour data of the target area.
[0147] In an example, this step obtains the contour of the target area in the binarized image through contour search technology. Exemplarily, place the binarized image in a preset coordinate system. Among them, in Figure 10 , the target area includes two target area boundaries extending to the boundaries of the binarized image, that is, the left boundary (the first boundary) and the right boundary (the second boundary) of the target area. The distance between the first boundary and the second boundary of the target area is the size information of the target area determined in this embodiment. The intersections of the left and right boundaries of the target area with the upper and lower boundaries of the binarized image form the upper and lower boundaries of the target area. The size information of the target area in this embodiment is also the length size of the upper boundary or the lower boundary of the target area.
[0148] FromFigure 10 As shown, the X direction of the preset coordinate system in this embodiment is the extending direction of the first boundary and the second boundary of the target area, and the Y direction of the preset coordinate system is the direction from the first boundary to the second boundary. In this coordinate system, the contour of the target area can be described by coordinate points. In a specific example, taking the contour point located in the upper left corner of the target area as the starting contour point, the contour coordinates are recorded in a clockwise direction (dashed line shown in the figure) until the contour of the target area is completely recorded, and the contour coordinates are used as the contour data. That is to say, a large amount of contour data is obtained after contour scanning. These contour data are numerous and complex. According to the scanning order of the contour data, it can roughly represent the approximate shape of the target area. When restoring the contour, the target area formed by connecting all the said contour data in the scanning order is a closed figure. For example Figure 10 the contour of the target area shown is approximately rectangular.
[0149] In a specific example, Figure 11 shows the contour coordinates with serial numbers 310 - 319 during the contour scanning process. It should be noted that since the dimension information measured in the embodiment of the present invention is the dimension between the first boundary and the second boundary, and the contour data located on the upper boundary and the lower boundary of the target area is not required in the whole process, therefore, this embodiment can omit the contour data located on the upper boundary and the lower boundary of the target area, and retain the contour data of the intersection points of the adjacent two boundaries, that is, the contour inflection points, so as to eliminate the complicated contour data. This method can improve the measurement efficiency and facilitate the subsequent classification processing according to the obtained contour data.
[0150] S22. Classify the said contour data to obtain the first contour data located on the first boundary of the target area and the second contour data located on the second boundary of the target area, where the contour of the target area extending to the image boundary of the binary image forms the first boundary and the second boundary parallel to the first boundary.
[0151] In a specific example, Figure 11 the distribution points of the contour coordinates with serial numbers 310 - 319 in [[ ]] in the coordinate system after being imaged are as shown in [[ ]] Figure 12 shown, and from [[ ]] Figure 12 and the binary image [[ ]] Figure 10 shown, based on the characteristic that the boundary of the target area in the binary image extends to the opposite boundary of the binary image, when the contour coordinate points corresponding to two pieces of contour data are on different boundaries of the target area, the distance between the coordinate points of these two pieces of contour data is relatively far. Therefore, in this embodiment, by classifying the contour data and judging the contour points belonging to different boundaries of the target area, the contour data located on different boundaries can be accurately distinguished in terms of position, thereby improving the measurement accuracy of the dimension information of the target area.
[0152] In one example, the step S22 "classify the contour data to obtain first contour data located on the first boundary of the target region and second contour data located on the second boundary of the target region" further includes:
[0153] Classify the attribution boundaries of the contour data according to the first distance between two pieces of contour data, and classify all the contour data into data on the first boundary and data on the second boundary, so as to perform boundary fitting based on the contour data on each classified boundary later. Through the classification of the contour data in this step, the fitting accuracy can be improved, thereby improving the boundary fitting accuracy of the target region.
[0154] In a specific example, the calculation method of Manhattan distance can be used to determine the first distance between two pieces of contour data. Figure 12 As can be seen, when two pieces of contour data are located on the first boundary and the second boundary respectively, the first distance between them is relatively large. As Figure 12 shown, among the contour data numbered 310 - 319, the third piece of contour data and the fourth piece of contour data are located on different boundaries. That is to say, after the classification of the contour data in this step, the contour data between the 310th contour data and the 312th contour data are classified into the first boundary of the target region (as Figure 12 shown by the left dotted line in Figure 12 ), and the contour data between the 313th contour data and the 319th contour data are classified into the second boundary of the target region (as Figure 12 shown by the right dotted line in Figure 12 ).
[0155] S23. Determine the size information of the target region according to the first contour data and the second contour data.
[0156] In an alternative embodiment, as Figure 13 shown, the step S23 "determine the size information of the target region according to the first contour data and the second contour data" further includes:
[0157] S231. Interpolate the first contour data and the second contour data so that the first contour data of the first boundary after interpolation correspond one-to-one to the second contour data of the second boundary after interpolation.
[0158] In this embodiment, since the contour tortuosity degrees of the first boundary and the second boundary are different, after the contour data boundary classification, the number of contour data owned by each boundary will be different. Therefore, in order to improve the measurement accuracy, this embodiment performs coordinate interpolation on the contour data of the first boundary and the contour data of the second boundary, so that the number of contour data of the first boundary is equal to the number of contour data of the second boundary, realizing the one-to-one correspondence between the first contour data of the first boundary and the second contour data of the second boundary, and then determining the subsequent size information.
[0159] Exemplarily, as Figure 12 shown, the first boundary includes 3 contour data points, and the second boundary includes 7 contour data points. Exemplarily, the 310th point of the first boundary corresponds to point A' of the second boundary after interpolation, and the 319th point of the second boundary corresponds to point B' of the second boundary after interpolation. After interpolation, the number of contour data of the first boundary is the same as that of the second boundary, and a one-to-one correspondence is achieved between each contour data point of the first boundary and each contour data point of the second boundary.
[0160] S232. Calculate the second distance between the corresponding first contour data and the second contour data respectively to obtain a second distance set including a plurality of second distances.
[0161] Based on the corresponding first contour data and second contour data obtained in the previous step, the contour points in the first boundary and the second boundary are in one-to-one correspondence. Calculate the second distance between each set of corresponding first contour data and second contour data in turn. Exemplarily, as Figure 12 shown, calculate the second distance between the 319th point of the second boundary and point B' of the second boundary after interpolation. For another example, calculate the second distance between the 310th point of the first boundary and point A' of the second boundary after interpolation.
[0162] S233. Determine the size information of the target area according to the maximum second distance, the minimum second distance and the average second distance in the second distance set.
[0163] Based on the second distance set obtained in the above step S232, determine the relationship between the size information Q of the target area and each second distance in the second distance set according to the following formula:
[0164]
[0165] where x i is the second distance corresponding to the i-th contour data point, max(x i ) is the maximum second distance in the second distance set formed by the second distances x i , min(x i ) is the minimum second distance in the second distance set, and mean(x i ) is the average second distance obtained from each second distance in the second distance set.
[0166] Based on the above formula, the size information of the target area of this embodiment can be obtained. If the obtained size information meets the preset size information threshold α, that is, when Q < α, it can be determined that the size information of the current target area meets the design requirements.
[0167] In this embodiment, in step S1, a deep learning network is used to improve the feature accuracy of the binary image. In step S2, the size information of the target region is determined by contour scanning, contour data edge classification, data interpolation, etc. of the target region of the binary image. The entire process is a target measurement method based on deep learning and digital signal processing technology, which can effectively improve the target measurement accuracy and measurement efficiency.
[0168] Based on the binary image obtained in step S1, the embodiment of the present invention proposes another solution for determining the size information of the target region.
[0169] In another alternative embodiment, as Figure 14 shown, step S2 "performing digital signal processing on the binary image to obtain the contour data of the target region, and determining the size information of the target region according to the contour data and the binary image" further includes:
[0170] S21. Performing dilation and erosion operation processing on the binary image respectively.
[0171] Exemplarily, taking the binary image obtained in step S1 as the input, performing dilation operation on the input binary image to obtain a dilated binary image, and performing erosion operation on the input binary image to obtain an eroded binary image. The dilation operation is a process of merging the images of all background regions in contact with the target region into the target region, so that the boundary of the target region expands outward. The dilation operation can be used to fill the holes in the target region. The erosion operation is a process of eliminating the boundary points of the target region, so that the boundary of the target region shrinks inward.
[0172] S22. Obtaining the third contour data of the third boundary located in the target region and the fourth contour data of the fourth boundary located in the target region according to the dilated binary image and the eroded binary image, wherein the contour of the target region extending to the image boundary of the binary image forms the third boundary and the fourth boundary parallel to the third boundary.
[0173] After subtracting the dilated binary image from the eroded binary image, the edge pixel points of the strip-shaped third boundary and the strip-shaped fourth boundary can be obtained. In this embodiment, the third boundary is Figure 12 the left boundary extending to both sides of the binary image shown, and the fourth boundary is Figure 12 the right boundary extending to both sides of the binary image shown. That is to say, the first, second, third, and fourth in this embodiment only distinguish the left and right boundaries corresponding to different embodiments.
[0174] It should be noted that the third boundary and the fourth boundary obtained by subtracting the dilation and erosion in this embodiment are strip-shaped, which is different from the linear boundary in the previous embodiment of the present invention. The contours of the third boundary and the fourth boundary obtained based on this method are more accurate.
[0175] S23. Fit one of the third contour data and the fourth contour data to obtain a reference slope, and fit the other contour data according to the reference slope, so as to determine the size information of the target area according to the fitted other contour data.
[0176] In an alternative embodiment, as Figure 15 shown, step S23 "Fit one of the third contour data and the fourth contour data to obtain a reference slope, and fit the other contour data according to the reference slope, so as to determine the size information of the target area according to the fitted other contour data" includes:
[0177] S231. Select one of the third contour data or the fourth contour data to be fitted to obtain a linear third boundary or fourth boundary after fitting, and the slope of the first-fitted third boundary or the first-fitted fourth boundary that is linear after fitting is the reference slope.
[0178] In this embodiment, based on the edge pixel regions of the strip-shaped third boundary and the strip-shaped fourth boundary, the contour data represented by coordinate sequences of the third boundary and the fourth boundary are respectively obtained by using contour search. After fitting the strip-shaped third boundary by the least squares method, a linear third boundary can be obtained. Similarly, after fitting the strip-shaped fourth boundary by the least squares method, a linear fourth boundary can be obtained, so as to determine the size information according to the linear third boundary and the linear fourth boundary.
[0179] Exemplarily, taking the third boundary as an example, the linear third boundary after fitting is as Figure 16 shown, as Figure 16 shown, the contour of the target area is uneven, and a linear third boundary with a slope is obtained after fitting. In this embodiment, as Figure 16 shown, the slope of the linear third boundary after fitting is used as the reference slope.
[0180] In another example, the fourth boundary can also be fitted first, and the slope of the linear fourth boundary after fitting is used as the reference slope. That is to say, the embodiments of the present invention do not limit which specific third boundary and fourth boundary are selected for fitting, and those skilled in the art can design according to actual applications, which will not be elaborated here.
[0181] S232. Use the reference slope to fit the other one of the third contour data or the fourth contour data to obtain the post-fitted fourth boundary or the post-fitted third boundary.
[0182] Exemplarily, as Figure 17 shown, after obtaining the pre-fitted third boundary, the slope of the third boundary is K1. Using this slope K1 as the reference slope, perform a linear fit on the contour data of the other fourth boundary to obtain the post-fitted fourth boundary parallel to the pre-fitted third boundary. Then, the slope K2 of the post-fitted fourth boundary obtained after fitting is the same as the reference slope K1.
[0183] In another example, if the fourth boundary is pre-fitted first, then fit the third boundary according to the reference slope K2 of the pre-fitted fourth boundary to obtain the post-fitted third boundary K1.
[0184] S233. Determine the size information of the target area according to the third distance between the pre-fitted third boundary and the post-fitted fourth boundary or the pre-fitted fourth boundary and the post-fitted third boundary, and according to the contour data corresponding to the post-fitted fourth boundary or the post-fitted third boundary.
[0185] Since the two post-fitted third boundary and fourth boundary are designed to be parallel, therefore, the third distance between the two post-fitted third boundary and fourth boundary with the same slope is constant. Taking the case of pre-fitting the third boundary first and then post-fitting the fourth boundary as an example, since the fourth boundary is fitted according to the slope of the third boundary, there will be an error between the fourth boundary obtained by fitting according to the reference slope and the contour data of the fourth boundary. As Figure 17 shown, the distances between the coordinate points corresponding to the contour data of different fourth boundaries and the fourth boundary are not the same. Therefore, while ensuring that the third distance remains unchanged, it is possible to judge the distribution of the contour of the boundary according to the distance between the contour data of the post-fitted boundary and this boundary, so as to determine the size information of the target area.
[0186] Exemplarily, determine the third distance and the size information Q of the target area according to the following formula:
[0187]
[0188] where d is the third distance between the two post-fitted parallel third boundary and fourth boundary, and L i is the fourth distance between the i-th contour data point and the contour data of the post-fitted fourth boundary from the post-fitted fourth boundary, or is the fourth distance between the contour data of the post-fitted third boundary from the post-fitted third boundary.
[0189] Exemplarily, each contour data can be measured in sequence to obtain the size information of the target area at the current position corresponding to each contour data, so as to obtain the result of whether the current size information meets the design requirements. Further, since there is a large amount of contour data for the fourth boundary, in order to improve the measurement efficiency, in this embodiment, an average fourth distance can also be obtained on the basis of determining the size information of the target area for each contour data, and the overall size information of the target area can be determined according to the average fourth distance. In a specific example, if the obtained size information meets the preset size information threshold α, that is, when Q < α, it can be determined that the size information of the current target area meets the design requirements.
[0190] In another specific example, the fourth distances corresponding to each contour data can also be formed into a fourth distance set, and the following formula can be used to determine the relationship between the size information Q and each fourth distance in the fourth distance set:
[0191]
[0192] where (distanceLi) is the fourth distance set corresponding to the i-th contour data point, max(distanceLi) is the maximum fourth distance in the fourth distance set, min9distanceLi) is the minimum fourth distance in the fourth distance set, and mean(distanceLi) is the average fourth distance obtained from each fourth distance in the fourth distance set.
[0193] In this embodiment, step S1 uses a deep learning network to improve the feature accuracy of the binary image. In step S2, the size information of the target area is determined by means of contour scanning of the target area of the binary image, successive fitting of the contour boundaries, and comparison of the contour data with the fitted boundaries. The entire process is a target measurement method based on deep learning and digital signal processing technology, which can effectively improve the target measurement accuracy and measurement efficiency.
[0194] The present invention also proposes a method for determining the target size in another embodiment. In another alternative embodiment, as Figure 18 shown, step S2 "performing digital signal processing on the binary image to obtain the contour data of the target area, and determining the size information of the target area according to the contour data and the binary image" further includes:
[0195] S21. Performing dilation and erosion operation processing on the binary image respectively.
[0196] Exemplarily, this embodiment still uses the binary image obtained in step S1 as the input, performs dilation operation on the input binary image to obtain a dilated binary image, and further, performs erosion operation on the input binary image to obtain an eroded binary image.
[0197] S22. Obtain fifth contour data of the fifth boundary located in the target area and sixth contour data of the sixth boundary located in the target area from the dilated binary image and the eroded binary image, wherein the contours of the target area extending to the image boundary of the binary image form the fifth boundary and the sixth boundary parallel to the fifth boundary.
[0198] The process of this step can refer to the process of determining the third boundary and the fourth boundary in the previous embodiment. That is, after subtracting the dilated binary image from the eroded binary image, the edge pixel points of the strip-shaped fifth boundary and the strip-shaped sixth boundary can be obtained.
[0199] In this embodiment, the fifth boundary is Figure 12 the left boundary extending to both sides of the binary image as shown, and the sixth boundary is Figure 12 the right boundary extending to both sides of the binary image as shown. The fifth boundary and the sixth boundary obtained by the difference between dilation and erosion in this embodiment are strip-shaped, and the contours of the fifth boundary and the sixth boundary obtained based on this method are more accurate.
[0200] S23. Fit the fifth contour data and the sixth contour data respectively, and determine the size information of the target area according to the fitted fifth contour data, the fitted sixth contour data, and the pixel value change in the binary image.
[0201] In an alternative embodiment, as Figure 19 shown, this step S23, "Fit the fifth contour data and the sixth contour data respectively, and determine the size information of the target area according to the fitted fifth contour data, the fitted sixth contour data, and the pixel value change in the binary image" further includes:
[0202] S231. Fit the fifth contour data and the sixth contour data respectively to obtain a linear fifth boundary and a linear sixth boundary.
[0203] In this embodiment, based on the edge pixel regions of the strip-shaped fifth boundary and the strip-shaped sixth boundary, the contour data of the fifth boundary and the sixth boundary represented by coordinate sequences are obtained by using contour search respectively. After fitting the strip-shaped fifth boundary by the least squares method, a linear third boundary can be obtained. Similarly, after fitting the strip-shaped sixth boundary by the least squares method, a linear fourth boundary can be obtained, so as to determine the size information of the target area according to the linear fifth boundary and the linear sixth boundary.
[0204] Different from the method of "sequentially fitting the third boundary and the fourth boundary" used in the previous embodiment, this embodiment does not limit the fitting order and fitting slope of the fifth boundary and the sixth boundary. That is, the slopes of the fifth boundary and the sixth boundary after fitting in this embodiment can be different, and this fitting method can obtain a more accurate fitting result.
[0205] S232. Rotate the binarized image according to the slope of the fifth boundary or the sixth boundary.
[0206] On the basis of obtaining the fifth boundary and the sixth boundary with different slopes, in this embodiment, the first angle between the slope and the vertical direction is calculated with the slope of the fifth boundary. Similarly, the second angle between the slope and the vertical direction is calculated with the slope of the sixth boundary, and the binarized image is rotated and corrected using the first angle or the second angle.
[0207] In one embodiment, the rotation angle of the binarized image can be the first angle, the second angle, or the average value of the first angle and the second angle. Those skilled in the art can select a suitable angle according to the actual application to rotate the binarized image so that the fifth boundary and the sixth boundary of the target area in the binarized image are in a vertical state to improve the measurement accuracy.
[0208] S233. Scan the rotated binarized image line by line, and determine the size information of the target area according to the change of pixel values in the binarized image.
[0209] The rotated binarized image obtained through the above steps is in a vertically placed state as a whole, that is, the fifth boundary and the sixth boundary are in a vertical state. In this state, the horizontal abscissa distance between the fifth boundary and the sixth boundary can be equivalent to the size information of the target area at the current position. That is to say, the horizontal abscissa distance between the fifth boundary and the sixth boundary in each line of the binarized image is equivalent to the size information of the target area in that line of the binarized image. Exemplarily, the coordinates in this embodiment use the Y-axis as the horizontal coordinate.
[0210] Therefore, by utilizing the characteristic of the single change of the gray value of the binarized image, the rotated binarized image is scanned line by line. During the scanning process, if the pixel value changes, it means that the current scanning position changes from the target area to the background area or from the background area to the target area. The size information can be obtained by recording the change position.
[0211] In a specific example, when the black pixel value in the background area is scanned, it is recorded as 0, and when the white pixel value in the target area is scanned, it is recorded as 1. When the pixel value changes from 0 to 1, it means that the scanning position is at the junction of the background area and the target area and this position is the starting point of the target area in the current row. Similarly, when the pixel value changes from 1 to 0, it means that the scanning position is at the junction of the background area and the target area and this position is the end point of the target area in the current row. The pixel value distance between two pixel value changes is the size information of the target area in the current row.
[0212] Furthermore, the pixel value distances corresponding to the pixel value changes obtained by scanning row by row form a scanning distance set. Based on the maximum pixel value distance, the minimum pixel value distance, and the average pixel distance value, the overall size information of the target area can be determined.
[0213] Exemplarily, the relationship between the size information Q of the target area and each pixel value distance in the scanning distance set is determined according to the following formula:
[0214]
[0215] where (w n ) is the pixel value distance corresponding to the binary image of the nth row, (w n ) is the scanning distance set formed by the pixel value distances corresponding to the binary image of the nth row, max(w n ) is the maximum pixel value distance in the scanning distance set, min(w n ) is the minimum pixel value distance in the scanning distance set, and mean(w n ) is the average pixel value distance obtained from each pixel value distance in the scanning distance set.
[0216] Based on the above formula, the size information of the target area in this embodiment can be obtained. If the obtained size information meets the preset size information threshold α, that is, when Q < α, it can be determined that the size information of the current target area meets the design requirements.
[0217] In this embodiment, step S1 uses a deep learning network to improve the feature accuracy of the binary image. In step S2, the size information of the target area is determined by contour scanning, contour boundary fitting, rotation correction, pixel value scanning, etc. of the target area of the binary image. The whole process is a target measurement method based on deep learning and digital signal processing technology, which can effectively improve the target measurement accuracy and measurement efficiency.
[0218] The above embodiments of the present invention illustrate different ways to determine the size information of the target area based on the binary image obtained from the deep learning network. Those skilled in the art can select the corresponding way for design according to the actual application, which will not be elaborated here.
[0219] As Figure 20 shown, another embodiment of the present invention provides a target measurement device, comprising:
[0220] A to-be-measured image processing module, configured to perform binarization processing on a to-be-measured image including a target to obtain a binarized image, wherein the binarized image includes a background region and a target region, and the target region extends to at least two image boundaries of the binarized image;
[0221] A size information determination module, configured to perform digital signal processing on the binarized image to obtain contour data of the target region, and determine size information of the target region according to the contour data and the binarized image.
[0222] The target measurement device of the present invention uses a deep learning network to improve the feature accuracy of the binarized image, and determines the size information of the target region by performing digital signal processing on the binarized image. The entire process is a target measurement method based on deep learning and digital signal processing technologies, which can effectively improve the target measurement accuracy and measurement efficiency.
[0223] It should be noted that the principle and working process of the target measurement device provided in this embodiment are similar to those of the above target measurement method. For the related parts, reference can be made to the above description and will not be elaborated here.
[0224] As Figure 21 shown, another embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it realizes: performing binarization processing on a to-be-measured image including a target to obtain a binarized image, wherein the binarized image includes a background region and a target region, and the target region extends to at least two image boundaries of the binarized image; performing digital signal processing on the binarized image to obtain contour data of the target region, and determining size information of the target region according to the contour data and the binarized image.
[0225] In practical applications, the computer-readable storage medium may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
[0226] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
[0227] The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0228] The computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0229] As Figure 21As shown, a schematic structural diagram of a computer device provided by another embodiment of the present invention. Figure 21 The computer device 12 shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0230] As Figure 21 shown, the computer device 12 is presented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0231] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0232] The computer device 12 typically includes a variety of computer system-readable media. These media can be any available media accessible by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0233] The system memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 34 can be used to read and write non-removable, non-volatile magnetic media ( Figure 9 not shown, commonly referred to as a "hard disk drive"). Although Figure 9 not shown in the figure, a disk drive for reading and writing removable non-volatile disks (such as "floppy disks") and an optical disk drive for reading and writing removable non-volatile optical disks (such as CD-ROM, DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data media interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0234] A program / utilities 40 having a set (at least one) of program modules 42 can be stored, for example, in a memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.
[0235] The computer device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the computer device 12, and / or communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface 22. Moreover, the computer device 12 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As Figure 21 shown, the network adapter 20 communicates with other modules of the computer device 12 through a bus 18. It should be understood that although Figure 21 not shown in the figure, other hardware and / or software modules can be used in combination with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0236] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a target measurement method provided by an embodiment of the present invention.
[0237] It should also be noted that in the description of the present invention, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0238] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, rather than limitations on the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation manners here. Any obvious changes or modifications derived from the technical solutions of the present invention still fall within the protection scope of the present invention.
Claims
1. A target measurement method, characterized in that, Including: Performing binarization processing on a to-be-tested image including a target to obtain a binarized image, where the binarized image includes a background region and a target region, and the target region extends to at least two image boundaries of the binarized image; Performing digital signal processing on the binarized image to obtain contour data of the target region, and determining size information of the target region according to the contour data and the binarized image; The performing binarization processing on the to-be-tested image including a target to obtain a binarized image includes: performing binarization processing on the to-be-tested image by using a trained Burrito-Net network; The performing binarization processing on the to-be-tested image by using a trained Burrito-Net network further includes: Inputting the to-be-tested image including a target into a stacking layer of the Burrito-Net network, and the stacking layer splits and fills the to-be-tested image to obtain a multi-channel feature map, and the multi-channel feature map includes multiple row image blocks of the to-be-tested image stacked in sequence; Inputting the multi-channel feature map output by the stacking layer into an extraction layer of the Burrito-Net network, and the extraction layer performs convolutional extraction on the multi-channel feature map and outputs a multi-layer feature map; Inputting the multi-layer feature map output by the stacking layer into an expansion layer of the Burrito-Net network, and the expansion layer expands the multi-layer feature map to obtain the binarized image.
2. The method according to claim 1, wherein The stacking layer splitting and filling the to-be-tested image to obtain a multi-channel feature map further includes: Traversing the row images of each row of the to-be-tested image in sequence; Filling the pixel values of each row image into image blocks with a preset side length in sequence, where the pixel values not filled in the image blocks are 0; Stacking the image blocks of all the filled row images to generate a multi-channel feature map.
3. The method according to claim 2, characterized in that, The extraction layer includes: A first convolutional neural network, and the first convolutional neural network includes at least two serially connected first convolutional neural network modules; A residual network serially connected to the first convolutional neural network, and the residual network includes multiple serially connected residual modules; A second convolutional neural network serially connected to the residual network, and the second convolutional neural network includes at least two serially connected second convolutional neural network modules.
4. The method according to claim 3, wherein The expansion layer expanding the multi-layer feature map to obtain the binarized image further includes: Decoding the single-layer feature map of each layer of the multi-layer feature map to obtain the image blocks of all the filled row images; Expanding the image blocks of all the filled row images into the row images of each row of the to-be-tested image respectively; Stacking the row images of each row to generate the binarized image.
5. The method according to any one of claims 1 to 4, characterized in that The performing digital signal processing on the binarized image to obtain contour data of the target region, and determining size information of the target region according to the contour data and the binarized image further includes: Searching for the contour of the target region in the binarized image to obtain the contour data of the target region; Classify the contour data to obtain first contour data located at the first boundary of the target region and second contour data located at the second boundary of the target region, where the contours of the target region extending to the image boundary of the binary image form the first boundary and the second boundary parallel to the first boundary; Determine the size information of the target region according to the first contour data and the second contour data.
6. The method according to claim 5, wherein The determining the size information of the target region according to the first contour data and the second contour data further includes: Interpolate the first contour data and the second contour data so that the first contour data of the interpolated first boundary corresponds one-to-one to the second contour data of the interpolated second boundary; Calculate the second distances between the corresponding first contour data and second contour data respectively to obtain a second distance set including a plurality of second distances; Determine the size information of the target region according to the maximum second distance, the minimum second distance and the average second distance in the second distance set.
7. The method according to any one of claims 1 to 4, characterized in that The performing digital signal processing on the binary image to obtain the contour data of the target region and determining the size information of the target region according to the contour data and the binary image further includes: Perform dilation and erosion operation processing on the binary image respectively; Obtain third contour data located at the third boundary of the target region and fourth contour data located at the fourth boundary of the target region according to the dilated binary image and the eroded binary image, where the contours of the target region extending to the image boundary of the binary image form the third boundary and the fourth boundary parallel to the third boundary; Fit one of the third contour data and the fourth contour data to obtain a reference slope, and fit the other contour data according to the reference slope, so as to determine the size information of the target region according to the fitted other contour data.
8. The method according to claim 7, wherein Fitting one of the third contour data and the fourth contour data to obtain a reference slope, and fitting the other contour data according to the reference slope, so as to determine the size information of the target region according to the fitted other contour data includes: Select one of the third contour data or the fourth contour data to be fitted to obtain a linear third boundary or fourth boundary, and the slope of the first-fitted third boundary or fourth boundary obtained by fitting is the reference slope; Use the reference slope to fit the other of the third contour data or the fourth contour data to obtain the later-fitted fourth boundary or later-fitted third boundary; Determine the size information of the target region according to the third distance between the first-fitted third boundary and the later-fitted fourth boundary or the first-fitted fourth boundary and the later-fitted third boundary, and according to the contour data corresponding to the later-fitted fourth boundary or the later-fitted third boundary.
9. The method according to any one of claims 1 to 4, characterized in that The performing digital signal processing on the binary image to obtain the contour data of the target region and determining the size information of the target region according to the contour data and the binary image further includes: Perform dilation and erosion operation processing on the binary image respectively; Obtain fifth contour data of the fifth boundary located in the target area and sixth contour data of the sixth boundary located in the target area according to the dilated binary image and the eroded binary image, wherein the contour of the target area extending to the image boundary of the binary image forms the fifth boundary and the sixth boundary parallel to the fifth boundary; Fit the fifth contour data and the sixth contour data respectively, and determine the size information of the target area according to the fitted fifth contour data, the fitted sixth contour data, and the change of pixel values in the binary image.
10. The method according to claim 9, wherein The step of respectively fitting the fifth contour data and the sixth contour data, and determining the size information of the target area according to the fitted fifth contour data, the fitted sixth contour data, and the change of pixel values in the binary image further includes: Fit the fifth contour data and the sixth contour data respectively to obtain a linear fifth boundary and a sixth boundary; Rotate the binary image according to the slope of the fifth boundary or the sixth boundary; Scan the rotated binary image line by line, and determine the size information of the target area according to the change of pixel values in the binary image.
11. An object detection device for executing the method according to any one of claims 1 to 10, characterized in that, The device includes: A to-be-tested image processing module, configured to perform binary processing on a to-be-tested image including a target to obtain a binary image, wherein the binary image includes a background area and a target area, and the target area extends to at least two image boundaries of the binary image; A size information determination module, configured to perform digital signal processing on the binary image to obtain contour data of the target area, and determine the size information of the target area according to the contour data and the binary image.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method according to any one of claims 1 to 10.
13. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Crystal material image recognition method and device
CN110414492A