Target positioning method and device, electronic equipment and storage medium

By processing the image of the inner shell of the laptop, the position information of the screw hole is determined, the screw hole positioning problem is solved, the precise screwing in is achieved, and the production efficiency is improved.

CN119295545APending Publication Date: 2025-01-10HEFEI LCFC INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411376956.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

During the production process of laptops, how to accurately locate and lock regular and irregular screw holes to ensure that the screws can be screwed in accurately.

Method used

By acquiring the image to be tested by the electronic device, determining the area to be tested of the target component, performing binarization processing, determining whether the target component area is a closed communication area, and using the Hoffman circle detection algorithm or generating a rectangular area to obtain the target component according to the results location information.

Benefits of technology

It realizes accurate positioning of target components of electronic equipment, can adapt to regular and irregular screw holes, and improves the accuracy and working efficiency of screw threading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295545A_ABST
    Figure CN119295545A_ABST
Patent Text Reader

Abstract

The invention provides a target positioning method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining a to-be-detected image for the electronic device; the to-be-detected image comprises a plurality of target parts of the electronic equipment; determining a to-be-detected area corresponding to each target component in the to-be-detected image; for a to-be-detected area corresponding to any target component in the to-be-detected areas corresponding to the target components, performing binarization processing on the to-be-detected area to obtain a binarized area; based on the binarization region, determining whether a target component region in the to-be-detected region is a closed connected region; and obtaining position information of the target component based on a determination result of whether the target component region is a closed connected region or not. Accurate positioning of the target component of the electronic equipment can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a target positioning method, device, electronic device and storage medium. Background Art

[0002] In the production process of laptop computers, the screw holes of the inner shell of the laptop computer need to be automatically locked to ensure that the screws can be screwed into the screw holes accurately. Usually the screw holes are nearly standard circles, but for various reasons, there are also irregular screw holes similar to ellipses in the inner shell of the laptop computer. How to accurately position and lock regular and irregular screw holes has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present application provides a target positioning method, device, electronic device and storage medium to at least solve the above technical problems existing in the prior art.

[0004] According to a first aspect of the present application, a target positioning method is provided, the method comprising:

[0005] Acquire an image to be tested for the electronic device; the image to be tested includes a plurality of target components of the electronic device;

[0006] Determine the area to be tested corresponding to each target component in the image to be tested;

[0007] For any target component in the target component corresponding area to be tested,

[0008] Performing binarization processing on the area to be tested to obtain a binarized area;

[0009] Based on the binary region, determining whether the target component region in the to-be-tested region is a closed connected region;

[0010] Based on the determination result of whether the target component region is a closed connected region, the position information of the target component is obtained.

[0011] In one possible implementation manner, determining the area to be tested corresponding to each target component in the image to be tested includes:

[0012] Acquire a reference image for the electronic device; the reference image includes a plurality of target components of the electronic device and reference position areas thereof;

[0013] Based on the reference position area of ​​each target component in the reference image, the area to be tested of each target component in the image to be tested is determined.

[0014] In one possible implementation manner, obtaining the position information of the target component based on the determination result of whether the target component region is a closed connected region includes:

[0015] When the target component area is a closed connected area,

[0016] Based on the target extraction algorithm, the center coordinates of the target component are obtained;

[0017] Based on the center coordinates of the target component, the position information of the target component is obtained.

[0018] In one possible implementation manner, obtaining the position information of the target component based on the determination result of whether the target component region is a closed connected region includes:

[0019] When the target component area is not a closed connected area,

[0020] Determine the minimum bounding rectangle of the target component area in the area to be tested;

[0021] Taking the central coordinates of the minimum circumscribed rectangular frame as the center of the circle, generating a plurality of rectangular areas of preset sizes within the minimum circumscribed rectangular frame;

[0022] Based on the plurality of rectangular areas of preset sizes, the position information of the target component is obtained.

[0023] In one possible implementation manner, obtaining the position information of the target component based on the plurality of rectangular areas of preset sizes includes:

[0024] For any rectangular area of ​​multiple rectangular areas of preset sizes,

