A method, device and equipment for positioning the gap of a pallet, and a readable storage medium

By performing dynamic threshold segmentation and computational processing on the blobs image, the effective bright area is extracted and cropped, which solves the problem of incomplete and missing blobs gap images, improves detection accuracy, and ensures the accuracy of blobs gap localization.

CN115578410BActive Publication Date: 2026-04-24HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
Filing Date
2022-10-14
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing technologies, incomplete, missing, or contaminated images of the gap between the plaster pieces lead to low detection accuracy.

Method used

By performing dynamic threshold segmentation on the image to be detected, the first dark area and bright area are extracted, resulting parameters are generated, and the gap region of the film is determined by cropping and filtering the effective bright area. Combined with rectangular and circular operations, interference is eliminated and detection accuracy is improved.

Benefits of technology

It effectively eliminates interference from incomplete and missing images of the plaster gap, improves detection accuracy, reduces the impact of noise and dirt, and ensures the accuracy of plaster gap positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115578410B_ABST
    Figure CN115578410B_ABST
Patent Text Reader

Abstract

The application discloses a kind of tablet gap positioning method, device, equipment and readable storage medium, applied to image detection field, the method comprises: to the dynamic threshold segmentation processing of to-be-detected image, generate result parameter;Select the maximum bright area with the region center above second parameter, and the region center is above first parameter, generate fifth parameter;Select the effective bright area between second parameter and fifth parameter with area greater than area threshold value, as second bright area;Select the maximum area region in the maximum width value in second bright area, as third bright area, according to the left boundary line and right boundary line of third bright area to to-be-detected image is cut and carries out dynamic threshold segmentation processing, obtain second dark area, according to second parameter and fifth parameter screening second dark area, determine tablet gap positioning area.The application is processed by dynamic threshold segmentation to image, avoids the interference caused by tablet gap image incompleteness, tablet gap missing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection, and in particular to a method, apparatus, device, and readable storage medium for locating gaps in images. Background Technology

[0002] Existing methods for image detection of shavings (including shaving size detection and shaving defect detection) mainly rely on the precise positioning of shavings based on 2D images.

[0003] Because of the significant differences in the imaging of plaques themselves, the precise localization of plaques is easily affected by incomplete or missing images of the plaque gaps, or the plaque gap images being connected to contaminants. Therefore, the precise localization of plaque gaps can lead to severe over- and under-detection, thus affecting detection accuracy. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, device and readable storage medium for locating the gap between plaster pieces, which solves the technical problems of incomplete plaster gap images, interference caused by missing plaster gaps, and low detection accuracy of plaster gaps in related technologies.

[0005] To solve the above-mentioned technical problems, the present invention provides a method for locating the gap between plasmids, comprising:

[0006] The acquired image to be detected is subjected to dynamic threshold segmentation to extract the first dark region and generate result parameters; wherein, the result parameters include a first parameter, a second parameter, a third parameter and a fourth parameter; wherein, the first parameter is the upper boundary line of the first dark region, and the second parameter, the third parameter and the fourth parameter are the upper boundary line, the left boundary line and the right boundary line of the inscribed rectangle of the largest first dark region, respectively;

[0007] The image to be detected is subjected to dynamic threshold segmentation. A first bright region whose center coordinates are above the second parameter is selected. If the center coordinates of the first bright region are above the first parameter, the first bright region is taken as the first maximum bright region. If the center coordinates of the first bright region are below the first parameter, the image to be detected is cropped according to the third and fourth parameters to obtain the image to be detected. The dynamic threshold segmentation process on the image to be detected is repeated, and the step of selecting the first bright region whose center coordinates are above the second parameter according to the result parameters is executed again to obtain the first maximum bright region and generate the fifth parameter. The fifth parameter is the lower boundary line of the rectangle inscribed in the first maximum bright region.

[0008] The image to be detected is subjected to dynamic threshold segmentation processing. Effective bright regions whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold are selected as the second bright region.

[0009] The width feature value of the second bright region is filtered to obtain the maximum width value. The largest area region with the width feature of the maximum width value is selected as the third bright region. The image to be detected is cropped according to the left and right boundary lines of the third bright region to obtain the second image to be detected.

[0010] The second image to be detected is subjected to dynamic threshold segmentation to obtain a second dark region. The second dark region is then filtered according to the second parameter and the fifth parameter to determine the localization region of the plaster gap.

[0011] Optionally, the step of filtering the second dark region based on the second parameter and the fifth parameter to determine the plaque gap region includes:

[0012] The second dark region is subjected to a rectangular closing operation to obtain a third dark region. The third dark region is subjected to a region connectivity operation to obtain a first connected region. The coordinates of the first connected region are obtained. The coordinates of the connected region between the second parameter and the fifth parameter in the first connected region are selected as the coordinates of the second connected region.

[0013] Obtain the minimum point in the coordinates of the second connected region, and select a connected region that is at a preset distance from the minimum point as the second connected region;

[0014] Select the region with the largest area in the second connected region as the final region;

[0015] The connected region containing the final region in the first connected region is selected as the plate gap positioning region.

[0016] Optionally, the step of performing dynamic thresholding segmentation on the image to be detected, and selecting a first bright region with center coordinates above the second parameter, includes:

[0017] The image to be detected is subjected to dynamic threshold segmentation to obtain a fourth brightness region;

[0018] The fourth bright region is subjected to a circular opening operation to obtain the fifth bright region;

[0019] The fifth bright region is filled to obtain the sixth bright region;

[0020] The region whose center coordinates are above the second parameter in the sixth bright region is selected as the first bright region.

[0021] Optionally, the step of performing dynamic threshold segmentation on the image to be detected, selecting an effective bright region whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold, as the second bright region, includes:

[0022] The image to be detected is subjected to dynamic threshold segmentation to obtain a fourth dark region;

[0023] The fourth dark region is subjected to a rectangular closing operation based on preset closing parameters to obtain the fifth dark region;

[0024] Performing an inverse difference operation on the fifth dark region yields the seventh bright region;

[0025] The region whose center coordinates are between the second parameter and the fifth parameter, and whose area is greater than the area threshold, is selected as the eighth bright region;

[0026] The effective bright region in the eighth bright region is selected as the second bright region.

