Boundary point detection method, device, electronic device and storage medium

By combining boundary gradient threshold detection and historical boundary coordinate fitting, the problem of low boundary coordinate detection accuracy in edge detection technology is solved, and higher accuracy and robustness are achieved.

CN118411382BActive Publication Date: 2024-09-24HANGZHOU BAIZIJIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410874874.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-24
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Existing edge detection technology has the problem of low accuracy in the boundary coordinate detection process.

Method used

By obtaining the photographed image of the material to be detected, the one-dimensional array of the target area is determined for boundary gradient threshold detection, multiple historical boundary coordinates are obtained for fitting, and the target boundary coordinates are determined by combining the two.

Benefits of technology

The accuracy and robustness of boundary coordinate detection are improved, and the stability in dynamic environments is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118411382B
    Figure CN118411382B
Patent Text Reader

Abstract

The present invention discloses a boundary point detection method, device, electronic device and storage medium. The method comprises: obtaining a captured image of a material to be detected, determining a one-dimensional array corresponding to a target area in the captured image of the material to be detected, performing boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain a first boundary coordinate; obtaining multiple historical boundary coordinates corresponding to the target area, fitting the multiple historical boundary coordinates to obtain a second boundary coordinate; and determining the target boundary coordinate based on the first boundary coordinate and the second boundary coordinate. The above technical solution improves the accuracy and robustness of boundary coordinate detection by integrating boundary gradient threshold detection technology with historical boundary coordinate fitting technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a boundary point detection method, device, electronic equipment and storage medium. Background Art

[0002] With the development of computer vision, edge detection, as a key issue in computer vision, has always attracted much attention.

[0003] In the process of implementing the present invention, it is found that there are at least the following technical problems in the prior art: the existing edge detection technical solution has the problem of low accuracy in boundary coordinate detection during the boundary coordinate detection process. Summary of the invention

[0004] The present invention provides a boundary point detection method, device, electronic equipment and storage medium to improve the accuracy of boundary coordinate detection.

[0005] According to one aspect of the present invention, there is provided a boundary point detection method, comprising:

[0006] Acquire a photographic image of the material to be inspected;

[0007] Determine a one-dimensional array corresponding to a target area in the captured image of the material to be detected, and perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain a first boundary coordinate;

[0008] Acquire a plurality of historical boundary coordinates corresponding to the target area, and fit the plurality of historical boundary coordinates to obtain second boundary coordinates;

[0009] Target boundary coordinates are determined based on the first boundary coordinates and the second boundary coordinates.

[0010] According to another aspect of the present invention, there is provided a boundary point detection device, comprising:

[0011] A captured image acquisition module, used to acquire a captured image of the material to be tested;

[0012] A first boundary coordinate detection module, used to determine a one-dimensional array corresponding to a target area in the captured image of the material to be detected, and perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain a first boundary coordinate;

[0013] A second boundary coordinate detection module is used to obtain a plurality of historical boundary coordinates corresponding to the target area, and fit the plurality of historical boundary coordinates to obtain second boundary coordinates;

[0014] The target boundary coordinate determination module is used to determine the target boundary coordinates based on the first boundary coordinates and the second boundary coordinates.

[0015] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0016] at least one processor;

[0017] and a memory communicatively coupled to the at least one processor;

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the boundary point detection method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the boundary point detection method described in any embodiment of the present invention when executed.

[0020] The technical solution of the embodiment of the present invention is to obtain a photographed image of the material to be detected; determine the one-dimensional array corresponding to the target area in the photographed image of the material to be detected, perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area, and obtain a first boundary coordinate; obtain multiple historical boundary coordinates corresponding to the target area, fit the multiple historical boundary coordinates, and obtain a second boundary coordinate; determine the target boundary coordinate based on the first boundary coordinate and the second boundary coordinate. The above technical solution integrates the boundary gradient threshold detection technology with the historical boundary coordinate fitting technology, which improves the accuracy and robustness of boundary coordinate detection.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flow chart of a boundary point detection method provided according to the first embodiment of the present invention;

[0024] Figure 2 A schematic diagram of a right boundary region of interest divided according to an embodiment of the present invention;

[0025] Figure 3A schematic diagram of boundary coordinates of a right boundary provided by an embodiment of the present invention;

[0026] Figure 4 A schematic diagram of a left boundary region of interest divided according to an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of boundary coordinates of a left boundary provided by an embodiment of the present invention;