[0025] Traverse the grayscale values ​​of each pixel in the rectangular area, and take the pixel with the largest grayscale value gradient as the feature point of the rectangular area;

[0026] Based on the feature points of a plurality of rectangular areas of preset sizes, the position information of the target component is obtained.

[0027] In one possible implementation manner, obtaining the position information of the target component based on feature points of a plurality of rectangular areas of preset sizes includes:

[0028] Arbitrarily grouping feature points of rectangular areas of multiple preset sizes into a group with a preset number to obtain multiple feature point combinations;

[0029] For any combination of feature points,

[0030] Based on the coordinate information of each feature point in the feature point combination, obtaining the candidate center coordinates of the target component;

[0031] Based on the multiple candidate center coordinates of the target component, the position information of the target component is obtained.

[0032] In one possible implementation manner, obtaining the position information of the target component based on the multiple candidate center coordinates of the target component includes:

[0033] The candidate center coordinate with the largest number of repetitions among the multiple candidate center coordinates is used as the center coordinate of the target component;

[0034] Based on the central coordinates of the target component, the position information of the target component is obtained.

[0035] According to a second aspect of the present application, a target positioning device is provided, the device comprising:

[0036] A first acquisition unit is used to acquire an image to be tested for the electronic device; the image to be tested includes a plurality of target components of the electronic device;

[0037] A first determining unit, used to determine the area to be tested corresponding to each target component in the image to be tested;

[0038] A second acquisition unit is used to perform a binarization process on the area to be tested corresponding to any target component in the area to be tested corresponding to each target component, so as to obtain a binarized area;

[0039] A second determination unit, configured to determine whether a target component region in the region to be tested is a closed connected region based on the binary region;

[0040] The third acquisition unit is used to obtain the position information of the target component based on the determination result of whether the target component area is a closed connected area.

[0041] According to a third aspect of the present application, an electronic device is provided, including:

[0042] at least one processor; and

[0043] a memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present application.

[0045] According to a fourth aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method described in the present application.

[0046] In the present application, an image to be tested for an electronic device is obtained; the image to be tested includes multiple target components of the electronic device; the test area corresponding to each target component in the test image is determined; for the test area corresponding to any target component in the test area corresponding to each target component, the test area is binarized to obtain a binarized area; based on the binarized area, it is determined whether the target component area in the test area is a closed connected area; based on the determination result of whether the target component area is a closed connected area, the position information of the target component is obtained. Accurate positioning of the target component of the electronic device can be achieved.

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

[0048] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:

[0049] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0050] Figure 1 A schematic diagram of the implementation process of the target positioning method according to an embodiment of the present application is shown;

[0051] Figure 2 A schematic diagram of the application process of the target positioning method according to an embodiment of the present application is shown;

[0052] Figure 3 A schematic diagram showing the arrangement of rectangular areas within the minimum circumscribed rectangular frame of an embodiment of the present application is shown;

[0053] Figure 4 A schematic diagram of the structure of the target positioning device according to an embodiment of the present application is shown;

[0054] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0055] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0056] The present application embodiment provides a target positioning method, such as Figure 1 As shown, the method includes:

[0057] S101: Acquire an image to be tested for an electronic device; the image to be tested includes a plurality of target components of the electronic device.

[0058] In the embodiment of the present application, the electronic device is a laptop computer, the target component is a screw hole, and the image to be tested is an image taken of the inner shell of the laptop computer, and the image includes all the screw holes of the inner shell.

[0059] S102: Determine the area to be tested corresponding to each target component in the image to be tested.

[0060] In this step, the area to be tested is the approximate area of ​​each target component in the image to be tested. It can be understood that the image to be tested includes each target component. In order to ensure the accurate positioning of each target component, the specific area of ​​each target component is determined from the image to be tested, which can reduce the amount of data calculation when positioning each target component and remove redundant data that may affect the positioning accuracy or is irrelevant to the target component.

[0061] S103: For any target component in the target component-corresponding target component-areas, binarization is performed on the target component-corresponding target component-areas to obtain a binarized region.