[0027] Optionally, selecting the effective bright region in the eighth bright region as the second bright region includes:

[0028] Determine whether the number of the eighth bright region is zero;

[0029] If so, adjust the preset closing operation parameters and re-execute the step of performing rectangular closing operation on the fourth dark region according to the preset closing operation parameters;

[0030] If not, then the eighth bright region shall be taken as the second bright region.

[0031] Optionally, the step of performing dynamic threshold segmentation on the acquired image to be detected, extracting the first dark region, and generating result parameters includes:

[0032] The image to be detected is subjected to dynamic threshold segmentation to obtain the sixth dark region;

[0033] The sixth dark region is subjected to a rectangular closing operation to obtain the seventh dark region;

[0034] The seventh dark domain is processed by connected component analysis to obtain the first dark domain, and result parameters are generated.

[0035] Optionally, before performing dynamic thresholding processing on the acquired image to be detected, extracting the first dark region, and generating the result parameters, the method further includes:

[0036] Obtain the original image;

[0037] The original image is subjected to mean smoothing to obtain the image to be detected.

[0038] The present invention also provides a device for positioning the gap between plaster pieces, comprising:

[0039] The result parameter generation module is used to perform dynamic threshold segmentation processing on the acquired image to be detected, extract the first dark region, and generate result parameters; wherein, the result parameters include a first parameter, a second parameter, a third parameter, and a fourth parameter; wherein, the first parameter is the upper boundary line of the first dark region, the second parameter is the upper boundary line of the inscribed rectangle of the largest first dark region, the third parameter is the left boundary line of the inscribed rectangle of the largest first dark region, and the fourth parameter is the right boundary line of the inscribed rectangle of the largest first dark region;

[0040] The fifth parameter generation module is used to perform dynamic thresholding processing on the image to be detected sequentially, select a first bright region whose center coordinates are above the second parameter, if the center coordinates of the first bright region are above the first parameter, then the first bright region is taken as the first maximum bright region, if the center coordinates of the first bright region are below the first parameter, then the image to be detected is cropped according to the third parameter and the fourth parameter, and the step of performing dynamic thresholding processing on the image to be detected is re-executed, and the first bright region whose center coordinates are above the second parameter is selected according to the result parameter to obtain the first maximum bright region and generate the fifth parameter; wherein, the fifth parameter is the lower boundary line of the rectangle inscribed in the first maximum bright region;

[0041] The second brightness region selection module is used to perform dynamic threshold segmentation processing on the image to be detected, and select an effective bright region whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold as the second brightness region.

[0042] The image to be detected cropping module is used to filter the width feature value of the second bright region to obtain the maximum width value, select the largest area region whose width feature is the maximum width value as the third bright region, and crop the image to be detected according to the left boundary line and right boundary line of the third bright region to obtain the second image to be detected.

[0043] The patch gap confirmation module is used to perform dynamic threshold segmentation on the second image to be detected to obtain a second dark area, and to filter the second dark area according to the second parameter and the fifth parameter to determine the patch gap positioning area.

[0044] The present invention also provides a device for positioning the gap between plates, comprising:

[0045] Memory, used to store computer programs;

[0046] A processor is used to execute the computer program to implement the steps of the above-described method for locating the gap between the plates.

[0047] The present invention also provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described method for positioning the gap between the plates.

[0048] As can be seen, this invention extracts a first dark region by performing dynamic thresholding on the acquired image to be detected, and generates result parameters, which include a first parameter, a second parameter, a third parameter, and a fourth parameter. The first parameter is the upper boundary line of the first dark region, and the second, third, and fourth parameters are the upper, left, and right boundary lines of the inscribed rectangle of the largest first dark region, respectively. During dynamic thresholding of the image to be detected, a first bright region with its center coordinates above the second parameter is selected. If the center coordinates of the first bright region are above the first parameter, then the first bright region is taken as the first largest bright region. If the center coordinates of the first bright region are below the first parameter, then the image to be detected is cropped according to the third and fourth parameters, and the dynamic thresholding process is repeated. The step of selecting the first bright region with its center coordinates above the second parameter based on the result parameters is then executed again to obtain the first largest bright region, generating a fifth parameter, which is the lower boundary line of the inscribed rectangle of the first largest bright region. Dynamic thresholding is performed on the image to be detected. A valid bright region with center coordinates between the second and fifth parameters and an area greater than the area threshold is selected as the second bright region. The width feature value of the second bright region is filtered to obtain the maximum width value. The largest area region with the maximum width feature value is selected as the third bright region. The image to be detected is cropped according to the left and right boundary lines of the third bright region to obtain the second image to be detected. Dynamic thresholding is performed on the second image to obtain the second dark region. The second dark region is filtered according to the second and fifth parameters to determine the location region of the banded gap. This invention extracts the first dark region, first bright region, and second bright region from the acquired image to be detected through dynamic thresholding. Result parameters and the fifth parameter are generated from the first dark region and first bright region to determine the location of the banded gap. This eliminates interference caused by incomplete or missing banded gap images. The method of cropping the image to be detected by the largest area region within the maximum width of the second bright region eliminates errors caused by the connection between the banded gap and the base. Opening and closing operations eliminate interference caused by dirt in the banded gap, solving the problem of low detection accuracy of the banded gap.

[0049] In addition, the present invention also provides a plaque gap positioning device, equipment and readable storage medium, which also have the above-mentioned beneficial effects. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0051] Figure 1 A flowchart of a method for locating the gap between plaster pieces provided in an embodiment of the present invention;

[0052] Figure 2 A flowchart illustrating a method for selecting the maximum bright area above a second parameter, as provided in an embodiment of the present invention;

[0053] Figure 3 A flowchart of a second brightness region selection method provided in an embodiment of the present invention;

[0054] Figure 4 A flowchart of a method for determining the plaque gap region by filtering a second dark area based on a second parameter and a fifth parameter, provided in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of a plate gap positioning device provided in an embodiment of the present invention;

[0056] Figure 6 This is a schematic diagram of a plate gap positioning device provided in an embodiment of the present invention. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] Please refer to Figure 1 , Figure 1 A flowchart illustrating a method for locating the gap between plasmids, provided in an embodiment of the present invention. The method may include:

