A device tilt angle detection method, system and electronic device
Patent Information
- Application Number
- CN202311079214.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2043-08-24
AI Technical Summary
[0005]针对现有技术的缺陷,本发明的目的在于提供一种器件倾斜角度检测方法、系统及电子设备,旨在解决现有器件倾斜角度检测方法精度差且耗时长的问题
[0046]本发明提供一种器件倾斜角度检测方法、系统及电子设备,通过利用器件在底板上的深度图提取器件上表面对应的高度平面和器件周围底板对应的高度平面,并利用两个平面的夹角确定器件相对底板的倾斜角度。由于本发明尽可能利用高度值相对集中的器件上表面信息和底板上表面信息来求取器件相对底板的倾斜角度,使得本发明求取的倾斜角度的精度较高,且本发明通过一次深度图扫描和ROI区域选取即可得到器件相对底板的倾斜角度,操作简单有效,耗时较短。
Smart Images

Figure CN117152248B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of device testing, and more specifically, relates to a method, system and electronic device for detecting device tilt angle. Background Technology
[0002] A device refers to a machine or part used for a specific purpose or to perform a specific function, such as an electronic device. Electronic devices include: resistors, capacitors, inductors, diodes, transistors, light-emitting diodes (LEDs), field-effect transistors (FETs), and metal-oxide-semiconductor field-effect transistors (MOS-FETs), etc.
[0003] In practical applications, devices are typically mounted on a base plate, which can be a substrate, PCB board, or insulating board, etc. In some cases, if the tilt angle of the device relative to the base plate does not meet the preset requirements, it will affect the device's performance. For example, for LED devices, different tilt angles relative to the base plate result in different brightness levels. Furthermore, for LED array light sources, if each LED has a different tilt angle relative to the base plate, the uncontrollable factors affecting the brightness of the entire LED array light source increase significantly. Therefore, it is necessary to detect the tilt angle of the device relative to the base plate to facilitate the evaluation and adjustment of device performance.
[0004] Existing methods for detecting device tilt angles first acquire a depth map of the device on a substrate, then generate two planes that intersect the device's depth map, resulting in two lines intersecting the device's surface and the substrate's surface. Finally, the tilt angle of the device relative to the substrate is determined by calculating the angle between these two lines. While this method can obtain the tilt angle of the device relative to the substrate, the calculation process only considers partial information from the device's surface and the upper surface of the substrate intersecting the planes, leading to relatively poor angle calculation accuracy. Furthermore, the calculation process requires calculating the intersection lines of the two planes with the upper and lower surfaces of the device and substrate, and then calculating the angle between these two intersection lines, which is time-consuming. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a device tilt angle detection method, system and electronic device, which aims to solve the problems of poor accuracy and long time consumption of the existing device tilt angle detection methods.
[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for detecting the tilt angle of a device, comprising the following steps:
[0007] Obtain a depth map of the device; the device is mounted on a base plate;
[0008] Extract the first region of interest (ROI) corresponding to the upper surface of the device from the depth map, and extract the second ROI corresponding to the base plate around the device;
[0009] The height plane corresponding to the first ROI is taken as the upper surface of the device; the height plane corresponding to the second ROI is taken as the upper surface of the base plate surrounding the device.
[0010] The tilt angle of the device relative to the base plate is determined by the upper surface of the device and the upper surface of the base plate surrounding the device.
[0011] It should be noted that the depth map is obtained by a camera, and each pixel value represents the distance of a point on the object from the camera. The taller the object, the closer it is to the camera, and the lighter the color it appears in the depth map; conversely, the shorter the object, the farther it is from the camera, and the darker the color it appears in the depth map.
[0012] Furthermore, generally speaking, the upper surface of a device has a certain area, and when imaging with a depth map, the height values of the image on its upper surface are relatively concentrated, and the colors are also similar. Correspondingly, the surface of the base plate is generally a plane, so when imaging the base plate around the device, the height values of the image on the upper surface of the base plate are also relatively concentrated. Therefore, based on the height values, a first ROI corresponding to the upper surface of the device and a second ROI corresponding to the upper surface of the base plate around the device can be selected on the grayscale image. Then, the tilt angle of the device relative to the base plate can be determined based on the angle between the height planes corresponding to the first ROI and the second ROI.
[0013] Understandably, when a component is mounted on a base plate, it generally means that the component is soldered, plugged in, or fixedly connected to the base plate. Typically, the component is mounted vertically on the base plate, in which case its upper surface is parallel to the upper surface of the base plate. When the component is not mounted vertically on the base plate, its upper surface is not parallel to the upper surface of the base plate, and an angle exists between them. This angle is also the tilt angle of the component relative to the vertical direction of the base plate.
[0014] For example, before extracting the first ROI corresponding to the upper surface of the device and the second ROI corresponding to the base plate around the device, the area where the device is located and the area of the base plate around the device are determined from the depth map based on the actual distribution of the device on the base plate. Then, the first ROI is extracted from the depth map in the area where the device is located based on the height information of the depth map, and the second ROI corresponding to the upper surface of the base plate is extracted from the depth map in the area of the base plate around the device based on the height information of the depth map.
[0015] In an optional example, the first ROI is extracted as follows:
[0016] Determine the average height of the area where the device is located based on the height information contained in the depth map;
[0017] The sub-region where the height value of the device is located is not more than the difference between its average height and a preset value, and is designated as the first ROI.
[0018] Specifically, regions with relatively concentrated height values are selected as the first ROI, while regions with excessively large or small height values are eliminated.
[0019] In an optional example, the method further includes the following steps:
[0020] After obtaining the first ROI using the average height, determine the height variance of the first ROI and / or the area ratio of the first ROI to the region where the device is located;
[0021] If either of the following two conditions is met, the first ROI will be re-extracted; the two conditions include: the height variance is greater than the set variance and the area ratio is less than the set proportion.
[0022] The step of re-extracting the first ROI is as follows:
[0023] Generate a rectangle with a preset width and preset length centered on the center of the area where the device is located, and determine the average height of the rectangle.
[0024] The region within a rectangle whose height value differs from its average height by no more than a preset value is designated as the first ROI.
[0025] Understandably, if the height variance of the first ROI is greater than the set variance, the height plane corresponding to the first ROI is not a relatively flat plane and cannot accurately reflect the plane corresponding to the upper surface of the device. If the area ratio of the first ROI to the area where the device is located is less than the set ratio, the area of the height plane corresponding to the first ROI is too small and will not accurately reflect the information of the upper surface of the device. Therefore, if at least one of the above two conditions exists, the first ROI needs to be re-extracted until the height variance of the extracted first ROI is not greater than the set variance and the area ratio of the first ROI to the area where the device is located is not less than the set ratio.
[0026] In an optional example, a second ROI is extracted from the depth map, specifically as follows:
[0027] On the depth map, a preset area is extended outward from the region where the device is located to obtain the extended area; the extended area does not include the region where the device is located.
[0028] The region whose height value differs from its average height value within the extended region is designated as the second ROI.
[0029] It should be noted that the second ROI surrounds the first ROI, and the height information corresponding to the second ROI reflects the plane corresponding to the base plate around the device, while the height information corresponding to the first ROI reflects the plane corresponding to the upper surface of the device.
[0030] In an optional example, a preset area is extended outward from the region where the device is located on the depth map, specifically:
[0031] Based on the length and width of the area where the device is located, the length and width are extended to both ends by a preset value, and the extended part is taken as the extended area; the preset value is set so that the extended area only covers the base plate around the device.
[0032] In an optional example, the tilt angle of the device relative to the base plate is determined based on the upper surface of the device and the upper surface of the base plate surrounding the device, specifically:
[0033] The included angle between the two upper surfaces is taken as the tilt angle of the device relative to the base plate.
[0034] For example, the angle between the two upper surfaces is determined by the following steps: determining the plane normal vector of the upper surface of the device and the plane normal vector of the upper surface of the base plate surrounding the device; and taking the angle between the two plane normal vectors as the angle between the two upper surfaces.
[0035] In one optional example, the device is an LED.
[0036] In an optional example, the sub-regions whose height values differ from the average height value by no more than a preset value include at least one of the following: merging all sub-regions as the corresponding ROI, merging the sub-region with the largest area among all sub-regions as the corresponding ROI, or merging all sub-regions whose area exceeds a threshold as the corresponding ROI.
[0037] In an optional example, when there are multiple devices to be detected and multiple devices are set on a base plate, firstly, the depth map of at least one device on the base plate is obtained. Then, based on the position information of the device on the base plate, the region where each device is located is divided from the depth map. Finally, based on the region where each device is located, the first ROI and the second ROI of each device are determined, so as to determine the tilt angle of each device relative to the base plate based on the first ROI and the second ROI of each device.
[0038] In a second aspect, the present invention provides a device tilt angle detection system, comprising:
[0039] A depth map acquisition module is used to acquire a depth map of the device; the device is mounted on a base plate.
[0040] The ROI extraction module is used to extract the first ROI corresponding to the upper surface of the device from the depth map, and to extract the second ROI corresponding to the base plate around the device.
[0041] The tilt angle determination module is used to take the height plane corresponding to the first ROI as the upper surface of the device, and the height plane corresponding to the second ROI as the upper surface of the base plate surrounding the device; and to determine the tilt angle of the device relative to the base plate based on the upper surface of the device and the upper surface of the base plate surrounding the device.
[0042] Thirdly, the present invention provides an electronic device comprising: at least one memory for storing a program; and at least one processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to perform the method described in the first aspect or any optional example of the first aspect.
[0043] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to perform the methods described in the first aspect or any optional example of the first aspect.
[0044] Fifthly, the present invention provides a computer program product that, when run on a processor, causes the processor to perform the method described in the first aspect or any optional example of the first aspect.
[0045] In summary, the technical solutions conceived by this invention have the following beneficial effects compared with the prior art:
[0046] This invention provides a method, system, and electronic device for detecting the tilt angle of a device. It extracts a height plane corresponding to the upper surface of the device and a height plane corresponding to the surrounding base plate using a depth map of the device on a substrate. The tilt angle of the device relative to the base plate is then determined using the angle between these two planes. Because this invention utilizes information from the upper surface of the device and the upper surface of the base plate, where height values are relatively concentrated, to determine the tilt angle, the accuracy of the obtained tilt angle is high. Furthermore, this invention can obtain the tilt angle of the device relative to the base plate with a single depth map scan and ROI region selection, making it simple, effective, and time-efficient. Attached Figure Description
[0047] Figure 1 This is a flowchart of the device tilt angle detection method provided in the embodiments of the present invention;
[0048] Figure 2 This is a depth diagram of a single LED device on a substrate provided in an embodiment of the present invention;
[0049] Figure 3 This is a planar schematic diagram of the depth map of a single LED device provided in an embodiment of the present invention;
[0050] Figure 4This is a depth diagram of multiple LED devices on the substrate provided in the embodiments of the present invention;
[0051] Figure 5 This is a planar schematic diagram of the depth map of multiple LED devices provided in the embodiments of the present invention;
[0052] Figure 6 This is a schematic diagram of dividing the region where each LED is located in a depth map of multiple LED devices, provided by an embodiment of the present invention;
[0053] Figure 7 This is a partitioning diagram of a single LED device in the region of the depth map provided in an embodiment of the present invention;
[0054] Figure 8 This is a schematic diagram of the ROI region corresponding to the upper surface of the LED device provided in an embodiment of the present invention;
[0055] Figure 9 This is another schematic diagram of the ROI region corresponding to the upper surface of the LED device provided in this embodiment of the invention;
[0056] Figure 10 This is a schematic diagram of dividing the area where the LED device is located into rectangles according to an embodiment of the present invention;
[0057] Figure 11 This is another schematic diagram of the ROI region corresponding to the upper surface of the LED device provided in this embodiment of the invention;
[0058] Figure 12 This is a schematic diagram of the extended area surrounding the LED device provided in an embodiment of the present invention;
[0059] Figure 13 This is a schematic diagram of the ROI area corresponding to the base plate surrounding the LED device provided in an embodiment of the present invention;
[0060] Figure 14 This is a schematic diagram of two RIO regions provided in an embodiment of the present invention; wherein, S1 is the ROI on the upper surface of the LED device, and S2 is the ROI on the upper surface of the base plate surrounding the LED device;
[0061] Figure 15 This is an architecture diagram of the device tilt angle detection system provided in an embodiment of the present invention. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0063] In this article, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The symbol " / " in this article indicates that the related objects are in an "or" relationship; for example, A / B means A or B.
[0064] The terms "first" and "second," etc., used in the specification and claims herein are used to distinguish different objects, not to describe a specific order of objects. For example, "first ROI" and "second ROI," etc., are used to distinguish different ROIs, not to describe a specific order of ROIs.
[0065] In embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0066] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more, for example, multiple devices means two or more devices, multiple regions means two or more regions, etc.
[0067] First, the technical terms involved in the embodiments of the present invention will be introduced.
[0068] (1) Depth map
[0069] Depth maps, also known as distance images, are images that use the distance (i.e., depth) from the camera to various points in the scene as pixel values. They directly reflect the geometry of the visible surfaces of objects and can also be called 3D point cloud maps.
[0070] (2)ROI
[0071] In machine vision and image processing, the region to be processed is delineated from the image using shapes such as boxes, circles, ellipses, and irregular polygons. This region is called the Region of Interest (ROI).
[0072] Next, the technical solutions provided in the embodiments of the present invention will be introduced.
[0073] Figure 1 This is a flowchart of the device tilt angle detection method provided in the embodiments of the present invention; as shown. Figure 1 As shown, it includes the following steps:
[0074] S101, Obtain a depth map of the device; the device is mounted on a base plate;
[0075] S102, extract the first ROI corresponding to the upper surface of the device from the depth map, and extract the second ROI corresponding to the base plate around the device;
[0076] S103, take the height plane corresponding to the first ROI as the upper surface of the device, and the height plane corresponding to the second ROI as the upper surface of the base plate around the device.
[0077] S104, determine the tilt angle of the device relative to the base plate based on the upper surface of the device and the upper surface of the base plate surrounding the device.
[0078] In one example, the first ROI is extracted as follows:
[0079] Determine the average height of the area where the device is located based on the height information contained in the depth map;
[0080] The sub-region where the height value of the device is located is not more than the difference between its average height and a preset value, and is designated as the first ROI.
[0081] In one example, after obtaining the first ROI using the average height, the height variance of the first ROI and / or the area ratio of the first ROI to the region where the device is located are determined;
[0082] If either of the following two conditions is met, the first ROI will be re-extracted; the two conditions include: the height variance is greater than the set variance and the area ratio is less than the set proportion.
[0083] Specifically, the steps for re-extracting the first ROI are as follows:
[0084] Generate a rectangle with a preset width and preset length centered on the center of the area where the device is located, and determine the average height of the rectangle.
[0085] The region within a rectangle whose height value differs from its average height by no more than a preset value is designated as the first ROI.
[0086] Optionally, a second ROI is extracted from the depth map, specifically as follows:
[0087] On the depth map, a preset area is extended outward from the region where the device is located; the extended area includes the base plate surrounding the device.
[0088] The region whose height value differs from its average height value within the extended region is designated as the second ROI.
[0089] Optionally, a preset area is extended outward from the region where the device is located on the depth map, specifically:
[0090] Based on the length and width of the area where the device is located, the length and width are extended to both ends by a preset value, and the extended part is taken as the extended area; the preset value is set so that the extended area only covers the base plate around the device.
[0091] Optionally, the tilt angle of the device relative to the base plate is determined based on the upper surface of the device and the upper surface of the base plate surrounding the device, specifically as follows:
[0092] Determine the plane normal vector of the upper surface of the device and the plane normal vector of the upper surface of the base plate surrounding the device, respectively;
[0093] The angle between the two plane normal vectors is taken as the tilt angle of the device relative to the base plate.
[0094] For example, the sub-regions whose height value differs from the average height value by no more than a preset value include at least one sub-region that is merged into a corresponding ROI, the sub-region with the largest area among all sub-regions is taken as a corresponding ROI, or the sub-regions with an area exceeding a threshold among all sub-regions are merged into a corresponding ROI.
[0095] In one embodiment, when there are multiple devices to be detected and the multiple devices are set on a base plate, the depth map of at least one device on the base plate is first obtained. Then, the area where each device is located is divided from the depth map according to the position information of the device on the base plate. Finally, the first ROI and the second ROI of each device are determined based on the area where each device is located, so as to determine the tilt angle of each device relative to the base plate according to the first ROI and the second ROI of each device.
[0096] It is understood that the method provided by this invention is applicable to any device whose surface area is not less than a threshold. When the surface area of the device is too small, such as when the device tip is pointed or has other shapes with excessively small areas, the method of this invention will no longer be applicable. More specifically, the devices to which the method of this invention is applicable include: LEDs, resistors, capacitors, inductors, diodes, transistors, FETs, and MOS-FETs, etc.; furthermore, the applicable LED devices include various types, such as: LEDs, microLEDs, miniLEDs, and laser diodes (LDs), etc.
[0097] The following examples illustrate the application of the method of the present invention to LEDs (including LEDs, microLEDs, miniLEDs, and LDs, etc.):
[0098] Figure 2 This is a depth diagram of a single LED device on a substrate provided in an embodiment of the present invention; as shown. Figure 2 As shown, the depth map scans the depth information of the LED device and its substrate. The higher the device, the closer it is to the camera, and the lighter its color. See the corresponding planar diagram for the depth map. Figure 3 As shown.
[0099] Figure 4This is a depth diagram of multiple LED devices on a substrate provided in an embodiment of the present invention; as shown. Figure 4 As shown, an LED array composed of multiple LED devices is mounted on a base plate. Depth information of each LED device and the base plate is obtained through a depth map. See the corresponding planar schematic diagram. Figure 5 As shown.
[0100] Furthermore, referring to the distribution information of multiple LED devices on the substrate and the resulting depth map, the areas where each LED device is located are roughly divided in the depth map. Since the devices are mounted on the substrate, their height values are all higher than the surface height of the substrate. Therefore, the color of the area where the device is located in the depth map will be lighter than the color of the substrate area. The area where the device is located can be divided based on the color depth, i.e., the height value. For Figure 5 See the preliminary device region partitioning diagram of the obtained depth map. Figure 6 As shown.
[0101] For example, to divide the area where each LED device is located, you can first obtain the approximate area of the LED, and then traverse the ROI of each LED to obtain the ROI1 representing the upper surface area of the LED and the ROI2 representing the surrounding base plate area of the current LED.
[0102] The following section further elaborates on how to extract ROI1 from the upper surface area of a single LED and ROI2 from the base plate area surrounding a single LED device:
[0103] Figure 7 This is a partitioning map of a single LED device within the depth map region provided in this embodiment of the invention; Figure 7 Based on this, the depth map is read and then processed as a grayscale image (the height value of each point is used as the grayscale value). The grayscale mean Mean1 of the LED region is calculated, and the image is segmented into regions [Mean1-y,Mean1+y] to obtain region1; where Region1 may be one or more regions.
[0104] In one example, when Region1 is a region, Region1 is directly used as ROI1; see [link / reference]. Figure 8 As shown.
[0105] In one example, when Region1 comprises multiple regions, the region with the largest area within Region1 is selected as ROI1; see [link to example]. Figure 8 As shown.
[0106] In one example, when Region1 comprises multiple regions, the regions with the largest areas are sorted by area, and the K regions with areas exceeding a threshold are merged into ROI1; see [link to example]. Figure 9 As shown.
[0107] It should be noted that the above operations are to eliminate areas that are too high or too low, and to obtain areas with relatively concentrated height values. A relatively concentrated height value also reflects that the height plane of the corresponding area is relatively flat, which can reflect the planar information of the device's upper surface.
[0108] Among them, areas with excessively high or low height values may be due to measurement errors introduced by objects other than the upper surface plane, or measurement errors introduced by the camera's measurement process itself.
[0109] Furthermore, the grayscale variance of ROI1, i.e., the height variance D, is calculated, and / or the area ratio A of Region1 and the area where the LED device is located is calculated. If D is greater than the set value D_T and / or A is less than the set value A_T, then ROI1 is recalculated. It should be noted that if D is greater than the set value D_T, it indicates that ROI1 is not a plane, and if A is less than the set value A_T, it indicates that the area of ROI1 is too small. In both cases, ROI1 does not truly reflect the complete information of the upper surface of the LED device.
[0110] For example, the method for recalculating ROI1 is as follows: See Figure 10 Generate a rectangle with dimensions Len and Wid centered on the area containing the LED, and select the region with the highest concentration of grayscale values (i.e., height values) as ROI1. See details... Figure 11 As shown.
[0111] The region with the most concentrated height values, that is, the region where the height values are distributed around the average height, is the region with the most concentrated height values. This region can exclude areas that are too high or too low, thus preserving relatively accurate planar information.
[0112] Figure 12 This is a schematic diagram of the extended area surrounding the LED device provided in an embodiment of the present invention; see also Figure 12 As shown, based on the length and width of the area where the LED device is located, the area where the LED device is located is expanded to obtain an extended area Region2 that does not include the area where the LED device is located.
[0113] Further, calculate the gray-level mean of Region2, i.e., the height mean Mean2; segment the image into [Mean2-x, Mean2+x] to obtain ROI2; see ROI2. Figure 13 As shown, the image was segmented using [Mean2-x,Mean2+x] to remove regions in Region2 that had excessively high or low height values.
[0114] Figure 14This is a schematic diagram of two RIO regions provided in an embodiment of the present invention; wherein, S1 is ROI1 on the upper surface of the LED device, and S2 is ROI2 on the upper surface of the base plate surrounding the LED device; further, the regions corresponding to ROI1 and ROI2 are respectively used as the upper surface of the LED and the upper surface of the base plate surrounding the LED, and their plane normal vectors Value1 and Value2 are calculated, and then the included angle between the two planes is calculated. The calculated included angle is used as the tilt angle of the LED device relative to the base plate, and the tilt angle of the LED relative to the base plate on which the LED is mounted is detected.
[0115] Figure 15 This is an architecture diagram of the device tilt angle detection system provided in an embodiment of the present invention; as shown below. Figure 15 As shown, it includes:
[0116] The depth map acquisition module 1510 is used to acquire the depth map of the device; the device is mounted on the base plate.
[0117] The ROI extraction module 1520 is used to extract the first ROI corresponding to the upper surface of the device from the depth map, and to extract the second ROI corresponding to the base plate around the device.
[0118] The tilt angle determination module 1530 is used to take the height plane corresponding to the first ROI as the upper surface of the device, and the height plane corresponding to the second ROI as the upper surface of the base plate surrounding the device; and to determine the tilt angle of the device relative to the base plate based on the upper surface of the device and the upper surface of the base plate surrounding the device.
[0119] Understandable, Figure 15 For detailed implementation of the functions of each module, please refer to the description in the aforementioned method embodiments, which will not be repeated here.
[0120] It should be understood that the above system is used to execute the methods in the above embodiments. The corresponding program modules in the system are similar in implementation principle and technical effect to those described in the above methods. The working process of the system can be referred to the corresponding process in the above methods, and will not be repeated here.
[0121] Based on the methods described in the above embodiments, this invention provides an electronic device. The device may include at least one memory for storing a program and at least one processor for executing the program stored in the memory. When the program stored in the memory is executed, the processor performs the methods described in the above embodiments.
[0122] Based on the methods in the above embodiments, this embodiment of the invention provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0123] Based on the methods in the above embodiments, this embodiment of the invention provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0124] It is understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor.
[0125] The method steps in these embodiments of the invention can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.
[0126] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0127] It is understood that the various numerical designations used in the embodiments of the present invention are merely for the convenience of description and are not intended to limit the scope of the embodiments of the present invention.
[0128] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting the tilt angle of a device, characterized in that, Includes the following steps: Obtain a depth map of the device; the device is mounted on a base plate; Extract the first ROI corresponding to the upper surface of the device from the depth map, and extract the second ROI corresponding to the base plate around the device; The height plane corresponding to the first ROI is taken as the upper surface of the device; the height plane corresponding to the second ROI is taken as the upper surface of the base plate surrounding the device. The tilt angle of the device relative to the base plate is determined based on the upper surface of the device and the upper surface of the base plate surrounding the device. Specifically, the extraction of the first ROI is as follows: Determine the average height of the area where the device is located based on the height information contained in the depth map; The sub-region where the height value of the device is located is not more than the difference between its average height and a preset value is designated as the first ROI. After obtaining the first ROI using the average height, determine the height variance of the first ROI and / or the area ratio of the first ROI to the region where the device is located; If either of the following two conditions is met, the first ROI will be re-extracted; the two conditions include: the height variance is greater than the set variance and the area ratio is less than the set proportion. The step of re-extracting the first ROI is as follows: Generate a rectangle with a preset width and preset length centered on the center of the area where the device is located, and determine the average height of the rectangle. The region within a rectangle whose height value differs from its average height by no more than a preset value is designated as the first ROI.
2. The method according to claim 1, characterized in that, The second ROI is extracted from the depth map, specifically as follows: On the depth map, a preset area is extended outward from the region where the device is located to obtain the extended area; the extended area does not include the region where the device is located. The region whose height value differs from its average height value within the extended region by no more than a preset value is designated as the second ROI.
3. The method according to claim 2, characterized in that, On the depth map, a preset area is extended outward from the region where the device is located, specifically: Based on the length and width of the area where the device is located, the length and width are extended to both ends by a preset value, and the extended part is taken as the extended area; the preset value is set so that the extended area only covers the base plate around the device.
4. The method according to claim 1, characterized in that, The tilt angle of the device relative to the base plate is determined based on the upper surface of the device and the upper surface of the base plate surrounding the device, specifically as follows: The included angle between the two upper surfaces is taken as the tilt angle of the device relative to the base plate.
5. The method according to claim 1, characterized in that, The device is a light-emitting diode (LED).
6. The method according to any one of claims 1-2, characterized in that, The sub-regions whose height value does not exceed the preset value compared to the average height value include at least one sub-region, which can be merging all sub-regions as the corresponding ROI, merging the sub-region with the largest area among all sub-regions as the corresponding ROI, or merging all sub-regions with an area exceeding a threshold as the corresponding ROI.
7. The method according to any one of claims 1-5, characterized in that, When there are multiple devices to be tested, and multiple devices are set on a base plate, firstly, the depth map of at least one device on the base plate is obtained. Then, based on the position information of the device on the base plate, the area where each device is located is divided from the depth map. Finally, based on the area where each device is located, the first ROI and the second ROI of each device are determined, so as to determine the tilt angle of each device relative to the base plate.
8. A device tilt angle detection system, characterized in that, include: Depth map acquisition module, used to acquire depth maps of the device; The device is mounted on the base plate; The ROI extraction module is used to extract the first ROI corresponding to the upper surface of the device from the depth map, and to extract the second ROI corresponding to the base plate around the device. The tilt angle determination module is used to take the height plane corresponding to the first ROI as the upper surface of the device, the height plane corresponding to the second ROI as the upper surface of the base plate surrounding the device, and to determine the tilt angle of the device relative to the base plate based on the upper surface of the device and the upper surface of the base plate surrounding the device. Specifically, the extraction of the first ROI is as follows: Determine the average height of the area where the device is located based on the height information contained in the depth map; The sub-region where the height value of the device is located is not more than the difference between its average height and a preset value is designated as the first ROI. After obtaining the first ROI using the average height, determine the height variance of the first ROI and / or the area ratio of the first ROI to the region where the device is located; If either of the following two conditions is met, the first ROI will be re-extracted; the two conditions include: the height variance is greater than the set variance and the area ratio is less than the set proportion. The step of re-extracting the first ROI is as follows: Generate a rectangle with a preset width and preset length centered on the center of the area where the device is located, and determine the average height of the rectangle. The region within a rectangle whose height value differs from its average height by no more than a preset value is designated as the first ROI.
Citation Information
Patent Citations
Posture adjusting method and device, computer equipment and storage medium
CN109730643A
Intelligent tower inclination detection method based on machine vision
CN113066120A