[0062] In this step, it can be understood that the area to be tested includes both the target component and the background area other than the target component. When locating any target component, binarization of the area to be tested can enhance the contrast between the target component and the background in the area to be tested, so that the area to be tested only contains two grayscale values ​​of 0 and 255, and the target component and the background are more distinct, which is more conducive to image analysis and processing.

[0063] S104: Based on the binary region, determining whether the target component region in the to-be-tested region is a closed connected region;

[0064] In this step, since the target component and the background in the binary area have a high degree of distinction, it is possible to directly determine whether the target component area is a closed connected area. Whether the target component area is a closed connected area directly affects the method used to locate the target component.

[0065] S105: Based on the determination result of whether the target component region is a closed connected region, obtaining the position information of the target component.

[0066] In this step, there are two target component positioning methods corresponding to the target component region being a closed connected region and the target component region not being a closed connected region. The position information of the target component can be accurately obtained through the positioning methods corresponding to the respective situations.

[0067] In the scheme shown in step S101 to step S105, an image to be tested for an electronic device is obtained; the image to be tested includes multiple target components of the electronic device; the test area corresponding to each target component in the test image is determined; for the test area corresponding to any target component in the test area corresponding to each target component, the test area is binarized to obtain a binarized area; based on the binarized area, it is determined whether the target component area in the test area is a closed connected area; based on the determination result of whether the target component area is a closed connected area, the position information of the target component is obtained. Accurate positioning of the target component of the electronic device can be achieved.

[0068] In an optional solution, determining the area to be tested corresponding to each target component in the image to be tested includes:

[0069] Acquire a reference image for the electronic device; the reference image includes a plurality of target components of the electronic device and reference position areas thereof;

[0070] Based on the reference position area of ​​each target component in the reference image, the area to be tested of each target component in the image to be tested is determined.

[0071] In this application, combined Figure 2 As shown, the test area of ​​each target component in the test image is obtained based on the reference image of the electronic device. Specifically, the electronic device has a template image, namely the reference image. It includes each target component and the position area corresponding to each target component. Using the reference image as a reference for the test image, referring to the template position area (reference position area) of each target component, the test area corresponding to each target component is determined in the test image. It is simple and easy to implement, and can preliminarily locate the position of the area where each target component is located.

[0072] In an optional solution, obtaining the position information of the target component based on the determination result of whether the target component region is a closed connected region includes:

[0073] When the target component area is a closed connected area,

[0074] Based on the target extraction algorithm, the center coordinates of the target component are obtained;

[0075] Based on the center coordinates of the target component, the position information of the target component is obtained.

[0076] In this application, the target extraction algorithm is the Huffman circle detection algorithm. Figure 2 As shown in the figure, when the target component (screw hole) area is a closed connected area, the center coordinates (center coordinates) of the screw hole are directly calculated by the Huffman circle detection algorithm. The center coordinates of the screw hole can reflect the position information of the screw hole. When screwing the screw into the screw hole, the screw can be screwed in according to the center coordinates of the screw hole. In the case where the screw hole is a closed connected area, the Huffman circle detection algorithm can be used to quickly and accurately obtain the center coordinates of the screw hole, which is convenient for accurate screwing of the screw. For the relevant principles of the Huffman circle detection algorithm, please refer to the relevant technology and will not be repeated here.

[0077] In an optional solution, obtaining the position information of the target component based on the determination result of whether the target component region is a closed connected region includes:

[0078] When the target component area is not a closed connected area,

[0079] Determine the minimum bounding rectangle of the target component area in the area to be tested;

[0080] Taking the central coordinates of the minimum circumscribed rectangular frame as the center of the circle, generating a plurality of rectangular areas of preset sizes within the minimum circumscribed rectangular frame;

[0081] Based on the plurality of rectangular areas of preset sizes, the position information of the target component is obtained.