[0059] S101: Perform dynamic thresholding on the acquired image to be detected, extract the first dark region, and generate result parameters.

[0060] The execution subject of this embodiment is a terminal. This embodiment does not limit the type of terminal, as long as it can perform the method for locating the gap between the segments. For example, it can be a general-purpose terminal or a dedicated terminal. Specifically, it can be a mobile phone, laptop, server, etc. The result parameters in this embodiment include a first parameter, a second parameter, a third parameter, and a fourth parameter. The first parameter is the upper boundary line of the first dark region, and the second, third, and fourth parameters are the upper boundary line, left boundary line, and right boundary line of the rectangle inscribed in the largest first dark region, respectively. This embodiment does not limit the method of acquiring the image to be detected, as long as the image to be detected can be acquired in a timely manner. For example, the terminal can actively acquire the image to be detected, or the terminal can passively receive the image to be detected. It should be noted that the number of first dark regions in this embodiment is not limited; for example, it can be one or two.

[0061] Furthermore, to reduce the impact of image quality on the localization results and improve the accuracy of extracting the first dark region, the above-mentioned dynamic threshold segmentation processing of the acquired image to be detected, extraction of the first dark region, and generation of result parameters may include the following steps:

[0062] The image to be detected is subjected to dynamic threshold segmentation to obtain the sixth dark region;

[0063] Perform a rectangular closing operation on the sixth dark region to obtain the seventh dark region;

[0064] The seventh dark domain is processed to obtain the first dark domain, and the result parameters are generated.

[0065] In this embodiment, dynamic threshold segmentation is performed on the image to be detected. That is, the threshold for threshold segmentation of the image to be detected is not fixed. The optimal threshold is automatically matched according to the image for segmentation, which can extract the sixth dark region in the image to be detected more accurately.

[0066] Performing a rectangular closing operation on the sixth dark region can bridge the small gaps in the dark region between the film fragments, accurately capturing the dark region. This embodiment does not limit the setting values ​​of the length and width of the rectangular structural region used for the rectangular closing operation on the sixth dark region. The length and width of the rectangular structural region are parameter values ​​for the rectangular closing operation, as long as they can bridge the small gaps in the dark region between the film fragments. For example, the rectangular structural region can be 10 pixels wide and 100 pixels long; it can also be 9 pixels wide and 110 pixels long. It should be noted that the setting values ​​of the length and width of the rectangular structural region in this embodiment are based on the actual situation of the film fragment gaps. In this embodiment, a rectangular structural region with a width of 10 pixels and a length of 100 pixels is set according to the actual situation of the film fragment gaps. In this embodiment, the length of the rectangular structural region can be the same as the horizontal rectangular structural region's pixel value, and the width can be the same as the vertical rectangular structural region's pixel value; this embodiment does not limit this.

[0067] Furthermore, to reduce the impact of noise and contaminants in the plaster gap image and improve the accuracy of plaster gap localization, before performing dynamic threshold segmentation on the acquired image to be detected, extracting the first dark region, and generating the result parameters, the following steps may also be included:

[0068] Obtain the original image;

[0069] The original image is smoothed by mean to obtain the image to be detected.

[0070] In this embodiment, the original image is acquired and then subjected to mean smoothing to obtain the image to be detected. This effectively filters out relevant noise and dirt and burrs between the plate gap and the base. This embodiment does not limit the setting value of the mask parameters for mean smoothing the original image. For example, the length and width of the mask parameters can be set to 20 pixels, 15 pixels, or 25 pixels.

[0071] This embodiment does not limit the acquisition frequency of the original image, as long as the original image to be processed can be acquired in a timely manner. For example, acquisition can be performed in real time, that is, the next acquisition operation is performed immediately after the previous acquisition operation is completed; or acquisition operations can be performed at preset acquisition time intervals. This embodiment does not limit the setting value of the preset acquisition time interval, for example, it can be 1 second, 2 seconds, or 5 seconds.

[0072] S102: Perform dynamic thresholding on the image to be detected, and select the first bright area above the second parameter by selecting the center coordinates of the region.

[0073] In this embodiment, the number of first bright regions whose center coordinates are above the second parameter is not limited. For example, it can be one or two, as long as the center coordinates of the selected regions are above the second parameter.

[0074] Furthermore, in order to accurately extract the bright region after dynamic thresholding and reduce interference from dirt spots in the image, the above-mentioned dynamic thresholding process for the image to be detected, selecting the first bright region with the center coordinates above the second parameter, may include the following steps, for details please refer to Figure 2 , Figure 2 A flowchart of a method for selecting the maximum bright area above a second parameter, provided by an embodiment of the present invention, may specifically include:

[0075] S201: Perform dynamic thresholding on the image to be detected to obtain the fourth brightness region.

[0076] In this embodiment, dynamic threshold segmentation is performed on the image to be detected. The number of fourth bright regions can be one or two. This embodiment does not set the number of fourth bright regions.

[0077] S202: Perform a circular opening operation on the fourth bright region to obtain the fifth bright region.

[0078] This embodiment does not limit the operation structure for performing the opening operation on the fourth bright region, as long as it can eliminate the dirt spots in the fourth bright region. For example, a circular structure opening operation can be used to process the image, or a rectangular structure opening operation can be used to process the image. This embodiment does not limit the parameter setting value for performing the opening operation on the fourth bright region; for example, it can be a value of 10 pixels, 15 pixels, or 20 pixels.

[0079] S203: Fill the fifth bright area to obtain the sixth bright area.

[0080] S204: Select the region whose center coordinates are above the second parameter in the sixth bright region as the first bright region.

[0081] S103: Determine whether the center coordinates of the first bright region are in the area above the first parameter. If yes, proceed to step S104; otherwise, proceed to step S105.

[0082] S104: If the center coordinates of the first bright region are in the region above the first parameter, the first bright region is taken as the first maximum bright region, and the fifth parameter is generated.

[0083] In this embodiment, the fifth parameter generated is the lower boundary line of the rectangle inscribed in the first maximum bright area.

[0084] S105: If the center coordinates of the first bright region are not in the area above the first parameter, the image to be detected is cropped according to the third and fourth parameters and used as the image to be detected. Then, step S102 is executed again.