[0028] Figure 6 A line graph of upper and lower projections of a left boundary target area provided by an embodiment of the present invention;

[0029] Figure 7 A line graph of upper and lower projections of a right boundary target area provided by an embodiment of the present invention;

[0030] Figure 8 is a flow chart of a boundary point detection method provided according to Embodiment 2 of the present invention;

[0031] Fig. 9 is a flow chart of a boundary point detection method provided according to Embodiment 3 of the present invention;

[0032] Fig.10 A gradient line graph of a left boundary target area provided by an embodiment of the present invention;

[0033] Fig.11 A gradient line graph of a right boundary target area provided by an embodiment of the present invention;

[0034] Fig.12 is a flow chart of a boundary point detection method provided according to Embodiment 4 of the present invention;

[0035] Fig.13 is a flow chart of a boundary point detection method provided according to an embodiment of the present invention;

[0036] Fig.14 is a schematic diagram of fitting historical boundary coordinates provided according to an embodiment of the present invention;

[0037] Fig.15 is a structural schematic diagram of a boundary point detection device provided according to Embodiment 5 of the present invention;

[0038] Fig.16 It is a structural schematic diagram of an electronic device for implementing the boundary point detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0041] Embodiment 1

[0042] Figure 1 This is a flow chart of a boundary point detection method provided in the first embodiment of the present invention. This embodiment is applicable to the case where boundary gradient threshold detection is combined with historical data fitting technology. The method can be executed by a boundary point detection device. The boundary point detection device can be implemented in the form of hardware and / or software. The boundary point detection device can be configured in a terminal and / or a server. Figure 1 As shown, the method includes:

[0043] S110, obtaining a photographed image of the material to be inspected.

[0044] In this embodiment, the captured image refers to the result obtained by photographing the material to be inspected by a line scan camera, wherein the material to be inspected may be a roll material such as paper, metal, cloth or plastic film, which is not specifically limited here.

[0045] Exemplarily, the image of the material to be inspected can be collected in real time by a line scan camera, and the image of the material to be inspected can be transmitted to an electronic device; the image of the material to be inspected can also be retrieved from a preset storage path of the electronic device, which is not limited here.

[0046] S120, determining a one-dimensional array corresponding to a target area in the captured image of the material to be detected, performing boundary gradient threshold detection on the one-dimensional array corresponding to the target area, and obtaining first boundary coordinates.

[0047] In this embodiment, the target area may be any area in the captured image. For example, the target area may be a preset fixed area in the captured image, or may be a left boundary region of interest or a right boundary region of interest selected by a user in the captured image, which is not specifically limited here. A one-dimensional array may be used to represent pixel values ​​corresponding to multiple pixel coordinates in the target area.

[0048] Optionally, determining a one-dimensional array corresponding to a target area in a captured image of the material to be tested includes: dividing the captured image of the material to be tested into regions of interest to obtain at least one region of interest; for any region of interest, projecting the region of interest up and down to obtain a one-dimensional array corresponding to the target area.

[0049] It should be noted that the captured image range of the material to be detected is large, while the material boundary area is relatively small. The area of ​​interest can be delineated to reduce the edge search area, thereby saving image processing operation time and improving the efficiency of boundary coordinate detection.

[0050] For example, Figure 2 or Figure 4 As shown in FIG. 1 , two upper and lower regions of interest can be delineated in the captured image of the material to be detected; Figure 3 or Figure 5 As shown, each region of interest can determine its corresponding boundary coordinates; further, each region of interest can be projected up and down to obtain the average value of each column of pixels in the region of interest, thereby obtaining a one-dimensional array of 1×M dimensions for each region of interest, and any region of interest can be used as a target region for subsequent boundary point detection. Figure 6 A line graph of upper and lower projections of a left boundary target area provided by an embodiment of the present invention, Figure 7 A line graph of upper and lower projections of a right boundary target area provided in an embodiment of the present invention.

[0051] In this embodiment, the boundary gradient threshold detection refers to a boundary coordinate detection method that performs threshold judgment on the gradient value of the pixel coordinates in a one-dimensional array. The boundary coordinates refer to the coordinates corresponding to the boundary points of the material to be detected. It can be understood that the number of boundary point coordinates can be one or more.

[0052] Exemplarily, if it is detected that the gradient value corresponding to the pixel coordinates in the one-dimensional array is greater than a preset gradient threshold, the coordinates corresponding to the pixel point are determined as the first boundary coordinates.