[0082] In this application, if the screw hole (target component) is not a closed connected area, the effect of directly using the Huffman circle detection algorithm to calculate the center coordinates of the target component is not ideal. Figure 2 , Figure 3 As shown in the figure, the minimum bounding rectangle of the screw hole is generated, and the center coordinates of the minimum bounding rectangle (such as Figure 3 A point in the figure is taken as the center of the circle, and a rectangular area of ​​a preset size is generated within the minimum circumscribed rectangular frame. The location information of the target component is obtained based on multiple rectangular areas of preset sizes. For the detailed process, please refer to the detailed description of the relevant parts below, which will not be repeated here.

[0083] In an optional solution, obtaining the position information of the target component based on the plurality of rectangular areas of preset sizes includes:

[0084] For any rectangular area of ​​multiple rectangular areas of preset sizes,

[0085] Traverse the grayscale values ​​of each pixel in the rectangular area, and take the pixel with the largest grayscale value gradient as the feature point of the rectangular area;

[0086] Based on the feature points of a plurality of rectangular areas of preset sizes, the position information of the target component is obtained.

[0087] In this application, combined Figure 2 As shown, for Figure 3 Any rectangular area shown in the figure traverses all the pixels in the rectangular area. It can be understood that the grayscale values ​​of the pixels inside the circle and on the circumference of the screw hole are different. Therefore, all the pixels in the rectangular area are traversed. When there is a grayscale value jump point, that is, when there is a grayscale value of a pixel that is significantly different from the grayscale value of other pixels in the rectangular area, the jump pixel point is considered to be a point located on the circumference of the screw hole, and it is used as a feature point in the rectangular area. Since the size of the rectangular area can be custom preset, a rectangular area may include one feature point or multiple feature points. The feature points of multiple rectangular areas of preset sizes together constitute the points on the circumference of the screw hole, and the position information of the screw hole is obtained based on the points on the circumference of the screw hole. The accuracy of the position information of the target component can be further guaranteed.

[0088] In an optional solution, obtaining the position information of the target component based on the feature points of a plurality of rectangular areas of preset sizes includes:

[0089] Arbitrarily grouping feature points of rectangular areas of multiple preset sizes into a group with a preset number to obtain multiple feature point combinations;

[0090] For any combination of feature points,

[0091] Based on the coordinate information of each feature point in the feature point combination, obtaining the candidate center coordinates of the target component;

[0092] Based on the multiple candidate center coordinates of the target component, the position information of the target component is obtained.

[0093] In this application, multiple feature points are divided into multiple groups, and the number of each group is preset, usually 3 points. In order to ensure the accuracy and comprehensiveness of the calculation, any 5 feature points in the embodiment of this application are grouped into a group to form a combination of multiple feature points. Figure 2 As shown, based on the coordinate information of the feature points in each feature point combination, the candidate center coordinates of the screw hole for the combination can be obtained. Specifically, the candidate center coordinates for any feature point combination are calculated using formulas (1) to (8):

[0094] R 2 =(xA) 2 +(yB) 2 Formula (1)

[0095] Expanding formula (1) yields formula (2):

[0096] R 2 =x 2-2Ax+A 2 +y 2 -2By+B 2 Formula (2)

[0097] Let a = -2A, b = -2B, c = A 2 +B 2 -R 2 , we get formula (3):

[0098] x 2 +y 2 +ax+by+c=0 Formula (3)

[0099] Let δ = x 2 +y 2 +ax+by+c, then input the feature point (x i ,y i ), we get formula (4):

[0100] δ i =x i 2 +y i 2 +ax i +by i +c Formula (4)

[0101] Let Q(a, b, c) equal to δ i The sum of the squares of

[0102] Q(a, b, c) = ∑δ i 2 =∑(x i 2 +y i 2 +ax i +by i +c) 2 Formula (5)

[0103] Therefore, we only need to obtain the parameters a, b, c so that the value of Q(a, b, c) is minimized. Specifically, we take the partial derivative of Q(a, b, c) with respect to a, b, c respectively, and set the partial derivative function equal to 0 to obtain the extreme point:

[0104]

[0105] By inputting the coordinate information of the five feature points in each feature point combination, the values ​​of the unknowns a, b, and c can be solved through formulas (6) to (8), and then the values ​​of A, B, and R can be obtained. Among them, A is the horizontal coordinate of the candidate center coordinate. B is the vertical coordinate of the candidate center coordinate. R is the radius of the screw hole.

[0106] Based on the obtained multiple candidate center coordinates, the center coordinates of the final target component are screened out, and then the position information of the target component is obtained, which is easy to implement and can further ensure accuracy.

[0107] In an optional solution, obtaining the position information of the target component based on a plurality of candidate center coordinates of the target component includes:

[0108] The candidate center coordinate with the largest number of repetitions among the multiple candidate center coordinates is used as the center coordinate of the target component;

[0109] Based on the central coordinates of the target component, the position information of the target component is obtained.

[0110] In this application, combined Figure 2 As shown in the figure, since there is only one center of the screw hole, even if different feature points are combined, the candidate center coordinates obtained in the end will always be the same. Therefore, a voting mechanism is adopted to use the candidate center coordinates with the most repetitions as the center coordinates of the screw hole. The center coordinates of the screw hole can reflect the position information of the screw hole. When screwing the screw into the screw hole, the screw can be screwed in according to the center coordinates of the screw hole. It can accurately locate and lock regular and irregular screw holes, and then accurately screw in the screws, improving work efficiency.

[0111] The present application also provides a target positioning device, such as Figure 4 As shown, the device comprises:

[0112] The first acquisition unit 401 is used to acquire an image to be tested for the electronic device; the image to be tested includes multiple target components of the electronic device;

[0113] A first determining unit 402 is used to determine the area to be tested corresponding to each target component in the image to be tested;

[0114] The second acquisition unit 403 is used to perform a binarization process on the to-be-tested area corresponding to any target component in the to-be-tested area corresponding to each target component to obtain a binarized area;

[0115] A second determining unit 404 is used to determine whether the target component region in the region to be tested is a closed connected region based on the binary region;

[0116] The third acquisition unit 405 is used to obtain the position information of the target component based on the determination result of whether the target component area is a closed connected area.

[0117] In an optional solution, the first determination unit 402 is used to obtain a reference image for the electronic device; the reference image includes multiple target components of the electronic device and their reference position areas; based on the reference position areas of each target component in the reference image, the area to be tested of each target component in the image to be tested is determined.

[0118] In an optional solution, the third acquisition unit 405 is used to obtain the center coordinates of the target component based on a target extraction algorithm when the target component area is a closed connected area; and obtain the position information of the target component based on the center coordinates of the target component.

[0119] In an optional scheme, the third acquisition unit 405 is used to determine the minimum circumscribed rectangular frame of the target component area in the test area when the target component area is not a closed connected area; generate multiple rectangular areas of preset sizes in the minimum circumscribed rectangular frame with the center coordinates of the minimum circumscribed rectangular frame as the center of the circle; and obtain the position information of the target component based on the multiple rectangular areas of preset sizes.

[0120] In an optional solution, the third acquisition unit 405 is used to traverse the grayscale values ​​of each pixel in any rectangular area of ​​a plurality of preset sizes, and take the pixel with the largest grayscale value gradient as the feature point of the rectangular area; based on the feature points of the rectangular areas of the plurality of preset sizes, obtain the position information of the target component.

[0121] In an optional solution, the third acquisition unit 405 is used to arbitrarily group the feature points of multiple rectangular areas of preset sizes into a group in a preset number to obtain multiple feature point combinations; for any feature point combination, based on the coordinate information of each feature point in the feature point combination, obtain the candidate center coordinates of the target component; based on the multiple candidate center coordinates of the target component, obtain the position information of the target component.

[0122] In an optional solution, the third acquisition unit 405 is used to use the candidate center coordinates with the largest number of repetitions among the multiple candidate center coordinates as the center coordinates of the target component; and obtain the position information of the target component based on the center coordinates of the target component.

[0123] It should be noted that the target positioning device in the embodiment of the present application solves the problem based on a principle similar to that of the aforementioned target positioning method. Therefore, the implementation process, implementation principle, and beneficial effects of the target positioning device can all be described in detail with reference to the implementation process, implementation principle, and beneficial effects of the aforementioned method, and the repeated parts will not be repeated.

[0124] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0125] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, 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, 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 application described and / or required herein.