[0085] In this embodiment, if the center coordinates of the first bright region are not in the area above the first parameter, the third and fourth parameters are used as boundary lines to crop the image to be detected, and the result is a new image to be detected.

[0086] S106: Perform dynamic threshold segmentation on the image to be detected, and select an effective bright region whose center coordinates are between the second and fifth parameters and whose area is greater than the area threshold as the second bright region.

[0087] In this embodiment, threshold segmentation is performed on the image to be detected. Bright areas are selected, and regions whose center coordinates are between the second and fifth parameters are further filtered. Regions whose area is greater than the area threshold are then selected as valid bright areas, which are designated as the second bright domain. This embodiment obtains the bright domain between the panel gap and the base.

[0088] This embodiment does not limit the setting value of the area threshold, as long as the area threshold can avoid the misselection of noise points. For example, it can be a value of 20,000 pixels, 15,000 pixels, or 25,000 pixels. It should be noted that the setting value of the area threshold in this embodiment is set according to the actual situation during the plate gap positioning process.

[0089] Furthermore, to avoid the impact of the broken portion in the plaster gap on the accuracy of plaster gap positioning, the above-mentioned dynamic threshold segmentation processing of the image to be detected selects an effective bright region whose center coordinates are between the second and fifth parameters and whose area is greater than the area threshold as the second bright region. This can include the following steps, please refer to [reference needed]. Figure 3 , Figure 3 A flowchart of a second brightness region selection method provided in an embodiment of the present invention may specifically include:

[0090] S301: Perform dynamic thresholding on the image to be detected to obtain the fourth dark domain.

[0091] The image to be detected is subjected to dynamic threshold segmentation to extract the dark region, which is then used as the fourth dark region. It should be noted that in this embodiment, the number of fourth dark regions can be one or two, depending on the actual number obtained, and is not limited thereto.

[0092] S302: Perform a rectangular closing operation on the fourth dark region according to the preset closing operation parameters to obtain the fifth dark region.

[0093] In this embodiment, a rectangular closing operation is performed on the fourth dark region according to preset closing operation parameters to obtain the fifth dark region, which can connect the broken parts of the plate gaps. This embodiment does not limit the setting value of the preset closing operation parameters; for example, the rectangular structure parameters can be 10 pixels wide and 100 pixels long; or they can be 12 pixels wide and 120 pixels long. In this embodiment, the rectangular structure parameters can be the width in pixels horizontally and the length in pixels vertically; or they can be the width in pixels vertically and the length in pixels horizontally. This embodiment does not limit these values ​​and can set them according to the image.

[0094] S303: Perform the inverse difference operation on the fifth dark region to obtain the seventh bright region.

[0095] S304: Select the region whose center coordinates are between the second and fifth parameters and whose area is greater than the area threshold as the eighth bright region.

[0096] S305: Select the effective bright area in the eighth bright area as the second bright area.

[0097] In this embodiment, a valid bright region is selected from the eighth bright region, where the valid bright region is a region that is not connected to the first maximum bright region. The number of second bright regions in this embodiment is determined based on the selected number; it can be one or more.

[0098] Furthermore, in order to more efficiently determine the effective bright region of the eighth bright region, the above selection of the effective bright region in the eighth bright region as the second bright region may include the following steps:

[0099] Determine if the number of the eighth bright area is zero;

[0100] If so, adjust the preset closing operation parameters and re-execute the step of performing rectangular closing operation on the fourth dark area according to the preset closing operation parameters;

[0101] If not, then the eighth bright area will be taken as the second bright area.

[0102] In this embodiment, the system repeatedly checks whether the number of the eighth bright area is zero. If it is zero, the preset closing operation parameter is adjusted, and the check is repeated until the number of the eighth bright area is not zero. This embodiment does not limit the adjustment value of the preset closing operation parameter; for example, it can be increased by 50 pixels or by 40 pixels.

[0103] S107: Filter the width feature value of the second bright region to obtain the maximum width value, and select the largest area region with the maximum width feature value as the third bright region.

[0104] In this embodiment, the maximum width value in the second bright region is selected, and then the largest area region that satisfies the maximum width value is selected as the third bright region.

[0105] S108: The image to be detected is cropped according to the left and right boundary lines of the third bright region to obtain the second image to be detected.

[0106] This embodiment does not limit the method of cropping the image to be detected based on the left and right boundary lines of the third bright region. For example, the image can be cropped using the left and right boundary lines of the third bright region as boundaries; alternatively, the image can be cropped using the left boundary line of the third bright region shifted to the right by a first preset pixel value and the right boundary line of the third bright region shifted to the left by a second preset pixel value as boundaries. This embodiment does not limit the setting value of the first preset pixel value. For example, it can be 100 pixels or 50 pixels; similarly, this embodiment does not limit the setting value of the second preset pixel value. For example, it can be 100 pixels or 50 pixels.

[0107] S109: Perform dynamic threshold segmentation on the second image to be detected to obtain the second dark region. Filter the second dark region according to the second parameter and the fifth parameter to determine the localization area of ​​the interstitial gap.

[0108] In this embodiment, the second and fifth parameters are used as boundaries to filter out the second dark region within the boundaries, which is then identified as the patch gap localization region. It should be noted that in this embodiment, the number of second dark regions obtained by performing dynamic thresholding segmentation on the second image to be detected is determined based on the result of the thresholding segmentation process.

[0109] Furthermore, to reduce the area of ​​image detection and improve the accuracy of plaque localization, the above-mentioned filtering of the second dark region based on the second and fifth parameters to determine the plaque gap region may include the following steps, for details please refer to Figure 4 , Figure 4 A flowchart of a method for determining the plaque gap region by filtering a second dark region based on a second parameter and a fifth parameter, provided by an embodiment of the present invention, may specifically include:

[0110] S401: Perform a rectangular closing operation on the second dark region to obtain the third dark region, and perform a region connectivity operation on the third dark region to obtain the first connected region.

[0111] In this embodiment, to eliminate the influence of small breaks in the gaps between the diaphragms, a rectangular closing operation is performed on the second dark region.

[0112] S402: Obtain the coordinates of the first connected region, and select the coordinates of the connected region between the second parameter and the fifth parameter in the first connected region coordinates as the coordinates of the second connected region.

