Positioning method, electronic device, and storage medium
Patent Information
- Application Number
- CN202611090886.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-13
AI Technical Summary
然而,在真实产线的混产材质场景中,A壳的颜色、反射率、表面工艺差异极大,不同工件在相同曝光条件下的成像质量差别明显,如深色哑光表面整体反射率较低,如果曝光值低,则容易导致边界不清晰,无法准确找到矩形边界;银色金属、亮面材质由于反射强,高曝光时边缘完全不可见
[0015]本申请实施例的定位方法中,直接基于多个曝光值获取目标对象的多个候选曝光图像,无需人工调整曝光值,较大的提升了生成效率,实时性较强;并且,本申请实施例的定位方法能够适用于不同颜色、不同材质、不同反射率的目标对象,并且,对目标对象的候选曝光图像进行轮廓检测以及边缘计算,在扩大适用范围的同时保证了定位精确度,以及成本较低。
Smart Images

Figure CN122906148A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of detection and positioning technology, and in particular to a positioning method, electronic device and storage medium. Background Technology
[0002] In the manufacturing process of electronic devices, it is often necessary to locate specific areas to perform specific operations. For example, on a laptop A-shell labeling production line, the position and angle of the groove on the A-shell need to be accurately detected to complete the labeling operation at the groove. The boundary of the groove is usually identified by the side shadow generated after the light source shines on it. However, in the mixed material scenarios of real production lines, the color, reflectivity, and surface finish of the A-shell vary greatly. Different workpieces will have significantly different imaging quality under the same exposure conditions. For example, dark matte surfaces have low overall reflectivity. If the exposure value is low, the boundary will be unclear, and it will be impossible to accurately find the rectangular boundary. Silver metal and glossy materials have strong reflectivity, and the edges are completely invisible under high exposure.
[0003] With the current trend of customization and flexible manufacturing, the same production line will produce multiple materials. Therefore, each new product needs to be shut down for debugging to meet process requirements, which leads to low production efficiency and high production costs. Summary of the Invention
[0004] The purpose of this application is to provide a positioning method, an electronic device, and a storage medium.
[0005] In a first aspect, embodiments of this application provide a positioning method, including: Multiple candidate exposure images of a target object are acquired; wherein each candidate exposure image corresponds to a different exposure value, and the target object includes target elements; Based on the contour and edge information corresponding to each candidate exposure image, a target exposure image that meets the preset conditions is selected from the multiple candidate exposure images. Based on the contour and edge information of the target exposure image, the pose information of the target element is determined from the target exposure image.
[0006] In one possible implementation, acquiring multiple candidate exposure images of the target object includes: Based on the preset upper exposure value, the preset lower exposure value, and the preset quantity, determine the exposure value sequence; Based on the exposure value sequence, multiple candidate exposure images of the target object are obtained.
[0007] In one possible implementation, the step of selecting a target exposure image that meets preset conditions from the plurality of candidate exposure images based on the contour information and edge information corresponding to each candidate exposure image includes: For each candidate exposure image, contour detection is performed to obtain the contour information of the candidate exposure image; Based on the contour information of the candidate exposure image, determine whether the candidate exposure image meets the first sub-condition; Based on the edge information of the candidate exposure images that meet the first sub-condition, a target exposure image that meets the second sub-condition is selected from a plurality of candidate exposure images.
[0008] In one possible implementation, determining whether the candidate exposure image meets the first sub-condition based on the contour information of the candidate exposure image includes: Based on the contour information of the candidate exposure image, the target contour of the candidate exposure image is determined; Determine all contour pixels corresponding to the target contour; Identify whether there is an interruption between two sequentially adjacent contour pixels; If there is an interruption between two sequentially adjacent contour pixels, compare the pixel gap between the two contour pixels with the threshold. If the pixel gap is less than or equal to the threshold, the candidate exposure image is determined to meet the first sub-condition.
[0009] In one possible implementation, the step of filtering target exposure images that satisfy a second sub-condition from a plurality of candidate exposure images based on the edge information of candidate exposure images that meet the first sub-condition includes: Based on the edge information of each candidate exposure image that meets the first sub-condition, determine the edge sharpness score of each candidate exposure image that meets the first sub-condition; Among the candidate exposure images that meet the first sub-condition, the candidate exposure image with the highest edge sharpness score is determined as the target exposure image.
[0010] In one possible implementation, determining the pose information of the target element from the target exposure image based on the contour and edge information of the target exposure image includes: Based on the contour and edge information of the target exposure image, the target contour of the target element in the target exposure image is determined; The edge lines of the target contour are fitted with straight lines to obtain a set of straight lines corresponding to the target element. Based on the set of lines, the pose information of the target element is calculated.
[0011] In one possible implementation, when the target element is a rectangular element, the pose information includes the center coordinates, width, height, and angle of the rectangular element relative to the target object.
[0012] In one possible implementation, the positioning method includes: Based on the pose information of the target element, a preset operation is performed on the target object.
[0013] Secondly, embodiments of this application also provide an electronic device, including: The acquisition module is configured to acquire multiple candidate exposure images of a target object; wherein each candidate exposure image corresponds to a different exposure value, and the target object includes target elements; The filtering module is configured to filter target exposure images that meet preset conditions from the multiple candidate exposure images based on the contour information and edge information corresponding to each candidate exposure image; The determination module is configured to determine the pose information of the target element from the target exposure image based on the contour information and edge information of the target exposure image.
[0014] Thirdly, embodiments of this application also provide a storage medium carrying one or more computer programs that, when executed by a processor, implement the steps of the above-described method.
[0015] In the positioning method of this application embodiment, multiple candidate exposure images of the target object are directly obtained based on multiple exposure values, without the need for manual adjustment of exposure values, which greatly improves the generation efficiency and has strong real-time performance. Furthermore, the positioning method of this application embodiment can be applied to target objects with different colors, materials, and reflectivities. In addition, contour detection and edge calculation are performed on the candidate exposure images of the target object, which expands the scope of application while ensuring positioning accuracy and low cost. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart of a positioning method provided in this application is shown; Figure 2 A schematic diagram showing multiple candidate exposure images of the target object is provided. Figure 3 A flowchart of a method for screening target exposure images provided in this application is shown; Figure 4A schematic diagram of candidate exposure images that meet the first sub-condition is shown; Figure 5 A schematic diagram is shown, showing the results of the first sub-condition arranged in order of edge sharpness score; Figure 6 The flowchart illustrating the positioning of the recess on the A-shell of a laptop computer provided in this application is shown. Figure 7 This application shows an exposed schematic diagram of the A-shell of a laptop computer. Figure 8 A schematic diagram of the structure of an electronic device provided in this application is shown; Figure 9 A schematic diagram of the structure of another electronic device provided in this application is shown. Detailed Implementation
[0018] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0019] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0020] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0021] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0022] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0023] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0024] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0025] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0026] To facilitate understanding of this application, a positioning method provided in this application will be described in detail below. In the embodiments of this application, the executing entity can be an electronic device, such as an electronic device for detecting the appearance of a laptop computer, etc. The electronic device includes a processor, an image acquisition device, etc.
[0027] As an example, Figure 1 A flowchart of the positioning method provided in the embodiments of this application is shown, wherein the specific steps include S101-S103.
[0028] S101, acquire multiple candidate exposure images of the target object; wherein, each candidate exposure image corresponds to a different exposure value, and the target object includes target elements.
[0029] For production lines requiring image inspection, image acquisition devices are typically installed to perform image acquisition tasks and inspect target objects. For example, in a production line for labeling the A-shell of a laptop, the target object is the laptop's A-shell, and the target element is the groove at the labeling location. Different inspection scenarios, requirements, and objects require different image acquisition devices, which can include cameras, infrared thermal imagers, and spectral cameras.
[0030] Optionally, based on a multi-exposure rapid imaging mechanism, an image acquisition device is used to acquire multiple candidate exposure images of the target object. The multi-exposure rapid imaging mechanism involves continuously acquiring multiple candidate exposure images of the target object within a short period of time, and each candidate exposure image corresponds to a different exposure value.
[0031] After acquiring multiple candidate exposure images, the image acquisition device transmits these images to the processor, enabling the processor to obtain the candidate exposure images of the target object for subsequent analysis and processing.
[0032] Optionally, when obtaining candidate exposure images of the target object, an exposure value sequence can be determined based on a preset upper exposure value, a preset lower exposure value, and a preset quantity, so as to obtain multiple candidate exposure images of the target object based on the exposure value sequence. The preset upper exposure value is the maximum exposure value that can be used when acquiring candidate exposure images, the preset lower exposure value is the minimum exposure value that can be used when acquiring candidate exposure images, and the preset quantity corresponds to the number of candidate exposure images.
[0033] Optionally, when determining the exposure value sequence, the equal interval step size between adjacent exposure values can be determined based on a preset upper limit exposure value, a preset lower limit exposure value, and a preset quantity, so that each exposure value is determined based on the equal interval step size, and the multiple exposure values form an exposure value sequence.
[0034] For example, the equal interval step size between adjacent exposure values is calculated by referring to the following formula (1).
[0035] (1) in, This represents the equal interval step size of the exposure value in logarithmic space. This indicates the preset upper limit of exposure value. This indicates the preset lower limit exposure value. Indicates the preset quantity. Take a positive integer.
[0036] After determining the equal interval step size, multiple exposure values are calculated using the following formula (2), wherein the multiple exposure values can form an exposure value sequence with logarithmic increments.
[0037] (2) in, Represents the first in the sequence Exposure value (unit: ), This represents the equal interval step size of the exposure value in logarithmic space. Represents the natural exponential function , This represents the current sequence index, with a value ranging from 1 to... .
[0038] Taking the production line for labeling laptop A-shells as an example, a preset upper limit exposure value can be set. The preset lower limit exposure value is taken as The preset quantity is 20. Of course, this preset quantity can be adjusted according to actual needs, such as the material of the target object, the number of images captured by the image acquisition device, etc. For example, Figure 2A schematic diagram is shown of multiple candidate exposure images collected based on a preset upper exposure value, a preset lower exposure value, and a preset number. Only a portion (e.g., 6) of the candidate exposure images are shown, but those skilled in the art should know that there are more than 6.
[0039] Correspondingly, the candidate exposure image of the target object can be represented by the following formula (3).
[0040] (3) in, Indicates the collected A collection of different candidate exposure images, I(E N ) Indicates the exposure value E N Candidate exposure images acquired below, E N Represents the first in the sequence One exposure value, Take a positive integer.
[0041] It should be noted that when determining the exposure value sequence, it is not necessary to set an equal interval between adjacent exposure values; that is, the interval between any two adjacent exposure values can be different. This application does not limit this, as long as the resulting exposure value sequence can meet the positioning requirements.
[0042] S102, based on the contour information and edge information corresponding to each candidate exposure image, select the target exposure image that meets the preset conditions from multiple candidate exposure images of exposure value.
[0043] After obtaining candidate exposure images of the target object, each candidate exposure image is processed to select the target exposure image from multiple candidate exposure images. Optionally, for each candidate exposure image, the contour information and edge information of the candidate exposure image are obtained respectively. Then, based on the contour information and edge information corresponding to each candidate exposure image, the target exposure image that meets the preset conditions is selected from multiple candidate exposure images of exposure values.
[0044] As an example, Figure 3 A flowchart of a method for selecting a target exposure image that meets preset conditions from multiple candidate exposure images based on the contour information and edge information corresponding to each candidate exposure image is shown. The specific steps include S301-S303.
[0045] S301, For each candidate exposure image, perform contour detection to obtain the contour information of the candidate exposure image.
[0046] S302, based on the contour information of the candidate exposure image, determine whether the candidate exposure image meets the first sub-condition.
[0047] S303, based on the edge information of the candidate exposure images that meet the first sub-condition, select the target exposure image that meets the second sub-condition from multiple candidate exposure images.
[0048] Optionally, after acquiring multiple candidate exposure images of the target object, contour detection is performed on each candidate exposure image to obtain its contour information. This can be achieved by pre-building and training a detection model to perform contour detection on each candidate exposure image; for example, the input to the detection model is the candidate exposure image, and the output is the contour information. Alternatively, image recognition techniques, such as analyzing and comparing pixel information in the candidate exposure images, can be used to obtain the contour information of each candidate exposure image.
[0049] After obtaining the contour information of each candidate exposure image, the system further determines whether the candidate exposure image corresponding to the contour information meets the first sub-condition based on this contour information. For example, when determining whether a candidate exposure image meets the first sub-condition, for each candidate exposure image, the target contour of the candidate exposure image is first determined based on the contour information of that candidate exposure image. The contour information may include contour pixels and the position of each contour pixel in the candidate exposure image. The target contour corresponds to a target element; that is, the target contour is acquired using an image acquisition device targeting the target element on the target object.
[0050] Specifically, the target contour can be determined by referring to the following formulas (4) and (5).
[0051] (4) (5) in, Indicates in candidate exposure image A mask for the detected target contour features. The feature detection function in this embodiment is trained using UET on a vertical domain dataset. This represents the binarized target contour. This represents a binary function.
[0052] Here, through the analysis of Binarization It can obtain clear outline pixels, which provides a guarantee for subsequent processing.
[0053] After obtaining the target contour or at the same time as obtaining the target contour, determine all contour pixels corresponding to the target contour, and further identify whether there is an interruption between two sequentially adjacent contour pixels. If there is an interruption between two sequentially adjacent contour pixels, compare the pixel gap between the two contour pixels with the threshold.
[0054] For example, on the binarized target contour, the contour pixels are traversed sequentially along the direction of the target contour to identify whether there is an interruption between two sequentially adjacent contour pixels. Once an interruption is identified between two sequentially adjacent contour pixels, the last non-zero contour pixel at the start of the interruption and the first non-zero contour pixel at the end of the interruption are located, and the pixel gap between the two contour pixels is calculated as the Euclidean distance (in pixels) between the two contour pixels.
[0055] The pixel gap can be calculated using the following formula (6).
[0056] (6) in, Indicates the first on the target contour The pixel gap at each breakpoint This represents the coordinates of the last non-zero pixel before the target contour breaks. This represents the coordinates of the first non-zero pixel after the target contour is broken. This indicates the calculation of the Euclidean distance between two coordinate points.
[0057] After obtaining the pixel gap, compare the pixel gap with the threshold. If the comparison result indicates that the pixel gap is less than or equal to the threshold, then the candidate exposure image is determined to meet the first sub-condition. Optionally, the candidate exposure image can be determined to meet the first sub-condition by the following formula (7).
[0058] (7) in, Indicates candidate exposure image The continuity of the target profile (1 indicates that the target profile is continuous and qualified, and 0 indicates that the target profile is discontinuous or not detected). Indicates the first on the target contour The pixel gap at each breakpoint The threshold represents the maximum permissible break gap of the target profile; for production lines that label laptop A-shells, this threshold can be 260 pixels.
[0059] It should be noted that multiple breaks may exist within the same target contour. The above processing is performed on each break to determine candidate exposure images that meet the first sub-condition. For example, Figure 4A schematic diagram of candidate exposure images that meet the first sub-condition is shown.
[0060] Furthermore, after identifying candidate exposure images that meet the first sub-condition, target exposure images that meet the second sub-condition are selected from multiple candidate exposure images based on the edge information of the candidate exposure images that meet the first sub-condition. For example, for each candidate exposure image that meets the first sub-condition, the pixel vertical gradient of the target contour of the candidate exposure image that meets the first sub-condition is calculated to obtain the edge sharpness score of the candidate exposure image that meets the first sub-condition. The formula for calculating the edge sharpness score can be referred to as formula (8) below.
[0061] (8) in, This represents candidate exposure images that meet the first sub-condition. Boundary clarity score, This represents a predefined region of interest (ROI) adjacent to the target contour. Indicates the region of interest The total number of pixels within, This represents candidate exposure images that meet the first sub-condition. In coordinates The pixel grayscale value at that location, Indicates coordinates The pixel vertical gradient of a pixel (in this embodiment, by...) Operator computation) It represents the absolute value of the vertical gradient of a pixel (which is used to measure the edge strength of that pixel in the vertical direction).
[0062] After obtaining the edge sharpness score of each candidate exposure image that meets the first sub-condition, the target exposure image is determined by formula (9).
[0063] (9) in, Indicates the target exposure image, Indicates taking such that Candidate exposure images that meet the first sub-condition and reach the maximum value , This indicates the selection of the target exposure image from the set of candidate exposure images that meet the first sub-condition.
[0064] As can be seen from the above formula (9), in this embodiment of the application, among the candidate exposure images that meet the first sub-condition, the candidate exposure image with the highest edge sharpness score is determined as the target exposure image. For example, Figure 5A schematic diagram is shown, illustrating the order of edge sharpness scores for those meeting the first sub-condition. Figure 5 The candidate exposure image corresponding to number 1 that meets the first sub-condition is the one with the highest edge sharpness score, which is also the target exposure image.
[0065] S103, Based on the contour and edge information of the target exposure image, determine the pose information of the target element from the target exposure image.
[0066] After determining the target exposure image, the contour and edge information of the target exposure image are identified to obtain the pose information of the target elements in the target object. For example, pixel recognition and pixel integration are performed based on the contour and edge information of the target exposure image to determine the target contour of the target elements in the target object. Then, straight line fitting is performed on the edge lines of the target contour to obtain the set of straight lines corresponding to the target elements. For example, the edge extraction results... Line fitting was performed using the RANSAC (Random Sample Consensus) algorithm.
[0067] The set of straight lines corresponding to the target contour of the target element can be obtained by the following formula (10).
[0068] (10) in, This represents the set of lines obtained from the reconstruction. This represents the RANSAC-based linear fitting function. This represents the interior point distance threshold in the RANSAC algorithm.
[0069] It is worth noting that this application embodiment addresses the scenario of labeling the A-shell of a laptop computer. The value is set to 10. Of course, this value can be adjusted based on the size of the target object, the size of the target element, the proportion of the target element in the target object, and the size of the exposed image. It can be increased or decreased, and is not limited to this.
[0070] Furthermore, the pose information is calculated based on the set of lines. When the target element is a rectangle, the pose information includes the center coordinates, width, height, and angle relative to the target object. For example, the pose information of the target element is obtained using the following formula (11).
[0071] (11) in, Represents the pose information of the target element. Representation based on the set of lines (When the target element is a rectangle, the set of lines includes four lines, that is...) Geometric calculation functions.
[0072] include , Represents the center coordinates of the rectangle element. This indicates the width and height of the rectangular element. This indicates the angle of the rectangle element relative to the target object.
[0073] After determining the pose information of the target elements within the target object, preset operations are performed on the target object based on this pose information to complete the preparation task for the target object. For example, in a scenario involving labeling the A-shell of a laptop, after determining the pose information of the target elements, this pose information is transmitted to the robotic arm. The robotic arm then performs the labeling operation on the target object based on this pose information, thereby ensuring the accuracy of the labeling and the product qualification rate. This avoids the problems of low production efficiency and high production costs caused by rework due to inaccurate labeling positions.
[0074] In the positioning method of this application embodiment, multiple candidate exposure images of the target object are directly obtained based on multiple exposure values, without the need for manual adjustment of exposure values, which greatly improves the generation efficiency and has strong real-time performance. Furthermore, the positioning method of this application embodiment can be applied to target objects with different colors, materials, and reflectivities. In addition, contour detection and edge calculation are performed on the candidate exposure images of the target object, which expands the scope of application while ensuring positioning accuracy and low cost.
[0075] Next, taking the example of a laptop A-shell labeling production line, we will combine... Figure 6 The flowchart shown illustrates the positioning of the recess on the A-shell of the laptop computer. Figure 7 The following is an illustration of the exposure pattern of the A-shell of the laptop: In practical applications, on laptop A-shell labeling production lines, electronic devices capture images of each laptop A-shell individually, i.e., photograph the A-shell to obtain 20 candidate exposure images. These candidate exposure images can be referenced... Figure 7 The first row of diagrams shown should be noted as follows: Figure 7 The first row does not show all candidate exposure images; only a portion (6) of the candidate exposure images are shown.
[0076] Since the label affixed to the A-shell is rectangular, the corresponding labeling area on the A-shell is also rectangular, such as a rectangular groove. Therefore, after acquiring 20 candidate exposure images of the A-shell, a coarse detection of rectangular continuity is performed on each candidate exposure image, that is, contour detection is performed on each candidate exposure image to obtain the contour information of each candidate exposure image, and based on the contour information, it is determined whether there is an interruption in the rectangular contour of each candidate exposure image. At this time, candidate exposure images with no interruption in the rectangular contour are obtained, wherein, referring to Figure 7 The second row of diagrams also does not show all candidate exposure images with unbroken rectangular outlines; only a portion (3) of the candidate exposure images with unbroken rectangular outlines are shown.
[0077] Furthermore, edge sharpness scores are assigned to candidate exposure images with uninterrupted rectangular outlines. After obtaining the edge sharpness score for each candidate exposure image with uninterrupted rectangular outlines, the candidate exposure images with uninterrupted rectangular outlines are arranged in the order of their scores. Figure 7 The diagram in the third row shows only the exposure image corresponding to the highest edge sharpness score (i.e., label 1), the fifth highest edge sharpness score (i.e., label 5), and the thirteenth highest edge sharpness score (i.e., label 13). In this case, the candidate exposure image with the highest edge sharpness score is determined as the target exposure image, which is the exposure image corresponding to label 1 in the third row.
[0078] Next, precise edge extraction is performed on the target exposure image to calculate the center and angle of the groove on shell A, which is then output to the labeling robot arm so that the labeling robot arm can perform the labeling operation based on the center and angle of the groove. Specifically, during precise edge extraction on the target exposure image, the target contour of the groove in the target exposure image, i.e., the rectangular contour, is determined based on the contour and edge information of the target exposure image. Straight line fitting is then performed on the edge lines of the target contour to obtain the set of straight lines corresponding to the groove. Finally, the pose information of the groove is calculated based on the set of straight lines, i.e., the center coordinates, width, height, and angle relative to the target object of the rectangular contour in the target exposure image. See the fourth row of the diagram shown in Figure 7 for further details.
[0079] The location process is now complete.
[0080] This application also provides an electronic device, Figure 8 This application provides a schematic diagram of the structure of an electronic device. Figure 8 It can be seen that the electronic device includes: The acquisition module 801 is configured to acquire multiple candidate exposure images of a target object; wherein each candidate exposure image corresponds to a different exposure value, and the target object includes target elements; The filtering module 802 is configured to filter target exposure images that meet preset conditions from the plurality of candidate exposure images based on the contour information and edge information corresponding to each candidate exposure image; The determination module 803 is configured to determine the pose information of the target element from the target exposure image based on the contour information and edge information of the target exposure image.
[0081] As another example, the specific configuration of module 801 is as follows: Based on the preset upper exposure value, the preset lower exposure value, and the preset quantity, determine the exposure value sequence; Based on the exposure value sequence, multiple candidate exposure images of the target object are obtained.
[0082] As another example, the filtering module 802 is specifically configured as follows: For each candidate exposure image, contour detection is performed to obtain the contour information of the candidate exposure image; Based on the contour information of the candidate exposure image, determine whether the candidate exposure image meets the first sub-condition; Based on the edge information of the candidate exposure images that meet the first sub-condition, a target exposure image that meets the second sub-condition is selected from a plurality of candidate exposure images.
[0083] As another example, the filtering module 802 is further configured to: Based on the contour information of the candidate exposure image, the target contour of the candidate exposure image is determined; Determine all contour pixels corresponding to the target contour; Identify whether there is an interruption between two sequentially adjacent contour pixels; If there is an interruption between two sequentially adjacent contour pixels, compare the pixel gap between the two contour pixels with the threshold. If the pixel gap is less than or equal to the threshold, the candidate exposure image is determined to meet the first sub-condition.
[0084] As another example, the filtering module 802 is further configured to: Based on the edge information of each candidate exposure image that meets the first sub-condition, determine the edge sharpness score of each candidate exposure image that meets the first sub-condition; Among the candidate exposure images that meet the first sub-condition, the candidate exposure image with the highest edge sharpness score is determined as the target exposure image.
[0085] As another example, the determining module 803 is specifically configured as follows: Based on the contour and edge information of the target exposure image, the target contour of the target element in the target exposure image is determined; The edge lines of the target contour are fitted with straight lines to obtain a set of straight lines corresponding to the target element. Based on the set of lines, the pose information of the target element is calculated.
[0086] In another example, when the target element is a rectangular element, the pose information includes the center coordinates, width, height, and angle of the rectangular element relative to the target object.
[0087] As another example, the electronic device also includes an execution module 804, which is configured as follows: Based on the pose information of the target element, a preset operation is performed on the target object.
[0088] In the positioning method of this application embodiment, multiple candidate exposure images of the target object are directly obtained based on multiple exposure values, without the need for manual adjustment of exposure values, which greatly improves the generation efficiency and has strong real-time performance. Furthermore, the positioning method of this application embodiment can be applied to target objects with different colors, materials, and reflectivities. In addition, contour detection and edge calculation are performed on the candidate exposure images of the target object, which expands the scope of application while ensuring positioning accuracy and low cost.
[0089] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 9 As shown, it includes at least a memory 901 and a processor 902. The memory 901 stores a computer program, and the processor 902 implements the method provided in any embodiment of this application when executing the computer program in the memory 901. Exemplarily, the steps of the electronic device computer program are as follows: S11-S13: S11, acquire multiple candidate exposure images of the target object; wherein, each candidate exposure image corresponds to a different exposure value, and the target object includes target elements; S12, based on the contour information and edge information corresponding to each candidate exposure image, select a target exposure image that meets the preset conditions from the multiple candidate exposure images; S13, Based on the contour information and edge information of the target exposure image, determine the pose information of the target element from the target exposure image.
[0090] This application also provides a storage medium that is a computer-readable medium, carrying one or more computer programs, which, when executed by a processor, implement the method provided in any embodiment of this application, including the following steps S21-S23: S21, acquire multiple candidate exposure images of the target object; wherein, each candidate exposure image corresponds to a different exposure value, and the target object includes target elements; S22, based on the contour information and edge information corresponding to each candidate exposure image, select a target exposure image that meets the preset conditions from the multiple candidate exposure images; S23, Based on the contour information and edge information of the target exposure image, determine the pose information of the target element from the target exposure image.
[0091] In the positioning method of this application embodiment, multiple candidate exposure images of the target object are directly obtained based on multiple exposure values, without the need for manual adjustment of exposure values, which greatly improves the generation efficiency and has strong real-time performance. Furthermore, the positioning method of this application embodiment can be applied to target objects with different colors, materials, and reflectivities. In addition, contour detection and edge calculation are performed on the candidate exposure images of the target object, which expands the scope of application while ensuring positioning accuracy and low cost.
[0092] It should be understood that in the embodiments of this application, the processor may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0093] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk. Optionally, in this embodiment, the processor executes the method steps described in the above embodiments according to the program code stored in the storage medium. Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, which will not be repeated here. Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed on a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be executed in a different order than those described here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any specific hardware and software combination.
[0094] Furthermore, although exemplary embodiments have been described herein, their scope includes any and all embodiments based on this application that have equivalent elements, modifications, omissions, combinations (e.g., schemes involving intersections of various embodiments), adaptations, or alterations. Elements in the claims will be interpreted broadly based on the language used in the claims and are not limited to the examples described in this specification or during the implementation of this application, which will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered illustrative only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0095] The above description is intended to be illustrative and not restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. Other embodiments may be used by those skilled in the art upon reading the above description. Furthermore, in the above detailed description, various features may be grouped together to simplify the application. This should not be construed as an intention that a disclosed feature not claimed is necessary for any claim. Rather, the subject matter of this application may be less than all the features of a particular disclosed embodiment. Thus, the following claims are incorporated herein by reference as examples or embodiments, wherein each claim is an independent, separate embodiment, and these embodiments are contemplated as being possible in various combinations or arrangements. The scope of this application should be determined by reference to the appended claims and the full scope of their equivalents.
[0096] The foregoing has described in detail several embodiments of this application, but this application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications based on the concept of this application, and all such variations and modifications should fall within the scope of protection claimed in this application.
Claims
1. A positioning method, characterized in that, include: Multiple candidate exposure images of a target object are acquired; wherein each candidate exposure image corresponds to a different exposure value, and the target object includes target elements; Based on the contour and edge information corresponding to each candidate exposure image, a target exposure image that meets the preset conditions is selected from the multiple candidate exposure images. Based on the contour and edge information of the target exposure image, the pose information of the target element is determined from the target exposure image.
2. The positioning method according to claim 1, characterized in that, The acquisition of multiple candidate exposure images of the target object includes: Based on the preset upper exposure value, the preset lower exposure value, and the preset quantity, determine the exposure value sequence; Based on the exposure value sequence, multiple candidate exposure images of the target object are obtained.
3. The positioning method according to claim 1, characterized in that, The step of selecting a target exposure image that meets preset conditions from the multiple candidate exposure images based on the contour information and edge information corresponding to each candidate exposure image includes: For each candidate exposure image, contour detection is performed to obtain the contour information of the candidate exposure image; Based on the contour information of the candidate exposure image, determine whether the candidate exposure image meets the first sub-condition; Based on the edge information of the candidate exposure images that meet the first sub-condition, a target exposure image that meets the second sub-condition is selected from a plurality of candidate exposure images.
4. The positioning method according to claim 3, characterized in that, The step of determining whether the candidate exposure image meets the first sub-condition based on the contour information of the candidate exposure image includes: Based on the contour information of the candidate exposure image, the target contour of the candidate exposure image is determined; Determine all contour pixels corresponding to the target contour; Identify whether there is an interruption between two sequentially adjacent contour pixels; If there is an interruption between two sequentially adjacent contour pixels, compare the pixel gap between the two contour pixels with the threshold. If the pixel gap is less than or equal to the threshold, the candidate exposure image is determined to meet the first sub-condition.
5. The positioning method according to claim 3, characterized in that, The step of filtering target exposure images that satisfy a second sub-condition from a plurality of candidate exposure images based on the edge information of candidate exposure images that meet the first sub-condition includes: Based on the edge information of each candidate exposure image that meets the first sub-condition, determine the edge sharpness score of each candidate exposure image that meets the first sub-condition; Among the candidate exposure images that meet the first sub-condition, the candidate exposure image with the highest edge sharpness score is determined as the target exposure image.
6. The positioning method according to claim 1, characterized in that, Determining the pose information of the target element from the target exposure image based on the contour and edge information of the target exposure image includes: Based on the contour and edge information of the target exposure image, the target contour of the target element in the target exposure image is determined; The edge lines of the target contour are fitted with straight lines to obtain a set of straight lines corresponding to the target element. Based on the set of lines, the pose information of the target element is calculated.
7. The positioning method according to claim 6, characterized in that, When the target element is a rectangular element, the pose information includes the center coordinates, width, height, and angle of the rectangular element relative to the target object.
8. The positioning method according to any one of claims 1-7, characterized in that, include: Based on the pose information of the target element, a preset operation is performed on the target object.
9. An electronic device, characterized in that, include; The acquisition module is configured to acquire multiple candidate exposure images of a target object; wherein each candidate exposure image corresponds to a different exposure value, and the target object includes target elements; The filtering module is configured to filter target exposure images that meet preset conditions from the multiple candidate exposure images based on the contour information and edge information corresponding to each candidate exposure image; The determination module is configured to determine the pose information of the target element from the target exposure image based on the contour information and edge information of the target exposure image.
10. A storage medium, characterized in that, The storage medium carries one or more computer programs, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.