[0126] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0127] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0128] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the target positioning method. For example, in some embodiments, the target positioning method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the target positioning method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the target positioning method in any other appropriate manner (e.g., by means of firmware).

[0129] 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), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0130] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can 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.

[0131] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. 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.

[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0133] The systems and techniques described herein may be implemented in a computing system that includes back-end 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 front-end 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 back-end components, middleware components, or front-end 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), and the Internet.

[0134] A computer 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 relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0135] 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 recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0136] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0137] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A target positioning method, characterized in that: The method comprises: Acquire an image to be tested for the electronic device; the image to be tested includes a plurality of target components of the electronic device; Determine the area to be tested corresponding to each target component in the image to be tested; For any target component in the target component corresponding area to be tested, Performing binarization processing on the area to be tested to obtain a binarized area; Based on the binary region, determining whether the target component region in the to-be-tested region is a closed connected region; Based on the determination result of whether the target component region is a closed connected region, the position information of the target component is obtained.

2. The method according to claim 1, characterized in that The step of determining the area to be tested corresponding to each target component in the image to be tested includes: Acquire a reference image for the electronic device; the reference image includes a plurality of target components of the electronic device and reference position areas thereof; Based on the reference position area of ​​each target component in the reference image, the area to be tested of each target component in the image to be tested is determined.