[0053] S130: Acquire multiple historical boundary coordinates corresponding to the target area, and fit the multiple historical boundary coordinates to obtain second boundary coordinates.

[0054] In this embodiment, each historical boundary coordinate may correspond to a frame of historical captured image. In other words, in this embodiment, the first boundary coordinate is determined based on the current frame captured image, and the second boundary coordinate is obtained by fitting the historical boundary coordinates corresponding to the target area in multiple frames of historical captured images. The fitting method may be the least squares method, the stochastic gradient descent method, or the Newton method, etc., which is not specifically limited here.

[0055] It should be noted that the second boundary coordinates are obtained by fitting multiple historical boundary coordinates, which improves the stability of boundary point detection in a dynamic environment and can provide coherent and reliable boundary data for images of continuous actions.

[0056] S140: Determine target boundary coordinates based on the first boundary coordinates and the second boundary coordinates.

[0057] The target boundary coordinates are boundary point coordinates obtained by combining the first boundary coordinates and the second boundary coordinates.

[0058] In this embodiment, the first boundary coordinates may be used as the target boundary coordinates, the second boundary coordinates may be used as the target boundary coordinates, or the first boundary coordinates and the second boundary coordinates may be weighted added to obtain the target boundary coordinates, which is not specifically limited here.

[0059] Optionally, after obtaining the photographed image of the material to be inspected, the method also includes: filtering the photographed image of the material to be inspected to obtain the photographed image after filtering; accordingly, determining the one-dimensional array corresponding to the target area in the photographed image of the material to be inspected, including: determining the one-dimensional array corresponding to the target area in the photographed image after filtering.

[0060] It should be noted that by filtering the captured image, uniform noise and Gaussian noise can be removed, thereby avoiding the occurrence of edge finding errors caused by noise.

[0061] Exemplarily, an arithmetic mean filter may be used to filter the captured image of the material to be inspected. The formula corresponding to the arithmetic mean filter may be:

[0062] ;

[0063] in, A photographic image representing the material to be inspected; represents the captured image after filtering; Indicates that the center point is M indicates the size The filter window.

[0064] The technical solution of the embodiment of the present invention is to obtain a photographed image of the material to be detected; determine the one-dimensional array corresponding to the target area in the photographed image of the material to be detected, perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area, and obtain a first boundary coordinate; obtain multiple historical boundary coordinates corresponding to the target area, fit the multiple historical boundary coordinates, and obtain a second boundary coordinate; determine the target boundary coordinate based on the first boundary coordinate and the second boundary coordinate. The above technical solution integrates the boundary gradient threshold detection technology with the historical boundary coordinate fitting technology, which improves the accuracy and robustness of boundary coordinate detection.

[0065] Embodiment 2

[0066] Figure 8 A flowchart of a boundary point detection method provided for Embodiment 2 of the present invention, the method of this embodiment can be combined with the various optional schemes in the boundary point detection method provided in the above embodiments. The boundary point detection method provided in this embodiment is further optimized. Optionally, the target boundary coordinates are determined based on the first boundary coordinates and the second boundary coordinates, including: determining the absolute value of the difference between the first boundary coordinates and the second boundary coordinates; if the absolute value of the difference between the first boundary coordinates and the second boundary coordinates is greater than a preset difference threshold, determining the second boundary coordinates as the target boundary coordinates; if the absolute value of the difference between the first boundary coordinates and the second boundary coordinates is not greater than a preset difference threshold, performing weighted addition on the first boundary coordinates and the second boundary coordinates to obtain the target boundary coordinates.

[0067] like Figure 8 As shown, the method includes:

[0068] S210, obtaining a photographed image of the material to be inspected.

[0069] S220, determining a one-dimensional array corresponding to a target area in the captured image of the material to be detected, performing boundary gradient threshold detection on the one-dimensional array corresponding to the target area, and obtaining a first boundary coordinate.

[0070] S230: Acquire a plurality of historical boundary coordinates corresponding to the target area, and fit the plurality of historical boundary coordinates to obtain second boundary coordinates.

[0071] S240: Determine an absolute value of a difference between the first boundary coordinate and the second boundary coordinate.

[0072] S250. If the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is greater than a preset difference threshold, the second boundary coordinate is determined as the target boundary coordinate; if the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is not greater than the preset difference threshold, the first boundary coordinate and the second boundary coordinate are weightedly added to obtain the target boundary coordinate.