[0113] S403: Obtain the minimum column in the coordinates of the second connected region, and select the connected region that is at a preset distance from the minimum column as the second connected region.

[0114] This embodiment does not limit the preset distance setting value; for example, it can be a value of 50 pixels, 60 pixels, or 80 pixels.

[0115] S404: Select the region with the largest area in the second connected region as the final region.

[0116] S405: Select the connected region containing the final region in the first connected region as the positioning region for the gap between the plates.

[0117] The patch gap localization method provided in this invention involves dynamic thresholding of the image to be detected to generate result parameters. A fifth parameter is generated by selecting the largest bright region whose center is above the second parameter and whose center is above the first parameter. A second bright region is selected whose center is between the second and fifth parameters and whose area is greater than the area threshold. A third bright region is selected as the region with the largest area among the largest width values ​​in the second bright region. The image to be detected is cropped according to the left and right boundaries of the third bright region, and dynamic thresholding is performed to obtain a second dark region. The second dark region is then filtered according to the second and fifth parameters to determine the patch gap localization area. A fourth bright region is obtained by performing dynamic thresholding on the image to be detected. A fifth bright region is obtained by performing a circular opening operation on the fourth bright region. A sixth bright region is obtained by filling the fifth bright region. The region whose center coordinates are above the second parameter in the sixth bright region is selected as the first bright region. This method eliminates the interference of dirt spots in the image and allows for accurate extraction of bright regions after dynamic thresholding, reducing the interference of dirt spots in the image. By sequentially performing dynamic thresholding, rectangular closing operations, and inverse subtraction on the image to be detected, a seventh bright region is obtained. The method of selecting a region whose center coordinates are between the second and fifth parameters and whose area is greater than the area threshold avoids the influence of broken parts in the patch gaps on the accuracy of patch gap localization. By performing closing operations on the second dark region and selecting a segment as the final region, the area of ​​the detected region is reduced, improving the accuracy of patch localization and eliminating interference caused by incomplete patch gap images and missing patch gaps.

[0118] To make the present invention easier to understand, the method for locating the gap between plaster pieces in this embodiment may specifically include the following steps:

[0119] Step S1, Original Image Processing:

[0120] The original image is smoothed by mean, and the mask size is set to 20 pixels in length and width to effectively filter out relevant noise and dirt and burrs between the mask and the base, thus obtaining the image to be detected.

[0121] Step S2: Obtain the inscribed rectangle of the largest dark area and output the result parameters:

[0122] Dynamic thresholding is performed on the image to be detected to extract the first dark region. Since the dark region between platypodium cells often shows breaks, a rectangular closing operation is used to ensure accurate acquisition of the first dark region. The length and width of the rectangular structure region need to be set according to the actual situation of the platypodium gaps. The main focus is on closing the structure region along the direction of the platypodium gaps. In this embodiment, the width of the rectangular structure region is set to 10 and the length to 100. Region connectivity processing is performed on the first dark region to filter out the largest region. The inscribed rectangle within the largest region is calculated, and the relevant parameters are obtained as follows. These parameters will become the platypodium gap filtering parameters:

[0123] First parameter: Upper boundary line of the first dark region;

[0124] Second parameter: The upper boundary line of the inscribed rectangle of the largest first dark region;

[0125] The third parameter: the left boundary line of the inscribed rectangle of the largest first dark region;

[0126] Fourth parameter: the right boundary line of the inscribed rectangle of the largest first dark region;

[0127] Step S3, obtain the maximum brightness area:

[0128] The image to be detected is subjected to dynamic threshold segmentation to obtain a fourth bright region. A circular opening operation is then applied to the image, with the parameter set to 10, to obtain a fifth bright region. This fifth bright region is then filled to obtain a sixth bright region. This process eliminates interference from isolated black spots within the bright regions, improving the accuracy of the maximum bright region selection. The sixth bright region undergoes region connectivity processing. Row coordinate feature selection is then performed on the result of this processing to select the region whose center coordinates are above the second parameter, which is then designated as the first bright region. This first bright region is then subjected to maximum region selection to obtain the first maximum bright region. This first maximum bright region is the maximum bright region obtained in step S3.

[0129] Step S4, Maximum brightness area re-determination:

[0130] To prevent the first maximum bright region from potentially falling below the dark region and thus avoiding positioning errors, the first maximum bright region needs to be re-evaluated. The re-evaluation rule is as follows: obtain the center coordinates of the first maximum bright region, and determine whether these center coordinates are above the first parameter. If the center coordinates are not above the first parameter, then the first maximum bright region is taken as the maximum bright region; if the center coordinates are above the first parameter, then there is a connection between the upper and lower bright regions, and image segmentation is required to obtain the expected image. Image segmentation is performed by making appropriate numerical offsets based on the third and fourth parameters, forming a new cropped image, which is then used as the image to be detected, and step S3 is re-executed.

[0131] Step S5: Obtain the lower boundary line of the inscribed rectangle of the maximum bright area, and use it as the fifth parameter.

[0132] Step S6, select the bright area between the gap between the plates and the base:

[0133] Because the height of the band gap is not fixed and varies greatly, and because dirt, pits, burrs, and other debris may appear in the bright area between the band gap and the base, connecting with the band gap in the image, and there are also instances where the gap connects with the black area on the left and right sides, with some areas similar in size and shape to the gap, it is necessary to further define the column range. This definition focuses on the bright area between the band gap and the base, and the following operations are performed:

[0134] The image to be detected is segmented by dynamic thresholding to extract the fourth dark region. The fourth dark region is then subjected to a rectangular closing operation to connect the broken parts of the plate gap. The parameters are set to width 10 and length 100 to obtain the fifth dark region after the closing operation. The fifth dark region is then inverted and subtracted in the image to be detected to obtain the seventh bright region. The center coordinates of all regions in the seventh bright region are obtained. The seventh bright region is then filtered using row position features to select the region between the second and fifth parameters. The area of ​​this region is then filtered, and the area should be greater than 20,000 pixels to prevent the wrong selection of noise points. The effective bright region between the plate gap and the base is obtained.

[0135] Step S7: Re-evaluate the effective bright area between the gap between the plate and the base.