3. The method according to claim 1 or 2, characterized in that: The obtaining the position information of the target component based on the determination result of whether the target component area is a closed connected area includes: When the target component area is a closed connected area, Based on the target extraction algorithm, the center coordinates of the target component are obtained; Based on the central coordinates of the target component, the position information of the target component is obtained.

4. The method according to claim 1 or 2, characterized in that: The obtaining the position information of the target component based on the determination result of whether the target component area is a closed connected area includes: When the target component area is not a closed connected area, Determine the minimum bounding rectangle of the target component area in the area to be tested; Taking the central coordinates of the minimum circumscribed rectangular frame as the center of the circle, generating a plurality of rectangular areas of preset sizes within the minimum circumscribed rectangular frame; Based on the plurality of rectangular areas of preset sizes, the position information of the target component is obtained.

5. The method according to claim 4, characterized in that The obtaining the position information of the target component based on the plurality of rectangular areas of preset sizes includes: For any rectangular area of ​​multiple rectangular areas of preset sizes, Traverse the grayscale values ​​of each pixel in the rectangular area, and take the pixel with the largest grayscale value gradient as the feature point of the rectangular area; Based on the feature points of a plurality of rectangular areas of preset sizes, the position information of the target component is obtained.

6. The method according to claim 5, characterized in that The obtaining of the position information of the target component based on the feature points of the rectangular areas of a plurality of preset sizes includes: Arbitrarily grouping feature points of rectangular areas of multiple preset sizes into a group with a preset number to obtain multiple feature point combinations; For any combination of feature points, Based on the coordinate information of each feature point in the feature point combination, obtaining the candidate center coordinates of the target component; Based on the multiple candidate center coordinates of the target component, the position information of the target component is obtained.

7. The method according to claim 6, characterized in that The obtaining the position information of the target component based on the multiple candidate center coordinates of the target component includes: The candidate center coordinate with the largest number of repetitions among the multiple candidate center coordinates is used as the center coordinate of the target component; Based on the central coordinates of the target component, the position information of the target component is obtained.

8. A target positioning device, characterized in that: The device comprises: A first acquisition unit is used to acquire an image to be tested for the electronic device; the image to be tested includes a plurality of target components of the electronic device; A first determining unit, used to determine the area to be tested corresponding to each target component in the image to be tested; A second acquisition unit is used to perform a binarization process on the area to be tested corresponding to any target component in the area to be tested corresponding to each target component, so as to obtain a binarized area; A second determination unit, configured to determine whether a target component region in the region to be tested is a closed connected region based on the binary region; The third acquisition unit is used to obtain the position information of the target component based on the determination result of whether the target component area is a closed connected area.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-7.