[0073] Exemplarily, the absolute value of the difference between the first boundary coordinate and the second boundary coordinate may be determined, and the calculation formula thereof may be expressed as follows:

[0074] d=abs(point1-point2);

[0075] Wherein, d represents the absolute value of the difference between the first boundary coordinate and the second boundary coordinate, point1 represents the first boundary coordinate, and point2 represents the second boundary coordinate.

[0076] If the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is greater than the preset difference threshold, the second boundary coordinate is determined as the target boundary coordinate; if the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is not greater than the preset difference threshold, the target boundary coordinate is calculated according to the following formula:

[0077] Point=α×point1+β×point2;

[0078] Among them, Point represents the target boundary coordinates, point1 represents the first boundary coordinates, point2 represents the second boundary coordinates, α and β are weight values, and α+β=1.

[0079] The technical solution of the embodiment of the present invention comprehensively judges the first boundary coordinates obtained by the boundary gradient threshold detection technology and the second boundary coordinates obtained by the historical boundary coordinate fitting technology and determines the target boundary coordinates, thereby improving the accuracy and robustness of boundary coordinate detection.

[0080] Embodiment 3

[0081] Fig. 9 A flowchart of a boundary point detection method provided for embodiment three of the present invention, the method of this embodiment can be combined with the various optional schemes in the boundary point detection method provided in the above embodiments. The boundary point detection method provided in this embodiment is further optimized. Optionally, the boundary gradient threshold detection is performed on the one-dimensional array corresponding to the target area to obtain the first boundary coordinate, including: convolving the one-dimensional array corresponding to the target area with a preset convolution operator to obtain the gradient information corresponding to the target area; determining the first boundary coordinate corresponding to the target area based on the gradient information corresponding to the target area.

[0082] like Fig. 9 As shown, the method includes:

[0083] S310, obtaining a photographed image of the material to be inspected.

[0084] S320: Determine a one-dimensional array corresponding to the target area in the captured image of the material to be detected.

[0085] S330, convolving the one-dimensional array corresponding to the target area with a preset convolution operator to obtain gradient information corresponding to the target area.

[0086] S340: Determine first boundary coordinates corresponding to the target area based on gradient information corresponding to the target area.

[0087] S350: Acquire multiple historical boundary coordinates corresponding to the target area, and fit the multiple historical boundary coordinates to obtain second boundary coordinates.

[0088] S360: Determine target boundary coordinates based on the first boundary coordinates and the second boundary coordinates.

[0089] The preset convolution operator refers to a pre-designed convolution operator, which can be adaptively changed or transformed according to the brightness or darkness of the boundary.

[0090] Exemplarily, the preset convolution operator may be 1×k-dimensional; if the boundary is a trend of change from light to dark, the preset convolution operator may be filter=[1,0,…,-1]; if the boundary is a trend of change from dark to light, the preset convolution operator may be filter=[-1,0,…,1]. It should be noted that by using a specially designed convolution operator, a more refined gradient calculation can be performed on the captured image, thereby improving the accuracy of boundary positioning.

[0091] The calculation formula of the gradient information corresponding to the target area can be:

[0092] g(x)=f(x)*filter;

[0093] Among them, g(x) represents the gradient information corresponding to the target area, f(x) represents the one-dimensional array corresponding to the target area, and filter represents the preset convolution operator.

[0094] Optionally, the gradient information corresponding to the target area includes gradient values ​​corresponding to multiple pixel coordinates in the target area; accordingly, determining the first boundary coordinates corresponding to the target area based on the gradient information corresponding to the target area includes: performing threshold judgment on the gradient values ​​corresponding to multiple pixel coordinates in the target area in turn; and determining the first pixel coordinate greater than a preset gradient value as the first boundary coordinate corresponding to the target area.

[0095] It can be understood that by setting the gradient value for threshold judgment, it is ensured that only significant boundary changes can be detected, thereby enhancing the consistency of boundary positioning.

