Image boundary extraction method and device
By finding the two transparency values with the closest transparency thresholds in the image boundary extraction method and combining them with interpolation to calculate boundary points, the problem of balancing efficiency and quality in the existing technology for boundary extraction is solved, and efficient and accurate boundary point acquisition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN HUANLEGUANG TECH CO LTD
- Filing Date
- 2022-11-25
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, it is difficult to achieve both high quality and high efficiency in the image boundary extraction process, resulting in low accuracy and jagged edges at boundary points, which affects the subsequent processing results.
By finding the two transparency values closest to the transparency threshold, the boundary points are calculated. The coordinates of the boundary points are then calculated using interpolation. Combined with image preprocessing and scaling, the acquisition quality and efficiency are improved.
It achieves high-quality and efficient image boundary extraction, reduces data acquisition volume, and improves the accuracy and acquisition efficiency of boundary points.
Smart Images

Figure CN115760892B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image boundary extraction method, an image boundary extraction device, a computer-readable storage medium, and a computer device. Background Technology
[0002] In related technologies, boundary or edge extraction refers to the processing of image contours in digital image processing. Areas with drastic changes in transparency values can be defined as boundaries or edges. However, image data acquisition is a time-consuming preliminary work in image processing. High quality and efficiency in this process have always been contradictory. Existing image boundary data acquisition methods make it difficult to achieve both high quality and efficiency at the same time, and the accuracy of the obtained boundary points is low, resulting in jagged edges that affect the subsequent processing results. Summary of the Invention
[0003] This invention aims to at least partially solve one of the technical problems in the aforementioned technologies. To this end, one objective of this invention is to propose an image boundary extraction method that calculates boundary points by finding the two transparency values closest to a transparency threshold, thereby simultaneously considering acquisition quality and efficiency.
[0004] A second objective of this invention is to provide a computer-readable storage medium.
[0005] The third objective of this invention is to provide a computer device.
[0006] The fourth objective of this invention is to provide an image boundary extraction device.
[0007] To achieve the above objectives, a first aspect of the present invention proposes an image boundary extraction method, which includes the following steps: acquiring an image to be processed and preprocessing the image to obtain a preprocessed image; acquiring all transparency values in the preprocessed image; acquiring a transparency threshold and traversing from the outside to the inside of any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold; obtaining the boundary points of each row / column based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, so as to complete the boundary extraction of the target object in the image to be processed based on the boundary points of each row / column.
[0008] According to the image boundary extraction method of the present invention, firstly, an image to be processed is acquired and preprocessed to obtain a preprocessed image; then, all transparency values in the preprocessed image are acquired; next, a transparency threshold is acquired, and the image is traversed from the outside to the inside from any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold; finally, the boundary points of each row / column are obtained according to the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, so as to complete the boundary extraction of the target object in the image to be processed based on the boundary points of each row / column; thus, by finding the two transparency values that are closest to the transparency threshold to calculate the boundary points, both acquisition quality and efficiency are taken into account.
[0009] In addition, the image boundary extraction method proposed in the above embodiments of the present invention may also have the following additional technical features:
[0010] Optionally, acquiring the image to be processed and preprocessing the image to obtain a preprocessed image includes: acquiring the image to be processed and performing image cutout processing on the image to be processed to remove the background image to obtain an image including the target object; acquiring scaling conditions and determining whether the image including the target object needs to be scaled according to the scaling conditions; if so, acquiring scaling coefficients and scaling the image including the target object according to the scaling coefficients to obtain a preprocessed image.
[0011] Optionally, obtaining the boundary point of each row / column based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold includes: using an interpolation formula to calculate the boundary point of each row / column based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold.
[0012] Optionally, the boundary extraction of the target object in the image to be processed is completed based on the boundary points of each row / column, including: scaling and restoring the boundary points of each row / column according to the coordinate values corresponding to the boundary points of each row / column and the scaling factor, so as to complete the boundary extraction of the target object in the image to be processed.
[0013] To achieve the above objectives, a second aspect of the present invention provides a computer-readable storage medium storing an image boundary extraction program thereon, which, when executed by a processor, implements the image boundary extraction method as described above.
[0014] According to an embodiment of the present invention, a computer-readable storage medium stores an image boundary extraction program. When the image boundary extraction program is executed by a processor, the image boundary extraction method described above is implemented. Thus, by finding the two transparency values closest to the transparency threshold, the boundary points are calculated, thereby simultaneously ensuring acquisition quality and efficiency.
[0015] To achieve the above objectives, a third aspect of the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the image boundary extraction method described above.
[0016] According to the computer device of the present invention, an image boundary extraction program is stored in a memory. When the image boundary extraction program is executed by the processor, the image boundary extraction method described above is implemented. Thus, by finding the two transparency values that are closest to the transparency threshold, the boundary points are calculated, thereby simultaneously taking into account the acquisition quality and efficiency.
[0017] To achieve the above objectives, a fourth aspect of the present invention provides an image boundary extraction device, comprising: a processing module for acquiring an image to be processed and preprocessing the image to obtain a preprocessed image; a first acquisition module for acquiring all transparency values in the preprocessed image; a second acquisition module for acquiring a transparency threshold and traversing from the outside to the inside of any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold; and a boundary extraction module for obtaining boundary points for each row / column based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, so as to complete the boundary extraction of the target object in the image to be processed based on the boundary points of each row / column.
[0018] The image boundary extraction device provided in this embodiment of the invention calculates the boundary point by finding the two transparency values that are closest to the transparency threshold, thereby simultaneously taking into account the acquisition quality and efficiency.
[0019] In addition, the image boundary extraction device proposed in the above embodiments of the present invention may also have the following additional technical features:
[0020] Optionally, the processing module is further configured to: acquire an image to be processed, and perform image cutout processing on the image to be processed to remove the background image to obtain an image including the target object; acquire scaling conditions, and determine whether the image including the target object needs to be scaled according to the scaling conditions; if so, acquire scaling coefficients, and perform scaling processing on the image including the target object according to the scaling coefficients to obtain a preprocessed image.
[0021] Optionally, the boundary extraction module is further configured to calculate the boundary points of each row / column using an interpolation formula based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold.
[0022] Optionally, the boundary extraction module is further configured to scale and restore the boundary points of each row / column according to the coordinate values corresponding to the boundary points of each row / column and the scaling factor, so as to complete the boundary extraction of the target object in the image to be processed. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating the image boundary extraction method according to an embodiment of the present invention;
[0024] Figure 2 This is an image boundary extraction effect diagram according to an embodiment of the present invention;
[0025] Figure 3 This is a block diagram of an image boundary extraction device according to an embodiment of the present invention. Detailed Implementation
[0026] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0027] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the invention to those skilled in the art.
[0028] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0029] Figure 1This is a flowchart illustrating an image boundary extraction method according to an embodiment of the present invention. Figure 1 As shown, the image boundary extraction method of this invention includes the following steps:
[0030] S101, acquire the image to be processed, and preprocess the image to be processed to obtain a preprocessed image.
[0031] As one embodiment, acquiring an image to be processed and preprocessing the image to obtain a preprocessed image includes: acquiring the image to be processed and performing image cutout processing on the image to be processed to remove the background image to obtain an image including the target object; acquiring scaling conditions and determining whether the image including the target object needs to be scaled according to the scaling conditions; if so, acquiring scaling coefficients and scaling the image including the target object according to the scaling coefficients to obtain a preprocessed image.
[0032] In other words, firstly, the image to be processed is cut out to obtain an image containing the target object, with a solid color background; then, scaling conditions are obtained, and it is determined whether the image including the target object needs to be scaled based on the scaling conditions; if scaling is required, the required scaling factor is obtained so that the image including the target object can be scaled according to the scaling factor to obtain a preprocessed image; if scaling is not required, the image including the target object is directly used as the preprocessed image.
[0033] It should be noted that the scaling conditions are set based on relevant parameters such as hardware performance. For example, scaling to a width of 400px determines whether the width of the image including the target object is greater than 400px. If it is, scaling is required; otherwise, scaling is not required. Thus, the scaling factor can be reasonably determined based on the scaling conditions, thereby further improving the acquisition quality.
[0034] S102, retrieve all transparency values in the preprocessed image.
[0035] It should be noted that, due to the scaling of the image, the amount of data to be acquired is relatively reduced, thereby further improving the efficiency of data acquisition. Specifically, for every scaling by a factor of n, the acquired data value can be reduced by the square of n. For example, scaling by a factor of 0.2 reduces the amount of data to four percent of the original.
[0036] S103, obtain the transparency threshold, and traverse from the outside to the inside from any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold among all transparency values, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold.
[0037] It should be noted that the transparency threshold is specified by the user as needed, and is generally selected between 64 and 192. As an example, 128 can be selected.
[0038] As an example, to extract the lower boundary, traverse from bottom to top until the first transparency value less than 128 and the first transparency value greater than 128 in each column are found, then the traversal ends. To extract the upper boundary, traverse from top to bottom until the first transparency value less than 128 and the first transparency value greater than 128 in each column are found, then the traversal ends. To extract the left boundary, traverse from left to right until the first transparency value less than 128 and the first transparency value greater than 128 in each row are found, then the traversal ends. To extract the right boundary, traverse from right to left until the first transparency value less than 128 and the first transparency value greater than 128 in each row are found, then the traversal ends.
[0039] It should be noted that if you are extracting the top and bottom boundaries, you can define the width to increase sequentially for each column. For example, if the first column is 1, then the second column is 2, and so on. If you are extracting the left and right boundaries, you can define the height to increase sequentially for each row. For example, if the first row is 1, then the second row is 2, and so on.
[0040] S104, based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, obtain the boundary points corresponding to each row / column, so as to complete the boundary extraction of the target object in the image to be processed based on the boundary points of each row / column.
[0041] It should be noted that since the width of each column is preset and fixed when extracting the top and bottom boundaries, we only need to use the transparency threshold and the two transparency values in each column that are closest to the transparency threshold to obtain the height of each column, and then we can obtain the boundary point of each column, i.e., the coordinate value. Similarly, when extracting the left and right boundaries, the height of each row is preset and fixed, so we only need to use the transparency threshold and the two transparency values in each row that are closest to the transparency threshold to obtain the width of each row, and then we can obtain the boundary point of each row, i.e., the coordinate value.
[0042] As one example, the boundary point of each row / column is obtained based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold. This includes: using an interpolation formula to calculate the boundary point of each row / column based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold.
[0043] As a specific example, such as Figure 2As shown, taking the lower boundary as an example, if the two pixels in a certain column that are closest to the transparency threshold are (a1, y1) and (a2, y2), then the corresponding height can be obtained using the following formula.
[0044] y = (a - a1) * (y2 - y1) / (a2 - a1) + y1
[0045] Where 'a' is the transparency threshold, 'a1' and 'a2' are the transparency values of two pixels, and 'y1' and 'y2' are the heights of two pixels, thus 'y' is the height of the boundary point of the column.
[0046] As one embodiment, the boundary extraction of the target object in the image to be processed is completed based on the boundary points of each row / column, including: scaling and restoring the boundary points of each row / column according to the coordinate values and scaling factor corresponding to the boundary points of each row / column, so as to complete the boundary extraction of the target object in the image to be processed.
[0047] It should be noted that since the image is scaled in the above steps, it is necessary to restore the image at the end to obtain the boundary points of the original image in order to complete the extraction of the image boundary.
[0048] In summary, the image boundary extraction method according to embodiments of the present invention first acquires the image to be processed and preprocesses it to obtain a preprocessed image; then, it acquires all transparency values in the preprocessed image; next, it acquires a transparency threshold and traverses from the outside to the inside of any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold; finally, it obtains the boundary points for each row / column based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, so as to complete the boundary extraction of the target object in the image to be processed based on the boundary points of each row / column; thus, by finding the two transparency values that are closest to the transparency threshold to calculate the boundary points, both acquisition quality and efficiency are taken into account.
[0049] In addition, the present invention also proposes a computer-readable storage medium storing an image boundary extraction program thereon, which, when executed by a processor, implements the image boundary extraction method as described above.
[0050] According to an embodiment of the present invention, a computer-readable storage medium stores an image boundary extraction program. When the image boundary extraction program is executed by a processor, the image boundary extraction method described above is implemented. Thus, by finding the two transparency values closest to the transparency threshold, the boundary points are calculated, thereby simultaneously ensuring acquisition quality and efficiency.
[0051] In addition, this invention also proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the image boundary extraction method described above.
[0052] According to the computer device of the present invention, an image boundary extraction program is stored in a memory. When the image boundary extraction program is executed by the processor, the image boundary extraction method described above is implemented. Thus, by finding the two transparency values that are closest to the transparency threshold, the boundary points are calculated, thereby simultaneously taking into account the acquisition quality and efficiency.
[0053] Figure 3 This is a block diagram of an image boundary extraction device according to an embodiment of the present invention. Figure 3 As shown, the image boundary extraction device includes: a processing module 10, a first acquisition module 20, a second acquisition module 30, and a boundary extraction module 40;
[0054] The processing module 10 is used to acquire the image to be processed and preprocess the image to obtain a preprocessed image; the first acquisition module 20 is used to acquire all transparency values in the preprocessed image; the second acquisition module 30 is used to acquire the transparency threshold and traverse from the outside to the inside from any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold; the boundary extraction module 40 is used to obtain the boundary points of each row / column according to the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, so as to complete the boundary extraction of the target object in the image to be processed according to the boundary points of each row / column.
[0055] As an example, the processing module 10 is further configured to: acquire an image to be processed, and perform image cutout processing on the image to be processed to remove the background image in order to obtain an image including the target object; acquire scaling conditions, and determine whether the image including the target object needs to be scaled according to the scaling conditions; if so, acquire scaling coefficients, and perform scaling processing on the image including the target object according to the scaling coefficients in order to obtain a preprocessed image.
[0056] As an example, the boundary extraction module 40 is also used to calculate the boundary points of each row / column using an interpolation formula based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold.
[0057] As an example, the boundary extraction module 40 is also used to scale and restore the boundary points of each row / column according to the coordinate values and scaling factor corresponding to the boundary points of each row / column, so as to complete the boundary extraction of the target object in the image to be processed.
[0058] It should be noted that the foregoing explanation of the embodiment of the image boundary extraction method also applies to the image boundary extraction device of this embodiment, and will not be repeated here.
[0059] The image boundary extraction device provided in this embodiment of the invention calculates the boundary point by finding the two transparency values that are closest to the transparency threshold, thereby simultaneously taking into account the acquisition quality and efficiency.
[0060] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0061] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0062] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0063] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0064] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0065] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0066] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0067] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0068] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0069] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0070] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0071] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. An image boundary extraction method characterized by, Includes the following steps: Acquire the image to be processed and preprocess the image to obtain a preprocessed image; Obtain all transparency values in the preprocessed image; Obtain a transparency threshold and traverse from the outside to the inside from any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold among all transparency values, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold; Based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, the boundary points of each row / column are obtained so as to complete the boundary extraction of the target object in the image to be processed based on the boundary points of each row / column. The process includes acquiring the image to be processed and preprocessing the image to obtain a preprocessed image, including: The image to be processed is acquired, and the image to be processed is subjected to image cutout processing in order to remove the background image and obtain an image including the target object; Obtain scaling conditions, and determine whether the image including the target object needs to be scaled based on the scaling conditions; If necessary, a scaling factor is obtained, and the image including the target object is scaled according to the scaling factor to obtain a preprocessed image; The process of extracting the boundaries of the target object in the image to be processed based on the boundary points of each row / column includes: The boundary points of each row / column are scaled and restored according to the coordinate values corresponding to the boundary points of each row / column and the scaling factor, so as to complete the boundary extraction of the target object in the image to be processed.
2. The image boundary extraction method of claim 1, wherein, The boundary points for each row / column are obtained based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, including: The boundary points for each row / column are obtained by using an interpolation formula based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold.
3. A computer-readable storage medium, characterized in that, It stores an image boundary extraction program, which, when executed by a processor, implements the image boundary extraction method as described in any one of claims 1-2.
4. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the image boundary extraction method as described in any one of claims 1-2.
5. An image boundary extraction device, characterized in that, include: A processing module is used to acquire an image to be processed and to preprocess the image to be processed to obtain a preprocessed image. A first acquisition module is used to acquire all transparency values in the preprocessed image; The second acquisition module is used to acquire a transparency threshold and traverse from the outside to the inside from any side of the preprocessed image to find the two transparency values in each row / column that are closest to the transparency threshold among all transparency values, wherein one of the two closest transparency values is greater than the transparency threshold and the other is less than the transparency threshold. A boundary extraction module is used to obtain the boundary points of each row / column based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold, so as to complete the boundary extraction of the target object in the image to be processed based on the boundary points of each row / column. The processing module is further used for, The image to be processed is acquired, and the image to be processed is subjected to image cutout processing in order to remove the background image and obtain an image including the target object; Obtain scaling conditions, and determine whether the image including the target object needs to be scaled based on the scaling conditions; If necessary, a scaling factor is obtained, and the image including the target object is scaled according to the scaling factor to obtain a preprocessed image; The boundary extraction module is further used for, The boundary points of each row / column are scaled and restored according to the coordinate values corresponding to the boundary points of each row / column and the scaling factor, so as to complete the boundary extraction of the target object in the image to be processed.
6. The image boundary extraction apparatus of claim 5, wherein The boundary extraction module is also used for, The boundary points for each row / column are obtained by using an interpolation formula based on the transparency threshold and the two transparency values in each row / column that are closest to the transparency threshold.