[0136] The number of effective bright areas between the gap between the film and the base obtained in step S6 is re-evaluated. If the number of such areas is greater than 0, step S8 is executed; otherwise, the closing operation parameter of the rectangular structure in step S6 is adjusted, the length of the rectangular structure parameter is increased by 50 pixels, and the filtering is performed again until an effective white bright area is obtained.

[0137] Step S8, locate the range of the interstitial gaps:

[0138] The effective bright area between the gap between the plate and the base is further filtered to obtain the width feature values ​​of each region in this area. The width feature values ​​are then processed in an array to obtain the maximum width feature value. All regions with the maximum width feature value are then filtered. Based on the area feature, the largest area region among all regions with the maximum width feature value is selected. The rightmost and leftmost column coordinates of this largest area region are obtained. The rightmost column coordinate is shifted 100 pixels to the left and the leftmost column coordinate is shifted 100 pixels to the right. Using the shifted column coordinates as the boundary, the image to be detected is cropped to obtain the second image to be detected.

[0139] Step S9, precisely locate the position of the plaster:

[0140] The second image to be detected is subjected to dynamic threshold segmentation to extract the second dark region. A rectangular closing operation is then performed on the second dark region, followed by region connectivity processing to obtain the second connected region. All coordinates of the second connected region between the second and fifth parameters are selected, and the minimum column coordinate is obtained. All points within a 50-pixel range from the minimum column coordinate are fitted into a region, which is then used as the second connected region. The region with the largest area in the second connected region is selected as the final region. Finally, a connected region containing the final region is selected from the first connected region as the patch gap localization region.

[0141] The following describes the plaster gap positioning device provided in the embodiments of the present invention. The plaster gap positioning device described below can be referred to in correspondence with the plaster gap positioning method described above.

[0142] Please refer to the details. Figure 5 , Figure 5 A schematic diagram of a plaster gap positioning device provided in an embodiment of the present invention may include:

[0143] The result parameter generation module 100 is used to perform dynamic threshold segmentation processing on the acquired image to be detected, extract the first dark region, and generate result parameters; wherein, the result parameters include a first parameter, a second parameter, a third parameter, and a fourth parameter; wherein, the first parameter is the upper boundary line of the first dark region, the second parameter is the upper boundary line of the inscribed rectangle of the largest first dark region, the third parameter is the left boundary line of the inscribed rectangle of the largest first dark region, and the fourth parameter is the right boundary line of the inscribed rectangle of the largest first dark region;

[0144] The fifth parameter generation module 200 is used to perform dynamic threshold segmentation processing on the image to be detected sequentially, select a first bright region whose center coordinates are above the second parameter, if the center coordinates of the first bright region are above the first parameter, then the first bright region is taken as the first maximum bright region, if the center coordinates of the first bright region are below the first parameter, then the image to be detected is cropped according to the third parameter and the fourth parameter, and the step of performing dynamic threshold segmentation processing on the image to be detected is re-executed, and the first bright region whose center coordinates are above the second parameter is selected according to the result parameter to obtain the first maximum bright region and generate the fifth parameter; wherein, the fifth parameter is the lower boundary line of the rectangle inscribed in the first maximum bright region;

[0145] The second brightness region selection module 300 is used to perform dynamic threshold segmentation processing on the image to be detected, and select an effective bright region whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold as the second brightness region.

[0146] The image to be detected cropping module 400 is used to filter the width feature value of the second bright region to obtain the maximum width value, select the largest area region whose width feature is the maximum width value as the third bright region, and crop the image to be detected according to the left boundary line and right boundary line of the third bright region to obtain the second image to be detected.

[0147] The patch gap confirmation module 500 is used to perform dynamic threshold segmentation processing on the second image to be detected to obtain a second dark area, and to filter the second dark area according to the second parameter and the fifth parameter to determine the patch gap positioning area.

[0148] Based on the above embodiments, the plaster gap confirmation module 500 may include:

[0149] The second connected region coordinate acquisition unit is used to perform a rectangular closing operation on the second dark region to obtain a third dark region, perform a region connectivity operation on the third dark region to obtain a first connected region, acquire the coordinates of the first connected region, and select the coordinates of the connected region between the second parameter and the fifth parameter in the first connected region coordinates as the coordinates of the second connected region.

[0150] The second connected region selection unit is used to obtain the minimum column in the coordinates of the second connected region, and select a connected region that is at a preset distance from the minimum column as the second connected region;

[0151] The final region selection unit is used to select the region with the largest area in the second connected region as the final region;

[0152] The bar gap positioning unit is used to select the connected region containing the final region in the first connected region as the bar gap positioning region.

[0153] Based on any of the above embodiments, the fifth parameter generation module 200 may include:

[0154] The fourth brightness region acquisition unit is used to perform dynamic threshold segmentation processing on the image to be detected to obtain the fourth brightness region;

[0155] The fifth brightness region acquisition unit is used to perform a circular opening operation on the fourth brightness region to obtain the fifth brightness region;

[0156] The sixth brightness sphere acquisition unit is used to fill the fifth brightness sphere to obtain the sixth brightness sphere;

[0157] The first brightness region filtering unit is used to select the region whose center coordinates are above the second parameter in the sixth brightness region as the first brightness region.

[0158] Based on any of the above embodiments, the second brightness gamut selection module 300 may include:

[0159] The fourth dark region acquisition unit is used to perform dynamic threshold segmentation processing on the image to be detected to obtain the fourth dark region;

[0160] The fifth dark region acquisition unit is used to perform a rectangular closing operation on the fourth dark region according to preset closing operation parameters to obtain the fifth dark region;

[0161] The seventh bright region acquisition unit is used to perform an inverse difference operation on the fifth dark region to obtain the seventh bright region;

[0162] The eighth bright area filtering unit is used to select regions whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold as the eighth bright area.

[0163] The second brightness gamut selection unit is used to select the effective bright area in the eighth brightness gamut as the second brightness gamut.

[0164] Based on any of the above embodiments, the second brightness region selection unit may include:

[0165] The judgment subunit is used to determine whether the number of the eighth bright region is zero;

[0166] The first execution subunit is used to adjust the preset closing operation parameters and re-execute the step of performing rectangular closing operation on the fourth dark region according to the preset closing operation parameters if the number of the eighth bright region is zero.