[0096] For example, Fig.10 A gradient line graph of a left boundary target area is provided in an embodiment of the present invention. Specifically, if the left boundary is a logic from light to dark, the gradient values ​​corresponding to the multiple pixel coordinates in the target area are threshold-judged from left to right, and the first pixel coordinate greater than T is determined as the first boundary coordinate corresponding to the target area, where T represents a preset gradient value, i.e. Fig.10 The dashed line in the middle corresponds to the boundary threshold. Fig.11 A gradient line graph of a right boundary target area is provided in an embodiment of the present invention. Specifically, if the right boundary is a logic from dark to light, the gradient values ​​corresponding to multiple pixel coordinates in the target area are threshold-judged from right to left, and the first pixel coordinate greater than T is determined as the first boundary coordinate corresponding to the target area, where T represents a preset gradient value, i.e. Fig.11 The dashed line in the middle corresponds to the boundary threshold.

[0097] In some embodiments, after obtaining the target boundary coordinates, the preset convolution operator and / or the preset gradient value may be optimized and adjusted according to the target boundary coordinates to improve the stability and accuracy of edge finding.

[0098] The technical solution of the embodiment of the present invention convolves the one-dimensional array corresponding to the target area with a preset convolution operator to obtain the gradient information corresponding to the target area, and then determines the first boundary coordinates corresponding to the target area based on the gradient information corresponding to the target area. The above technical solution realizes the detection of boundary coordinates according to the gradient information, has the advantages of simple calculation and low consumption of computing resources, and improves the detection efficiency of boundary coordinates.

[0099] Embodiment 4

[0100] Fig.12 A flowchart of a boundary point detection method provided for Embodiment 4 of the present invention, the method of this embodiment can be combined with the various optional schemes in the boundary point detection method provided in the above embodiments. The boundary point detection method provided in this embodiment is further optimized. Optionally, fitting the multiple historical boundary coordinates to obtain the second boundary coordinates includes: linearly fitting the multiple historical boundary coordinates to obtain a boundary fitting function; determining the second boundary coordinates based on the boundary fitting function.

[0101] like Fig.12 As shown, the method includes:

[0102] S410, obtaining a photographed image of the material to be inspected.

[0103] S420, determining a one-dimensional array corresponding to a target area in the captured image of the material to be detected, performing boundary gradient threshold detection on the one-dimensional array corresponding to the target area, and obtaining a first boundary coordinate.

[0104] S430: Acquire multiple historical boundary coordinates corresponding to the target area, perform linear fitting on the multiple historical boundary coordinates, and obtain a boundary fitting function.

[0105] S440: Determine second boundary coordinates based on the boundary fitting function.

[0106] S450: Determine target boundary coordinates based on the first boundary coordinates and the second boundary coordinates.

[0107] For example, Fig.13 It is a flow chart of a boundary point detection method provided according to an embodiment of the present invention. Specifically, the image of the material to be detected can be collected in real time by a line scan camera, and the image of the material to be detected can be transmitted to an electronic device. The upper and lower regions of interest can be delineated in the image of the material to be detected by the electronic device, and then the upper and lower regions of interest can be filtered to obtain the regions of interest after filtering; each region of interest after filtering can be projected up and down to obtain the average value of each column of pixels in the region of interest, so as to obtain a one-dimensional array of 1×M dimensions for each region of interest. It should be noted that any region of interest can be detected to obtain a corresponding boundary coordinate, and only one region of interest is used as an example in the following, and the processing methods of other regions of interest are the same as the processing method of the region of interest. Furthermore, the one-dimensional array corresponding to the region of interest can be convolved with a preset convolution operator to obtain the gradient information corresponding to the region of interest, and then the gradient value threshold judgment is performed on the gradient information corresponding to the region of interest, so as to determine the first boundary coordinate. Fig.14It is a schematic diagram of fitting a historical boundary coordinate provided in an embodiment of the present invention. Specifically, the current captured image can be defined as frame-0, and its corresponding boundary coordinates are point2(x0, y0); the first captured image before is defined as frame-1, and the boundary coordinates corresponding to the first captured image before is point_1(x1, y1); the second captured image before is defined as frame-2, and the boundary coordinates corresponding to the second captured image before is point_2(x2, y2); the third captured image before is defined as frame-3, and the boundary coordinates corresponding to the third captured image before is point_3(x3, y3). Further, linear fitting can be performed according to point_1(x1, y1), point_2(x2, y2) and point_3(x3, y3) to obtain a boundary fitting function. In this embodiment, the boundary fitting function can be obtained using least squares fitting, and the specific fitting formula is as follows:

[0108] ;

[0109] ;

[0110] ;

[0111] ;

[0112] The boundary fitting function obtained by fitting is as follows:

[0113] ;

