Object contour perimeter determination method and device, electronic equipment and storage medium
By updating pixel values in image processing and determining contour points using the eight-neighborhood search algorithm, the problem of low boundary search and perimeter calculation efficiency in the prior art is solved, and higher detection accuracy and calculation efficiency are achieved.
Patent Information
- Application Number
- CN202411894072.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art has problems such as large calculations, low efficiency and inaccurate results in boundary search and perimeter calculation, especially when dealing with complex and diverse image profiles.
By obtaining the pending binary image of the target object, the pixel values of the target pixel point are updated based on the four closest pixel points, and the initial object outline image is obtained. Then, a plurality of target contour points are determined using an eight-neighborhood pixel value search algorithm to determine the first contour point and the second contour point. Finally, the contour perimeter of the target object is calculated based on the number of contour points and the preset contour perimeter function.
The detection accuracy and detection efficiency of object contours are improved, and the accuracy and calculation efficiency of the perimeter of target object contours are enhanced.
Smart Images

Figure CN119832055A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for determining the perimeter of an object contour. Background Art
[0002] Finding the boundaries and calculating the perimeter of key areas in an image is a basic problem in computer vision and image processing, and is of great significance to applications such as image analysis, object recognition, shape description, and size detection. For example, in the field of medical imaging, the perimeter of the key area contour can be used to quantitatively analyze the shape of a tumor; in satellite image analysis applications, the perimeter of the key area contour can be used to quantitatively analyze the boundaries of terrain; in the field of materials science, the perimeter of the key area contour can be used to quantitatively analyze the shape of particles; thus, determining the perimeter of the key area contour in an image has important practical application significance.
[0003] At present, the methods for boundary search and perimeter calculation are mainly: using Sobel operator, Laplacian operator and other operators to calculate the gradient information of the image to find the edge of the image, and then extracting the contour to obtain a binary image including the edge contour of the object contained in the image. Then, the discrete perimeter calculation method or polygonization method is used to calculate the perimeter of the edge contour of the object.
[0004] However, the above boundary search and perimeter calculation methods not only have large computational complexity, but also have the problems of low efficiency and inaccurate perimeter results when processing complex and diverse image contours. Summary of the invention
[0005] Embodiments of the present invention provide a method, device, electronic device and storage medium for determining the perimeter of an object contour, so as to improve the detection accuracy and detection efficiency of the object contour, and enhance the accuracy and calculation efficiency of the perimeter of the target object contour.
[0006] In a first aspect, an embodiment of the present invention provides a method for determining a perimeter of an object contour, the method comprising:
[0007] Acquire a binary image to be processed including a target object;
[0008] For each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, the pixel value of the current target pixel point is updated to obtain an initial object contour image;
[0009] Based on the initial object contour image and an eight-neighborhood pixel value search algorithm, determining a plurality of target contour points arranged in sequence corresponding to the target object;
[0010] Determine a first contour point and a second contour point from the plurality of target contour points; wherein the first contour point is at least one target contour point whose next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points;
[0011] The contour perimeter of the target object in the binary image to be processed is determined based on the total number of the plurality of target contour points, the first number corresponding to the first contour point, the second number corresponding to the second contour point, and a preset contour perimeter function.
[0012] In a second aspect, an embodiment of the present invention further provides a device for determining a perimeter of an object contour, the device comprising:
[0013] An image acquisition module, used for acquiring a binary image to be processed including a target object;
[0014] A contour image determination module is used to update the pixel value of the current target pixel point based on the four nearest pixel points of the current target pixel point for each target pixel point corresponding to the target object in the binary image to be processed, so as to obtain an initial object contour image;
[0015] A target contour point determination module, used to determine a plurality of target contour points arranged in sequence corresponding to the target object based on the initial object contour image and an eight-neighborhood pixel value search algorithm;
[0016] A contour point determination module, configured to determine a first contour point and a second contour point from the plurality of target contour points; wherein the first contour point is at least one target contour point whose next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points;
[0017] The contour perimeter determination module is used to determine the contour perimeter of the target object in the binary image to be processed based on the total number of the multiple target contour points, the first number corresponding to the first contour points, the second number corresponding to the second contour points and a preset contour perimeter function.
[0018] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0019] one or more processors;
[0020] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the object contour perimeter determination method as described in any embodiment of the present invention.
[0021] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to perform a method for determining a perimeter of an object contour as described in any one of the embodiments of the present invention.
[0022] The technical solution of the embodiment of the present invention obtains a binary image to be processed including a target object, and then, for each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, updates the pixel value of the current target pixel point to obtain an initial object contour image, and further, based on the initial object contour image and an eight-neighborhood pixel value search algorithm, determines a plurality of target contour points arranged in sequence corresponding to the target object, thereby determining a first contour point and a second contour point from the plurality of target contour points, wherein the first contour point is at least one target contour point where the next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points, and finally, based on the total number of the plurality of target contour points, a first number corresponding to the first contour point, a second number corresponding to the second contour point, and a preset contour perimeter function, determines the contour perimeter of the target object in the binary image to be processed. The technical solution provided in this embodiment performs a fast path search for the contour of the target object through the neighborhood pixel relationship of the target pixel points of the object, thereby improving the detection accuracy and efficiency of the object contour. Furthermore, by determining a plurality of different types of contour points from the target contour points and using a preset contour perimeter function to calculate the number of different types of contour points, the contour perimeter of the target object is obtained, thereby improving the accuracy and calculation efficiency of the contour perimeter of the target object. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 A schematic diagram of a flow chart of a method for determining the perimeter of an object contour provided by an embodiment of the present invention;
[0025] Figure 2 A schematic diagram of a binary image to be processed according to an embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of an initial object contour image involved in an embodiment of the present invention;
[0027] Figure 4The target contour points determined by searching the initial object contour image for target contour points according to the embodiment of the present invention;
[0028] Figure 5 A schematic diagram of a process for determining a first contour point according to an embodiment of the present invention;
[0029] Figure 6 is a schematic diagram of a second contour point involved in an embodiment of the present invention;
[0030] Figure 7 A schematic flow chart of another method for determining the perimeter of an object contour provided by an embodiment of the present invention;
[0031] Figure 8 A schematic diagram of an initial object contour image to be processed according to an embodiment of the present invention;
[0032] Fig. 9 A schematic diagram of a contour point coordinate matrix of a plurality of target contour points involved in an embodiment of the present invention;
[0033] Fig.10 A schematic diagram of a matrix operation for determining a first contour point according to an embodiment of the present invention;
[0034] Fig.11 A schematic diagram of a matrix operation for determining a second contour point according to an embodiment of the present invention;
[0035] Fig.12 A schematic diagram of the structure of a device for determining the perimeter of an object contour provided by an embodiment of the present invention;
[0036] Fig.13 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0038] Embodiment 1
[0039] Figure 1 A flow chart of a method for determining the contour circumference of an object provided in an embodiment of the present invention. This embodiment can be applied to any situation where contour search and contour circumference calculation of an object in an image are required. The method can be executed by an object contour circumference determination device, which can be implemented in the form of software and / or hardware. The hardware can be an electronic device, such as a mobile terminal, a PC or a server.
[0040] like Figure 1 As shown, the method for determining the perimeter of an object contour includes:
[0041] S110, obtaining a binary image to be processed including a target object.
[0042] The binary image to be processed is a binary image for which edge contour search and perimeter calculation are to be performed on a target object contained therein. A binary image means that each pixel in the image has only two values, usually 0 and 1, representing black and white respectively. The target object is the image content for which the corresponding edge contour and edge contour perimeter need to be determined. The binary image to be processed includes one or more target objects. In the image to be processed, the pixel value of the pixel corresponding to the target object is 1, and the pixel value of each pixel except the target object is 0.
[0043] In a specific application, when the size of an object in a color image or grayscale image needs to be quantified, the image can be subjected to threshold segmentation to obtain a corresponding binary image to be processed. Based on this, a binary image to be processed including the target object can be obtained. For example, a schematic diagram of a binary image to be processed is shown in Figure 2 ,like Figure 2 As shown, the image content "e" composed of white pixels in the binary image to be processed is the target object.
[0044] S120 , for each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, update the pixel value of the current target pixel point to obtain an initial object contour image.
[0045] The target pixel is at least one pixel corresponding to the target object. The current target pixel is the target pixel currently being processed. The four nearest pixel points of the target pixel refer to the four nearest pixel points to the target pixel. The initial object contour image is a binary image containing multiple edge contour points corresponding to the target object. The multiple edge contour points contained in the initial object contour image are inaccurate, and the initial object contour image will be further searched through the eight-neighborhood pixel value search algorithm to obtain accurate target contour points.
[0046] In this embodiment, the processing process for each target pixel point is the same. Here, any one of the target pixels is taken as the current target pixel point, and the current target pixel point is used as an example for exemplary description. For the current target pixel point, if the pixel value of the nearest pixel point in the four neighboring positions above, below, left, and right is 1, it indicates that the current target pixel point is not an edge contour point, and its pixel value can be updated from 1 to 0; otherwise, there is no need to update the pixel value of the current target pixel point. The image obtained after the pixel value of each target pixel point is updated based on the same processing method is the initial object contour image.
[0047] Specifically, the four nearest pixel values of the current target pixel include a first pixel located directly above the current target pixel, a second pixel located directly below the current target pixel, a third pixel located to the left of the current target pixel, and a fourth pixel located to the right of the current target pixel. Based on this, based on the four nearest pixel points of the current target pixel, the pixel value of the current target pixel is updated to obtain the initial object contour image. The specific implementation method may include: if the pixel values of the first pixel, the second pixel, the third pixel, and the fourth pixel are all the first preset pixel values, the current target pixel is determined as a non-contour pixel; for the binary image to be processed, the pixel value of the non-contour pixel is updated from the first preset pixel value to the second preset pixel value to obtain the initial object contour image.
[0048] The non-contour pixel point refers to the current target pixel point that is not a pixel point on the contour line of the target object. The first preset pixel value is the value corresponding to the target pixel value, that is, the first preset pixel value is 1. The second preset pixel value is 0.
[0049] For example, see Figure 2 , the target pixel (5, 2) located in the fifth row and second column can be determined as the current target pixel. The four nearest pixel points of the current target pixel include the first pixel (4, 2), the second pixel (6, 2), the third pixel (5, 1) and the fourth pixel (5, 3), all of which have pixel values of 1. The current target pixel (5, 2) is determined as a non-contour pixel, and the pixel value of the current target pixel (5, 2) can be changed from 1 to 0. For another example, the target pixel (4, 3) located in the fourth row and third column can be determined as the current target pixel. The four nearest pixel points of the current target pixel include the first pixel (3, 3), the second pixel (5, 3), the third pixel (4, 2) and the fourth pixel (4, 4). Figure 2It can be seen that the pixel value of the fourth pixel point (4, 4) is 0, so there is no need to update the current target pixel point (4, 3), that is, the pixel value of the current target pixel point (4, 3) is still 1. The schematic diagram of the initial object contour image obtained after the pixel values of each target pixel point are updated based on the same processing method is as follows Figure 3 shown.
[0050] S130 , determining a plurality of sequentially arranged target contour points corresponding to the target object based on the initial object contour image and an eight-neighborhood pixel value search algorithm.
[0051] The target contour points are pixel points that represent the edge contour of the target object.
[0052] In this embodiment, the core idea of the eight-neighborhood pixel value search algorithm is to examine the eight pixels around each pixel (i.e., the eight-neighborhood) and determine the attributes of the current pixel by analyzing the pixel values of these neighbor pixels, thereby performing corresponding processing.
[0053] In this embodiment, a certain non-zero pixel point in the initial object contour image can be used as the initial contour point. The initial contour point is used as the search starting point, and the eight-neighborhood pixel value search algorithm is used to sequentially search for the next target contour point; the step of searching for the next target contour point is repeated until the coordinate information corresponding to the next target contour point is the coordinate of the initial contour point, and multiple target contour points are obtained. Exemplarily, the target contour point determined by searching for the target contour point of the initial object contour image is as follows: Figure 4 shown.
[0054] S140 , determining a first contour point and a second contour point from a plurality of target contour points.
[0055] The second contour point is at least one target contour point where the next target contour point is located at a non-diagonal position of the current target contour point. The current target contour point is the target contour point currently being processed. The first contour point is an inflection point contour point among multiple target contour points. The inflection point contour point refers to a point where a significant change occurs in each target contour point, which is usually manifested as a concave-convex boundary point of the contour curve.
[0056] In this embodiment, a specific implementation method of determining the first contour point may include: a schematic diagram of the process of determining the first contour point is shown in FIG. Figure 5 ,like Figure 5The gray filled pixel point is the first contour point. The target contour point (3, 2) can be used as the current target contour point. The contour points located at the non-diagonal position of the current target contour point (3, 2) include: target contour point (3, 1), target contour point (3, 3), target contour point (2, 2) and target contour point (4, 2). The next target contour point of the current target contour point (3, 2) is the target contour point (2, 2). Figure 5 It can be seen that the next target contour point (2, 2) is located at a non-diagonal position of the current target contour point (3, 2), so the current target contour point (3, 2) can be determined as the first contour point. Based on the same processing method, multiple target contour points are traversed in sequence to obtain multiple first contour points.
[0057] In this embodiment, the specific implementation method of determining the second contour point may include: an inflection point detection algorithm for detecting inflection points among multiple target contour points may be pre-created, and on the basis of obtaining multiple target contour points, the position coordinates of the multiple target contour points may be input into the inflection point detection algorithm to obtain a second contour point among the multiple target contour points. For example, a schematic diagram of the second contour point can be seen in Figure 6 ,like Figure 6 As shown, Figure 6 The pixel points filled with medium gray are second contour points, and the second contour points include target contour point (3, 2), target contour point (2, 2), target contour point (2, 3), ..., target contour point (4, 1).
[0058] S150, determining the contour perimeter of the target object in the binary image to be processed based on the total number of the plurality of target contour points, the first number corresponding to the first contour points, the second number corresponding to the second contour points, and a preset contour perimeter function.
[0059] The perimeter of the target object refers to the length corresponding to the edge contour of the target object. The preset perimeter function is a pre-set perimeter calculation function. The preset perimeter function is:
[0060] Y=β×[0.980×a1+1.406×(N-a1)-0.091×a2]
[0061] Wherein, Y is the contour perimeter of the target object, β is the unit pixel length corresponding to the pixel in the binary image to be processed, a1 is the first number corresponding to the first contour point, N is the total number of multiple target contour points, and a2 is the number of contour inflection points.
[0062] In this embodiment, based on the first contour point and the second contour point, the total number of multiple target contour points, the first number corresponding to the first contour point, and the second number corresponding to the second contour point can be substituted into the preset contour perimeter function for numerical calculation to obtain the contour perimeter of the target object in the binary image to be processed.
[0063] On the basis of the above examples, Figure 4 The total number N of the multiple target contour points shown is 38, Figure 5 The first number corresponding to the first contour point shown is 26, Figure 6 The second number corresponding to the second contour point shown is 21, and the default unit pixel length β is 1. These data can be substituted into the preset contour perimeter function to obtain a contour perimeter of 40.441 for the target object in the binary image to be processed.
[0064] The technical solution of the embodiment of the present invention obtains a binary image to be processed including a target object, and then, for each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, updates the pixel value of the current target pixel point to obtain an initial object contour image, and further, based on the initial object contour image and an eight-neighborhood pixel value search algorithm, determines a plurality of target contour points arranged in sequence corresponding to the target object, thereby determining a first contour point and a second contour point from the plurality of target contour points, wherein the first contour point is at least one target contour point where the next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points, and finally, based on the total number of the plurality of target contour points, a first number corresponding to the first contour point, a second number corresponding to the second contour point, and a preset contour perimeter function, determines the contour perimeter of the target object in the binary image to be processed. The technical solution provided in this embodiment performs a fast path search for the contour of the target object through the neighborhood pixel relationship of the target pixel points of the object, thereby improving the detection accuracy and efficiency of the object contour. Furthermore, by determining a plurality of different types of contour points from the target contour points and using a preset contour perimeter function to calculate the number of different types of contour points, the contour perimeter of the target object is obtained, thereby improving the accuracy and calculation efficiency of the contour perimeter of the target object.
[0065] Embodiment 2
[0066] Figure 7 This is a flow chart of a method for determining the perimeter of an object contour provided in the second embodiment of the present invention. Based on the above embodiment, S130 and S140 are further refined. The specific implementation methods can refer to the detailed description of the embodiment of the present disclosure. The technical features that are the same or similar to the above embodiment are not repeated here.
[0067] like Figure 7 As shown, the method for determining the perimeter of an object contour includes:
[0068] S210: Acquire a binary image to be processed including a target object.
[0069] S220 , for each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, update the pixel value of the current target pixel point to obtain an initial object contour image.
[0070] S230 , searching each pixel value in the initial object contour image based on a column-major arrangement rule to determine initial contour points.
[0071] The initial contour point is the search starting point when searching for multiple target contour points corresponding to the target object. The column-major arrangement rule refers to a rule for sequentially performing a connection search on each column of pixel values in the initial object contour image.
[0072] In this embodiment, by searching each pixel value in the initial object contour image according to the column-major arrangement rule, the first pixel point with the first preset pixel value can be determined as the initial contour point. Figure 2 , the initial contour point is the pixel (4, 1) in the fourth row and first column.
[0073] S240 , using the initial contour point as a search starting point, using an eight-neighborhood pixel value search algorithm to sequentially search each pixel point in the initial object contour image, and determining a plurality of target contour points corresponding to the target object.
[0074] In this embodiment, the initial contour point can be determined as the current contour point, and eight neighboring pixel values corresponding to the current contour point are obtained. The first row and first column of the eight neighboring pixel values are used as the starting point, and the pixel point to be processed whose first pixel value is the first preset pixel value is searched in a clockwise direction, and the pixel point to be processed is determined as the contour point to be processed. For example, in order to facilitate the search operation of pixel points at the edge of the image, the edges around the initial object contour image can be padded with zeros to obtain the initial object contour image to be processed, such as Figure 8As shown, the eight neighboring pixel points of the current contour point (4, 1) include: pixel point (3, 0), pixel point (3, 1), pixel point (3, 2), pixel point (4, 2), pixel point (5, 2), pixel point (5, 1), pixel point (5, 0) and pixel point (4, 0). It can be seen that the first pixel point to be processed whose pixel value is the first preset pixel value is pixel point (3, 2). Based on this, pixel point (3, 2) can be determined as the contour point to be processed. Subsequently, the contour point to be processed is updated to the current contour point, and the step of determining the contour point to be processed is repeated until all the pixel points with the first preset pixel value in the initial object contour image are traversed, and each of the determined contour points to be processed is determined as a plurality of target contour points corresponding to the target object. See the schematic diagram of the plurality of target contour points for details. Figure 4 .
[0075] S250 , extracting the target contour point coordinates corresponding to each target contour point to construct a contour point coordinate matrix.
[0076] The target contour point coordinates refer to the horizontal and vertical coordinates of the target contour point. The contour point coordinate matrix refers to a matrix obtained by arranging the coordinates of each target contour point in sequence according to the search order.
[0077] In this embodiment, whenever a target contour point is found, the coordinate information of the target contour point can be extracted to obtain the target contour point coordinates corresponding to the target contour point; the steps of finding the next target contour point and extracting the corresponding target contour point coordinates are repeated until the coordinate information corresponding to the next target contour point found is the coordinate of the initial contour point, and the target contour point coordinates corresponding to each target contour point are obtained. Based on this, the corresponding target contour point coordinates can be arranged in sequence according to the search order of each target contour point to obtain a contour point coordinate matrix.
[0078] Based on the above examples, Figure 4 The contour point coordinate matrix of multiple target contour points shown is as follows Fig. 9 (a) shown.
[0079] S260 . Construct a first position offset matrix based on the absolute values of coordinate offsets of adjacent target contour point coordinates in the contour point coordinate matrix.
[0080] In this embodiment, the first target contour point coordinate in the contour point coordinate matrix can be determined as the current target contour point coordinate, and the lateral offset absolute value and longitudinal offset absolute value corresponding to the current target contour point coordinate are determined based on the current target contour point coordinate and the next target contour point coordinate of the current target contour point coordinate; the next target contour point coordinate is updated to the current target contour point coordinate, and the step of determining the lateral offset absolute value and longitudinal offset absolute value corresponding to the current target contour point coordinate is repeated; until the current target contour point coordinate is the last target contour point coordinate in the contour point coordinate matrix, the lateral offset absolute value and longitudinal offset absolute value corresponding to the current target contour point coordinate are determined based on the first target contour point coordinate and the current target contour point coordinate; based on the lateral offset absolute value and longitudinal offset absolute value of all current target contour point coordinates, a first position offset matrix is constructed. On the basis of the above exemplary embodiment, the first position offset matrix is as follows: Fig. 9 (b) as shown.
[0081] S270 , determining a first contour point and a second contour point from a plurality of target contour points based on the first position offset matrix.
[0082] In this embodiment, on the basis of obtaining the first position offset matrix, the first position offset matrix is further operated by a first preset processing method to obtain a first contour point of multiple target contour points; the first position offset matrix is further operated by a second preset processing method to obtain a second contour point among the multiple target contour points.
[0083] Specifically, based on the first position offset matrix, the specific implementation method of determining the first contour point from multiple target contour points may include: numerically inverting each element in the first position offset matrix to obtain a position offset inversion matrix; for each row vector in the position offset square inversion matrix, determining a target row vector in which two elements in the row vector include at least one first preset pixel value, so as to determine the target contour point corresponding to the target row vector as the first contour point.
[0084] Based on the above exemplary embodiment, see the matrix operation diagram for determining the first contour point. Fig.10 ,right Fig.10 The first position offset matrix (i.e. Fig. 9 The elements in the matrix (b) are numerically inverted to obtain the position offset inversion matrix as shown in Fig.10 (b) is shown. Further, for each row vector in the position offset square inversion matrix, a row vector with two elements of (1, 1), (0, 1) or (1, 0) is determined as a target row vector, so that the target contour point corresponding to the target row vector can be determined as the first contour point. Exemplarily, the second row vector (1, 1) in the position offset square inversion matrix is the target row vector, which corresponds to Figure 5 The target contour point (3, 2) in the position offset square inversion matrix is the target row vector, which corresponds to Figure 5 The target contour point (2, 2) in the image is the first contour point. Based on the same method, the first contour points of multiple target contour points can be obtained.
[0085] Specifically, based on the first position offset matrix, a specific implementation method for determining the second contour point from multiple target contour points may include: constructing a second position offset matrix based on the absolute values of the offsets of adjacent row vectors in the first position offset matrix; for each second row vector in the second position offset matrix, determining a second target row vector in which two elements in the second row vector include at least one first preset pixel value, so as to determine the target contour point corresponding to the second target row vector as the second contour point.
[0086] In this embodiment, the specific implementation method of determining the second position offset matrix may include: determining the first row vector to be processed in the first position offset matrix as the current row vector to be processed, and determining the first absolute value of the horizontal offset and the first absolute value of the vertical offset based on the current row vector to be processed and the next row vector to be processed of the current row vector to be processed; updating the next row vector to be processed as the current row vector to be processed, and repeating the steps of determining the first absolute value of the horizontal offset and the first absolute value of the vertical offset; until the current row vector to be processed is the last row vector to be processed in the first position offset matrix, determining the first absolute value of the horizontal offset and the first absolute value of the vertical offset based on the current row vector to be processed and the first row vector to be processed; constructing the second position offset matrix based on the first absolute values of the horizontal offset and the first absolute values of the vertical offset of all the current row vectors to be processed. Thus, the second contour point can be determined according to the specific values of each second row vector in the second position offset matrix.
[0087] Based on the above exemplary embodiment, see the matrix operation diagram for determining the second contour point. Fig.11 ,right Fig.11 The first position offset matrix (i.e. Fig. 9 The adjacent row vectors in the matrix (b) are subjected to difference operation and absolute values are taken to obtain a plurality of offset absolute values, thereby forming a second position offset matrix composed of the plurality of offset absolute values as shown in FIG. Fig.11 (b) is shown. Further, for each row vector in the second position offset matrix, a row vector with two elements of (1, 1), (0, 1) or (1, 0) is determined as the second target row vector, so that the target contour point corresponding to the second target row vector can be determined as the second contour point. For example, the first row vector (0, 1) in the second position offset matrix is the second target row vector, and the row vector corresponds to Figure 6 The target contour point (3, 2) in the second position offset matrix is the second target row vector, which corresponds to Figure 6 The target contour point (2, 2) in , the target contour point (2, 2) is the second contour point, and the second contour points of multiple target contour points can be obtained based on the same method. It should be noted that the first contour point and the second contour point in this embodiment can correspond to the same target contour point.
[0088] S280, determining the contour perimeter of the target object in the binary image to be processed based on the total number of the plurality of target contour points, the first number corresponding to the first contour point, the second number corresponding to the second contour point, and a preset contour perimeter function.
[0089] The technical solution of the embodiment of the present invention is that when determining multiple target contour points corresponding to the target object, each pixel value in the initial object contour image is searched by the column-major arrangement rule to determine the initial contour point; thus, the initial contour point is used as the search starting point, and the eight-neighborhood pixel value search algorithm is used to search each pixel point in the initial object contour image in turn to determine multiple target contour points corresponding to the target object, without complex numerical calculations, and multiple target contour points can be quickly iterated and searched according to the numerical relationship between the image contour and the boundary neighborhood, thereby improving the detection accuracy and efficiency of the object contour. At the same time, when determining the first contour point and the second contour point from the multiple target contour points, the target contour point coordinates corresponding to each of the target contour points are extracted to construct a contour point coordinate matrix; based on the coordinate offset absolute values of the adjacent target contour point coordinates in the contour point coordinate matrix, a first position offset matrix is constructed; based on the first position offset matrix, the first contour point and the second contour point are determined from the multiple target contour points, and the first contour point and the second contour point in the target contour point can be determined by simple matrix operations, thereby improving the determination efficiency of the first contour point and the second contour point, thereby further improving the accuracy and calculation efficiency of the contour perimeter of the target object.
[0090] Embodiment 3
[0091] Fig.12 A schematic diagram of the structure of a device for determining the perimeter of an object contour provided by an embodiment of the present invention is shown in FIG. Fig.12 As shown, the device includes: an image acquisition module 310 , a contour image determination module 320 , a target contour point determination module 330 , a contour point determination module 340 and a contour perimeter determination module 350 .
[0092] The image acquisition module 310 is used to acquire a binary image to be processed including a target object;
[0093] The contour image determination module 320 is used to update the pixel value of the current target pixel point based on the four nearest pixel points of the current target pixel point for each target pixel point corresponding to the target object in the binary image to be processed, so as to obtain an initial object contour image;
[0094] A target contour point determination module 330 is used to determine a plurality of target contour points arranged in sequence corresponding to the target object based on the initial object contour image and an eight-neighborhood pixel value search algorithm;
[0095] A contour point determination module 340 is used to determine a first contour point and a second contour point from the multiple target contour points; wherein the first contour point is at least one target contour point whose next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the multiple target contour points;
[0096] The contour perimeter determination module 350 is used to determine the contour perimeter of the target object in the binary image to be processed based on the total number of the multiple target contour points, the first number corresponding to the first contour points, the second number corresponding to the second contour points and a preset contour perimeter function.
[0097] Based on the above embodiment, optionally, the preset contour perimeter function is:
[0098] Y=β×[0.980×a1+1.406×(N-a1)-0.091×a2]
[0099] Wherein, Y is the contour perimeter of the target object, β is the unit pixel length corresponding to the pixel in the binary image to be processed, a1 is the first number corresponding to the first contour point, N is the total number of multiple target contour points, and a2 is the number of contour inflection points.
[0100] On the basis of the above embodiment, optionally, the four nearest pixel values of the current target pixel point include a first pixel point located directly above the current target pixel point, a second pixel point located directly below the current target pixel point, a third pixel point located to the left of the current target pixel point, and a fourth pixel point located to the right of the current target pixel point. The contour image determination module is specifically used to determine the current target pixel point as a non-contour pixel point if the pixel values of the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point are all first preset pixel values; for the binary image to be processed, the pixel value of the non-contour pixel point is updated from the first preset pixel value to the second preset pixel value to obtain an initial object contour image.
[0101] Based on the above embodiment, optionally, the target contour point determination module 330 includes:
[0102] An initial contour point determination unit, configured to search each pixel value in the initial object contour image based on a column-major arrangement rule to determine an initial contour point corresponding to the target object;
[0103] The target contour point determination unit is used to use the initial contour point as the search starting point and adopt an eight-neighborhood pixel value search algorithm to sequentially search each pixel point in the initial object contour image to determine a plurality of target contour points corresponding to the target object.
[0104] On the basis of the above embodiment, optionally, a target contour point determination unit is specifically used to determine the initial contour point as the current contour point, obtain eight neighborhood pixel values corresponding to the current contour point, take the first row and first column of the eight neighborhood pixel values as the starting point, search for the first pixel point to be processed whose pixel value is the first preset pixel value in a clockwise direction, and determine the pixel point to be processed as the contour point to be processed; update the contour point to be processed as the current contour point, and repeat the step of determining the contour point to be processed until all pixel points in the initial object contour image whose pixel value is the first preset pixel value are traversed, and determine each of the contour points to be processed as a plurality of target contour points corresponding to the target object.
[0105] Based on the above embodiment, optionally, the contour point determination module 340 includes:
[0106] A contour matrix determination unit, used for extracting the target contour point coordinates corresponding to each of the target contour points to construct a contour point coordinate matrix;
[0107] An offset matrix determining unit, configured to construct a first position offset matrix based on the absolute values of coordinate offsets of adjacent target contour point coordinates in the contour point coordinate matrix;
[0108] The contour point determination unit is configured to determine a first contour point and a second contour point from the plurality of target contour points based on the first position offset matrix.
[0109] Based on the above embodiment, optionally, the contour point determination unit includes: a first contour point determination subunit and a second contour point determination subunit;
[0110] A first contour point determination subunit is used to numerically invert each element in the first position offset matrix to obtain a position offset inversion matrix; for each row vector in the position offset square inversion matrix, determine a target row vector whose two elements in the row vector include at least one first preset pixel value, so as to determine a target contour point corresponding to the target row vector as a first contour point;
[0111] The second contour point determination subunit is used to construct a second position offset matrix based on the absolute values of the offsets of adjacent row vectors in the first position offset matrix; for each second row vector in the second position offset matrix, determine a second target row vector whose two elements in the second row vector include at least one first preset pixel value, so as to determine the target contour point corresponding to the second target row vector as the second contour point.
[0112] The technical solution of the embodiment of the present invention obtains a binary image to be processed including a target object, and then, for each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, updates the pixel value of the current target pixel point to obtain an initial object contour image, and further, based on the initial object contour image and an eight-neighborhood pixel value search algorithm, determines a plurality of target contour points arranged in sequence corresponding to the target object, thereby determining a first contour point and a second contour point from the plurality of target contour points, wherein the first contour point is at least one target contour point where the next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points, and finally, based on the total number of the plurality of target contour points, a first number corresponding to the first contour point, a second number corresponding to the second contour point, and a preset contour perimeter function, determines the contour perimeter of the target object in the binary image to be processed. The technical solution provided in this embodiment performs a fast path search for the contour of the target object through the neighborhood pixel relationship of the target pixel points of the object, thereby improving the detection accuracy and efficiency of the object contour. Furthermore, by determining a plurality of different types of contour points from the target contour points and using a preset contour perimeter function to calculate the number of different types of contour points, the contour perimeter of the target object is obtained, thereby improving the accuracy and calculation efficiency of the contour perimeter of the target object.
[0113] The object contour perimeter determination device provided in the embodiment of the present invention can execute the object contour perimeter determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0114] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0115] Embodiment 4
[0116] Fig.13A 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 processing, 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.
[0117] like Fig.13 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. An input / output (I / O) interface 15 is also connected to the bus 14.
[0118] 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.
[0119] 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 dedicated 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 executes the various methods and processes described above, such as a target control object posture control method.
[0120] In some embodiments, the target control object posture control method can 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 can 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 target control object posture control method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the target control object posture control method by any other appropriate means (e.g., by means of firmware).
[0121] 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), systems on chips (SOCs), load 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.
[0122] 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.
[0123] 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 combination 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.
[0124] 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).
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] Embodiment 5
[0130] The embodiment of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to perform a method for determining a perimeter of an object contour when executed by a computer processor, the method comprising:
[0131] Acquire a binary image to be processed including a target object;
[0132] For each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, the pixel value of the current target pixel point is updated to obtain an initial object contour image;
[0133] Based on the initial object contour image and an eight-neighborhood pixel value search algorithm, determining a plurality of target contour points arranged in sequence corresponding to the target object;
[0134] Determine a first contour point and a second contour point from the plurality of target contour points; wherein the first contour point is at least one target contour point whose next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points;
[0135] The contour perimeter of the target object in the binary image to be processed is determined based on the total number of the plurality of target contour points, the first number corresponding to the first contour point, the second number corresponding to the second contour point, and a preset contour perimeter function.
[0136] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0137] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0138] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0139] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0140] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for determining the perimeter of an object contour, characterized in that: include: Acquire a binary image to be processed including a target object; For each target pixel point corresponding to the target object in the binary image to be processed, based on the four nearest pixel points of the current target pixel point, the pixel value of the current target pixel point is updated to obtain an initial object contour image; Based on the initial object contour image and an eight-neighborhood pixel value search algorithm, determining a plurality of sequentially arranged target contour points corresponding to the target object; Determine a first contour point and a second contour point from the plurality of target contour points; wherein the first contour point is at least one target contour point whose next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points; The contour perimeter of the target object in the binary image to be processed is determined based on the total number of the plurality of target contour points, the first number corresponding to the first contour point, the second number corresponding to the second contour point, and a preset contour perimeter function.
2. The method according to claim 1, characterized in that The default contour perimeter function is: Y=β×[0.980×a1+1.406×(N-a1)-0.091×a2] Wherein, Y is the contour perimeter of the target object, β is the unit pixel length corresponding to the pixel in the binary image to be processed, a1 is the first number corresponding to the first contour point, N is the total number of multiple target contour points, and a2 is the number of contour inflection points.
3. The method according to claim 1, characterized in that The four nearest pixel values of the current target pixel point include a first pixel point located directly above the current target pixel point, a second pixel point located directly below the current target pixel point, a third pixel point located on the left side of the current target pixel point, and a fourth pixel point located on the right side of the current target pixel point. The pixel value of the current target pixel point is updated based on the four nearest pixel points of the current target pixel point to obtain an initial object contour image, including: Based on the four nearest pixel points of the current target pixel point, the pixel value of the current target pixel point is updated to obtain an initial object contour image, including: If the pixel values of the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point are all first preset pixel values, determining the current target pixel point as a non-contour pixel point; For the binary image to be processed, the pixel values of the non-contour pixels are updated from the first preset pixel values to the second preset pixel values to obtain an initial object contour image.
4. The method according to claim 1, characterized in that The step of determining a plurality of sequentially arranged target contour points corresponding to the target object based on the initial object contour image and an eight-neighborhood pixel value search algorithm comprises: Searching each pixel value in the initial object contour image based on a column-major arrangement rule to determine an initial contour point; Taking the initial contour point as the search starting point, an eight-neighborhood pixel value search algorithm is used to sequentially search each pixel point in the initial object contour image to determine a plurality of target contour points corresponding to the target object.
5. The method according to claim 1, characterized in that The step of determining a first contour point and a second contour point from the plurality of target contour points comprises: Extracting the target contour point coordinates corresponding to each of the target contour points to construct a contour point coordinate matrix; constructing a first position offset matrix based on the absolute values of coordinate offsets of adjacent target contour point coordinates in the contour point coordinate matrix; Based on the first position offset matrix, a first contour point and a second contour point are determined from the plurality of target contour points.
6. The method according to claim 5, characterized in that The step of determining a first contour point from the plurality of target contour points based on the first position offset matrix comprises: Perform numerical inversion on each element in the first position offset matrix to obtain a position offset inversion matrix; For each row vector in the position offset square inversion matrix, a target row vector including at least one first preset pixel value in two elements of the row vector is determined, so as to determine the target contour point corresponding to the target row vector as a first contour point.
7. The method according to claim 5, characterized in that The step of determining a second contour point from the plurality of target contour points based on the first position offset matrix comprises: constructing a second position offset matrix based on the absolute values of the offsets of adjacent row vectors in the first position offset matrix; For each second row vector in the second position offset matrix, a second target row vector including at least one first preset pixel value in two elements of the second row vector is determined to determine the target contour point corresponding to the second target row vector as a second contour point.
8. A device for determining the perimeter of an object contour, characterized in that: include: An image acquisition module, used for acquiring a binary image to be processed including a target object; A contour image determination module is used to update the pixel value of the current target pixel point based on the four nearest pixel points of the current target pixel point for each target pixel point corresponding to the target object in the binary image to be processed, so as to obtain an initial object contour image; A target contour point determination module, used to determine a plurality of target contour points arranged in sequence corresponding to the target object based on the initial object contour image and an eight-neighborhood pixel value search algorithm; A contour point determination module, configured to determine a first contour point and a second contour point from the plurality of target contour points; wherein the first contour point is at least one target contour point whose next target contour point is located at a non-diagonal position of the current target contour point, and the second contour point is an inflection point contour point among the plurality of target contour points; The contour perimeter determination module is used to determine the contour perimeter of the target object in the binary image to be processed based on the total number of the multiple target contour points, the first number corresponding to the first contour points, the second number corresponding to the second contour points and a preset contour perimeter function.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the object contour circumference determination method as described in any one of claims 1-7.
10. 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 object contour perimeter determination method described in any one of claims 1-7 when executed.