[0167] The second execution subunit is used to use the eighth bright region as the second bright region if the number of the eighth bright region is not zero.

[0168] Based on any of the above embodiments, the result parameter generation module 100 may include:

[0169] The sixth dark region acquisition unit is used to perform dynamic threshold segmentation processing on the image to be detected to obtain the sixth dark region;

[0170] The seventh dark region acquisition unit is used to perform a rectangular closing operation on the sixth dark region to obtain the seventh dark region.

[0171] The result parameter generation unit is used to perform connected component processing on the seventh dark domain to obtain the first dark domain and generate result parameters.

[0172] Based on any of the above embodiments, the plaster gap positioning device may further include:

[0173] The first acquisition module is used to acquire the original image;

[0174] The smoothing module is used to perform mean smoothing on the original image to obtain the image to be detected.

[0175] The patch gap localization device provided in this invention performs dynamic threshold segmentation on the image to be detected to obtain a fourth bright region. Then, it performs a circular opening operation on the fourth bright region to obtain a fifth bright region. Finally, it performs filling operation on the fifth bright region to obtain a sixth bright region. The method of selecting the region whose center coordinates in the sixth bright region are above the second parameter as the first bright region eliminates the interference from dirt spots in the image and ensures accurate extraction of the bright region after dynamic threshold segmentation. By sequentially performing dynamic threshold segmentation, rectangular closing operation, and inverse difference operation on the image to be detected to obtain a seventh bright region, and selecting the region whose center coordinates are between the second and fifth parameters and whose area is greater than the area threshold, the method avoids the influence of broken parts in the patch gap on the accuracy of patch gap localization. By performing a closing operation on the second dark region and selecting a segment of it as the final region, the method reduces the area of ​​the image detection region, improves the accuracy of patch localization, and eliminates interference caused by incomplete patch gap images and missing patch gaps.

[0176] The following describes the plaster gap positioning device provided in the embodiments of the present invention. The plaster gap positioning device described below can be referred to in correspondence with the plaster gap positioning method described above.

[0177] Please refer to Figure 6 , Figure 6 A schematic diagram of the structure of the bar gap positioning device provided in the embodiments of the present invention may include:

[0178] Memory 10 is used to store computer programs;

[0179] Processor 20 is used to execute computer programs to implement the above-described method for positioning the gap between the plates.

[0180] The memory 10, processor 20, and communication interface 31 all communicate with each other through the communication bus 32.

[0181] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 10 may store programs for implementing the following functions:

[0182] The acquired image to be detected is subjected to dynamic threshold segmentation to extract the first dark region and generate result parameters; wherein, the result parameters include a first parameter, a second parameter, a third parameter and a fourth parameter; wherein, the first parameter is the upper boundary line of the first dark region, and the second parameter, the third parameter and the fourth parameter are the upper boundary line, the left boundary line and the right boundary line of the inscribed rectangle of the largest first dark region, respectively;

[0183] The image to be detected is subjected to dynamic threshold segmentation. A first bright region whose center coordinates are above the second parameter is selected. If the center coordinates of the first bright region are above the first parameter, the first bright region is taken as the first maximum bright region. If the center coordinates of the first bright region are below the first parameter, the image to be detected is cropped according to the third and fourth parameters to obtain the image to be detected. The dynamic threshold segmentation process on the image to be detected is repeated, and the step of selecting the first bright region whose center coordinates are above the second parameter according to the result parameters is executed again to obtain the first maximum bright region and generate the fifth parameter. The fifth parameter is the lower boundary line of the rectangle inscribed in the first maximum bright region.

[0184] The image to be detected is subjected to dynamic threshold segmentation processing. Effective bright regions whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold are selected as the second bright region.

[0185] The width feature value of the second bright region is filtered to obtain the maximum width value. The largest area region with the width feature of the maximum width value is selected as the third bright region. The image to be detected is cropped according to the left and right boundary lines of the third bright region to obtain the second image to be detected.

[0186] The second image to be detected is subjected to dynamic threshold segmentation to obtain a second dark region. The second dark region is then filtered according to the second parameter and the fifth parameter to determine the localization region of the plaster gap.

[0187] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.

[0188] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.

[0189] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.

[0190] Communication interface 31 can be an interface for the communication module, used to connect with other devices or systems.

[0191] Of course, it should be noted that, Figure 6 The structure shown does not constitute a limitation on the film gap positioning device in the embodiments of this application. In practical applications, the film gap positioning device may include more than Figure 6 More or fewer components as shown, or combinations of certain components.

[0192] The readable storage medium provided in the embodiments of the present invention is described below. The readable storage medium described below can be referred to in correspondence with the plate gap positioning method described above.

[0193] The present invention also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for positioning the gap between the plates.

[0194] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0195] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0196] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0197] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0198] The above provides a detailed description of the method, apparatus, device, and readable storage medium for positioning the gap between plasmids provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for positioning the gap between plasmids, characterized in that, include: The acquired image to be detected is subjected to dynamic threshold segmentation to extract the first dark region and generate result parameters; wherein, the result parameters include a first parameter, a second parameter, a third parameter and a fourth parameter; wherein, the first parameter is the upper boundary line of the first dark region, and the second parameter, the third parameter and the fourth parameter are the upper boundary line, the left boundary line and the right boundary line of the inscribed rectangle of the largest first dark region, respectively; The image to be detected is subjected to dynamic threshold segmentation. A first bright region whose center coordinates are above the second parameter is selected. If the center coordinates of the first bright region are above the first parameter, the first bright region is taken as the first maximum bright region. If the center coordinates of the first bright region are below the first parameter, the image to be detected is cropped according to the third and fourth parameters to obtain the image to be detected. The dynamic threshold segmentation process on the image to be detected is repeated, and the step of selecting the first bright region whose center coordinates are above the second parameter according to the result parameters is executed again to obtain the first maximum bright region and generate the fifth parameter. The fifth parameter is the lower boundary line of the rectangle inscribed in the first maximum bright region. The image to be detected is subjected to dynamic threshold segmentation processing. Effective bright regions whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold are selected as the second bright region. The width feature value of the second bright region is filtered to obtain the maximum width value. The largest area region with the width feature of the maximum width value is selected as the third bright region. The image to be detected is cropped according to the left and right boundary lines of the third bright region to obtain the second image to be detected. The second image to be detected is subjected to dynamic threshold segmentation to obtain a second dark region. The second dark region is then filtered according to the second parameter and the fifth parameter to determine the localization region of the plaster gap. The step of filtering the second dark region based on the second parameter and the fifth parameter to determine the plaque gap region includes: The second dark region is subjected to a rectangular closing operation to obtain a third dark region. The third dark region is subjected to a region connectivity operation to obtain a first connected region. The coordinates of the first connected region are obtained. The coordinates of the connected region between the second parameter and the fifth parameter in the first connected region are selected as the coordinates of the second connected region. Obtain the minimum column in the coordinates of the second connected region, and select the connected region that is at a preset distance from the minimum column as the second connected region; Select the region with the largest area in the second connected region as the final region; The connected region containing the final region in the first connected region is selected as the plate gap positioning region.