[0114] Among them, y0 is a known quantity, and then y0 can be substituted into the boundary fitting function to obtain the corresponding x0 value, so as to obtain the second boundary coordinate point2 (x0, y0).

[0115] Further, the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is determined; if the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is greater than a preset difference threshold, the boundary coordinates corresponding to the same equally spaced area of ​​the image captured in the previous frame are used as the target boundary coordinates; if the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is not greater than the preset difference threshold, the first boundary coordinate and the second boundary coordinate are weightedly added to obtain the target boundary coordinates.

[0116] The technical solution of the embodiment of the present invention performs linear fitting on multiple historical boundary coordinates to obtain a boundary fitting function, and then determines the second boundary coordinate based on the boundary fitting function. This method improves the stability of boundary detection in a dynamic environment, provides coherent and reliable boundary data for images of continuous actions, and improves the accuracy and robustness of boundary coordinate detection.

[0117] Embodiment 5

[0118] Fig.15 This is a schematic diagram of the structure of a boundary point detection device provided in Embodiment 5 of the present invention. Fig.15 As shown, the device comprises:

[0119] The captured image acquisition module 510 is used to acquire the captured image of the material to be detected;

[0120] A first boundary coordinate detection module 520 is used to determine a one-dimensional array corresponding to a target area in the captured image of the material to be detected, and perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain a first boundary coordinate;

[0121] A second boundary coordinate detection module 530 is used to obtain a plurality of historical boundary coordinates corresponding to the target area, and fit the plurality of historical boundary coordinates to obtain second boundary coordinates;

[0122] The target boundary coordinate determination module 540 is configured to determine the target boundary coordinates based on the first boundary coordinates and the second boundary coordinates.

[0123] The technical solution of the embodiment of the present invention is to obtain a photographed image of the material to be detected; determine the one-dimensional array corresponding to the target area in the photographed image of the material to be detected, perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area, and obtain a first boundary coordinate; obtain multiple historical boundary coordinates corresponding to the target area, fit the multiple historical boundary coordinates, and obtain a second boundary coordinate; determine the target boundary coordinate based on the first boundary coordinate and the second boundary coordinate. The above technical solution integrates the boundary gradient threshold detection technology with the historical boundary coordinate fitting technology, which improves the accuracy and robustness of boundary coordinate detection.

[0124] In some optional implementations, the first boundary coordinate detection module 520 is further configured to:

[0125] Dividing the captured image of the material to be detected into regions of interest to obtain at least one region of interest;

[0126] For any region of interest, the region of interest is projected up and down to obtain a one-dimensional array corresponding to the target region.

[0127] In some optional implementations, the first boundary coordinate detection module 520 includes:

[0128] A gradient information determination unit, configured to convolve the one-dimensional array corresponding to the target area with a preset convolution operator to obtain gradient information corresponding to the target area;

[0129] The first boundary coordinate determining unit is configured to determine first boundary coordinates corresponding to the target area based on gradient information corresponding to the target area.

[0130] In some optional implementations, the gradient information corresponding to the target area includes gradient values ​​corresponding to a plurality of pixel coordinates in the target area;

[0131] Accordingly, the first boundary coordinate determining unit is further specifically configured to:

[0132] Perform threshold judgment on the gradient values ​​corresponding to the coordinates of multiple pixels in the target area in turn;

[0133] The first pixel coordinate that is greater than the preset gradient value is determined as the first boundary coordinate corresponding to the target area.

[0134] In some optional implementations, the second boundary coordinate detection module 530 is further specifically configured to:

[0135] Performing linear fitting on the multiple historical boundary coordinates to obtain a boundary fitting function;

[0136] A second boundary coordinate is determined based on the boundary fitting function.

[0137] In some optional implementations, the target boundary coordinate determination module 540 may also be used to:

[0138] determining an absolute value of a difference between the first boundary coordinate and the second boundary coordinate;

[0139] If the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is greater than a preset difference threshold, determining the second boundary coordinate as the target boundary coordinate;

[0140] If the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is not greater than a preset difference threshold, the first boundary coordinate and the second boundary coordinate are weightedly added to obtain the target boundary coordinate.

[0141] In some optional implementations, the boundary point detection device further includes:

[0142] A filtering processing module, used for filtering the captured image of the material to be detected to obtain a filtered captured image;

[0143] Accordingly, the first boundary coordinate detection module 520 may also be used for:

[0144] A one-dimensional array corresponding to the target area in the captured image after the filtering process is determined.