2. The method for positioning the gap between plaster pieces according to claim 1, characterized in that, The dynamic threshold segmentation process for the image to be detected, which selects a first bright region whose center coordinates are above the second parameter, includes: The image to be detected is subjected to dynamic threshold segmentation to obtain a fourth brightness region; The fourth bright region is subjected to a circular opening operation to obtain the fifth bright region; The fifth bright region is filled to obtain the sixth bright region; The region whose center coordinates are above the second parameter in the sixth bright region is selected as the first bright region.

3. The method for positioning the gap between plaster pieces according to claim 1, characterized in that, The dynamic threshold segmentation process for the image to be detected, which selects a valid bright region whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold, as the second bright region, includes: The image to be detected is subjected to dynamic threshold segmentation to obtain a fourth dark region; The fourth dark region is subjected to a rectangular closing operation based on preset closing parameters to obtain the fifth dark region; Performing an inverse difference operation on the fifth dark region yields the seventh bright region; The region whose center coordinates are between the second parameter and the fifth parameter, and whose area is greater than the area threshold, is selected as the eighth bright region; The effective bright region in the eighth bright region is selected as the second bright region.

4. The method for positioning the gap between plaster pieces according to claim 3, characterized in that, Selecting the effective bright region in the eighth bright region as the second bright region includes: Determine whether the number of the eighth bright region is zero; If so, adjust the preset closing operation parameters and re-execute the step of performing rectangular closing operation on the fourth dark region according to the preset closing operation parameters; If not, then the eighth bright region shall be taken as the second bright region.

5. The method for positioning the gap between plaster pieces according to claim 1, characterized in that, The process of performing dynamic threshold segmentation on the acquired image to be detected, extracting the first dark region, and generating result parameters includes: The image to be detected is subjected to dynamic threshold segmentation to obtain the sixth dark region; The sixth dark region is subjected to a rectangular closing operation to obtain the seventh dark region; The seventh dark domain is processed by connected component analysis to obtain the first dark domain, and result parameters are generated.

6. The method for positioning the gap between plaster pieces according to claim 1, characterized in that, Before performing dynamic thresholding on the acquired image to be detected, extracting the first dark region, and generating the result parameters, the method further includes: Obtain the original image; The original image is subjected to mean smoothing to obtain the image to be detected.

7. A device for positioning the gap between plaster pieces, characterized in that, include: The result parameter generation module is used to perform dynamic threshold segmentation processing on the acquired image to be detected, extract the first dark region, and generate result parameters; wherein, the result parameters include a first parameter, a second parameter, a third parameter, and a fourth parameter; wherein, the first parameter is the upper boundary line of the first dark region, the second parameter is the upper boundary line of the inscribed rectangle of the largest first dark region, the third parameter is the left boundary line of the inscribed rectangle of the largest first dark region, and the fourth parameter is the right boundary line of the inscribed rectangle of the largest first dark region; The fifth parameter generation module is used to perform dynamic thresholding processing on the image to be detected sequentially, select a first bright region whose center coordinates are above the second parameter, if the center coordinates of the first bright region are above the first parameter, then the first bright region is taken as the first maximum bright region, if the center coordinates of the first bright region are below the first parameter, then the image to be detected is cropped according to the third parameter and the fourth parameter, and the step of performing dynamic thresholding processing on the image to be detected is re-executed, and the first bright region whose center coordinates are above the second parameter is selected according to the result parameter to obtain the first maximum bright region and generate the fifth parameter; wherein, the fifth parameter is the lower boundary line of the rectangle inscribed in the first maximum bright region; The second brightness region selection module is used to perform dynamic threshold segmentation processing on the image to be detected, and select an effective bright region whose center coordinates are between the second parameter and the fifth parameter and whose area is greater than the area threshold as the second brightness region. The image to be detected cropping module is used to filter the width feature value of the second bright region to obtain the maximum width value, select the largest area region whose width feature is the maximum width value as the third bright region, and crop the image to be detected according to the left boundary line and right boundary line of the third bright region to obtain the second image to be detected. The patch gap confirmation module is used to perform dynamic threshold segmentation on the second image to be detected to obtain a second dark area, and to filter the second dark area according to the second parameter and the fifth parameter to determine the patch gap positioning area. The plaster gap confirmation module includes: The second connected region coordinate acquisition unit is used to perform a rectangular closing operation on the second dark region to obtain a third dark region, perform a region connectivity operation on the third dark region to obtain a first connected region, acquire the coordinates of the first connected region, and select the coordinates of the connected region between the second parameter and the fifth parameter in the first connected region coordinates as the coordinates of the second connected region. The second connected region selection unit is used to obtain the minimum column in the coordinates of the second connected region, and select a connected region that is at a preset distance from the minimum column as the second connected region; The final region selection unit is used to select the region with the largest area in the second connected region as the final region; The bar gap positioning unit is used to select the connected region containing the final region in the first connected region as the bar gap positioning region.

8. A device for positioning gaps between plates, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the bar gap positioning method as described in any one of claims 1 to 6.

9. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the plaster gap positioning method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Measuring method of weld gap in friction-stir welding

    CN105571502A

  • Hardware insulator positioning system, method and automatic maintenance system

    CN106355618A