[0145] The boundary point detection device provided in the embodiment of the present invention can execute the boundary point detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0146] Embodiment 6

[0147] Fig.16 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0148] like Fig.16 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The I / O interface 15 is also connected to the bus 14.

[0149] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0150] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a boundary point detection method, which includes:

[0151] Acquire a photographic image of the material to be inspected;

[0152] Determine a one-dimensional array corresponding to a target area in the captured image of the material to be detected, and perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain a first boundary coordinate;

[0153] Acquire a plurality of historical boundary coordinates corresponding to the target area, and fit the plurality of historical boundary coordinates to obtain second boundary coordinates;

[0154] Target boundary coordinates are determined based on the first boundary coordinates and the second boundary coordinates.

[0155] In some embodiments, the boundary point detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the boundary point detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the boundary point detection method in any other appropriate manner (e.g., by means of firmware).

[0156] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0157] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0158] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0159] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0160] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0161] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0162] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0163] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A boundary point detection method, characterized in that: include: Get a captured image of the material to be tested, Determine a one-dimensional array corresponding to a target area in the captured image of the material to be detected, and perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain a first boundary coordinate; Acquire a plurality of historical boundary coordinates corresponding to the target area, and fit the plurality of historical boundary coordinates to obtain second boundary coordinates; determining an absolute value of a difference between the first boundary coordinate and the second boundary coordinate; If the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is greater than a preset difference threshold, determining the second boundary coordinate as the target boundary coordinate; If the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is not greater than a preset difference threshold, the first boundary coordinate and the second boundary coordinate are weightedly added to obtain the target boundary coordinate.

2. The method according to claim 1, characterized in that The step of determining a one-dimensional array corresponding to a target area in a captured image of the material to be detected comprises: Dividing the captured image of the material to be detected into regions of interest to obtain at least one region of interest; For any region of interest, the region of interest is projected up and down to obtain a one-dimensional array corresponding to the target region.

3. The method according to claim 1, characterized in that The step of performing boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain the first boundary coordinates includes: Convolving the one-dimensional array corresponding to the target area with a preset convolution operator to obtain gradient information corresponding to the target area; The first boundary coordinates corresponding to the target area are determined based on the gradient information corresponding to the target area.

4. The method according to claim 3, characterized in that The gradient information corresponding to the target area includes gradient values ​​corresponding to a plurality of pixel coordinates in the target area; Accordingly, determining the first boundary coordinates corresponding to the target area based on the gradient information corresponding to the target area includes: Perform threshold judgment on the gradient values ​​corresponding to the coordinates of multiple pixels in the target area in turn; The first pixel coordinate that is greater than the preset gradient value is determined as the first boundary coordinate corresponding to the target area.

5. The method according to claim 1, characterized in that The step of fitting the plurality of historical boundary coordinates to obtain a second boundary coordinate comprises: Performing linear fitting on the multiple historical boundary coordinates to obtain a boundary fitting function; A second boundary coordinate is determined based on the boundary fitting function.

6. The method according to any one of claims 1 to 5, characterized in that: After acquiring the photographed image of the material to be detected, the method further includes: Performing filtering processing on the captured image of the material to be detected to obtain a filtered captured image; Correspondingly, the step of determining a one-dimensional array corresponding to a target area in a captured image of the material to be detected includes: A one-dimensional array corresponding to the target area in the captured image after the filtering process is determined.

7. A boundary coordinate detection device, characterized in that: include: A captured image acquisition module, used to acquire a captured image of the material to be tested; A first boundary coordinate detection module, used to determine a one-dimensional array corresponding to a target area in the captured image of the material to be detected, and perform boundary gradient threshold detection on the one-dimensional array corresponding to the target area to obtain a first boundary coordinate; A second boundary coordinate detection module is used to obtain a plurality of historical boundary coordinates corresponding to the target area, and fit the plurality of historical boundary coordinates to obtain second boundary coordinates; The target boundary coordinate determination module is used to determine the absolute value of the difference between the first boundary coordinate and the second boundary coordinate; if the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is greater than a preset difference threshold, the second boundary coordinate is determined as the target boundary coordinate; if the absolute value of the difference between the first boundary coordinate and the second boundary coordinate is not greater than the preset difference threshold, the first boundary coordinate and the second boundary coordinate are weightedly added to obtain the target boundary coordinate.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the boundary point detection method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the boundary point detection method according to any one of claims 1 to 6 when executed.