Monocular test photometric stereo imaging detection method, apparatus and device, and storage medium
Through scientific configuration of multi-camera shooting plans and three-dimensional imaging processing, the problem of difficulty in capturing high-speed object images with a single camera is solved, comprehensive detection and resource optimization of high-speed objects are achieved, and detection efficiency and quality are improved.
Patent Information
- Application Number
- CN202411008637.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-08-30
AI Technical Summary
In automated production lines, it is difficult for a single camera to capture clear images of high-speed moving objects, resulting in the inability to accurately determine whether objects have defects, and unreasonable resource allocation, resulting in low detection efficiency.
By determining the running speed of the conveyor belt and the distance between objects, scientifically configure the shooting plan of multiple cameras, synthesize three-dimensional target images, achieve comprehensive and accurate detection of high-speed objects, optimize resource allocation, and differentially configure cameras and shooting times according to the shape and volume of objects to ensure Each camera performs only necessary tasks.
It achieves automated, comprehensive and accurate quality inspection of high-speed moving objects, improves inspection efficiency and quality, and ensures the accuracy of inspection results and the rational use of resources.
Smart Images

Figure CN118566239A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image acquisition technology, and in particular to a monocular test photometric stereoscopic imaging detection method, device, equipment and storage medium. Background Art
[0002] In automated production lines, quality inspection of mass-produced objects is a key step in ensuring product quality. To achieve this goal, objects are usually inspected in real time on a conveyor belt to identify and exclude defective objects.
[0003] Currently, visual inspection equipment such as high-speed cameras, 2.5D cameras, and 360-degree panoramic cameras are usually used to achieve this. These devices can quickly and continuously inspect the surface of objects to identify and eliminate defective objects in real time. However, due to the large number of objects to be inspected and the fact that they are all accompanied by the movement of conveyor belts, and the limited field of view of the camera, it is difficult to capture clear images of the objects to be inspected using the above methods, resulting in an inability to accurately determine whether the objects to be inspected have defects. Summary of the invention
[0004] The present application provides a monocular test photometric stereoscopic imaging detection method, device, equipment and storage medium for accurately capturing a clear image of an object to be tested, thereby accurately determining whether the object to be tested has defects.
[0005] In a first aspect, the present application provides a monocular test photometric stereo imaging detection method, the method comprising: obtaining the running speed of a conveyor belt, the interval between adjacent objects to be tested among a plurality of objects to be tested placed on the conveyor belt, and basic information of each of the objects to be tested; determining the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt and the interval between adjacent objects to be tested among a plurality of objects to be tested placed on the conveyor belt, and determining the shooting time and shooting area of each camera for each of the objects to be tested according to the number of cameras required for the detection area and the basic information of each of the objects to be tested, wherein the There are multiple shooting areas for the object to be tested, and each camera shoots at least one shooting area of each object to be tested, and there is a corresponding shooting time when each camera shoots at least one shooting area of each object to be tested; each camera is controlled to shoot each object to be tested according to the shooting time and the shooting area to obtain imaging data of each object to be tested by each camera; the imaging data of each object to be tested is synthesized to generate a target imaging of each object to be tested; the target imaging of each object to be tested is compared with the standard imaging of each object to be tested to determine whether each object to be tested has defects.
[0006] By adopting the above technical solution and establishing a monocular test photometric stereo imaging system, the automated, comprehensive and accurate quality inspection of high-speed moving objects is realized. The system can scientifically formulate a multi-camera shooting plan based on the conveyor belt and object parameters to ensure the coordination of each camera and obtain sufficient multi-view images, thus avoiding the problem that a single camera cannot achieve multi-angle shooting of high-speed objects. Through the three-dimensional imaging processing method, the system synthesizes multi-view images to generate a complete three-dimensional target image, overcoming the limitations of the detection effect based on a single two-dimensional image. Based on the three-dimensional target image, a comprehensive and accurate quality analysis and comparison of objects is realized, and objects with defects are effectively identified to meet the needs of industrial quality control. It can accurately capture clear images of the objects to be tested, thereby accurately determining whether the objects to be tested have defects.
[0007] Optionally, the method determines the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt and the interval between adjacent objects to be measured among multiple objects to be measured placed on the conveyor belt, and determines the shooting time and shooting area of each camera for each object to be measured according to the number of cameras required for the detection area and the basic information of each object to be measured, including: determining the time for each object to be measured to pass through the detection area of the conveyor belt according to the running speed of the conveyor belt and the interval between adjacent objects to be measured among multiple objects to be measured placed on the conveyor belt; determining the number of cameras required for the detection area of the conveyor belt according to the time for each object to be measured to pass through the detection area of the conveyor belt; and determining the shooting time and shooting area of each camera for each object to be measured in combination with the basic information of each object to be measured and the number of cameras required for the detection area.
[0008] By adopting the above technical solutions, by determining the number of cameras, shooting time and shooting area in detail, resource optimization configuration is achieved and detection efficiency is improved. The object passing time is calculated according to the conveyor belt speed and the object interval, and then the number of cameras is determined accordingly. In this way, monitoring resources can be scientifically configured to meet shooting needs and avoid resource waste. After determining the number of cameras, the system combines the basic information of the object to determine the shooting time and specific shooting area of each camera. Different objects and areas are differentiated according to parameters such as shape and volume to take care of individual differences. By accurately determining the above parameters, detection resources can be configured on demand so that each camera only completes the necessary shooting tasks, avoiding duplication and redundancy, thereby improving detection efficiency.
[0009] Optionally, the basic information includes shape and volume, and the step of determining the shooting time and shooting area of each camera for each object to be tested by combining the basic information of each object to be tested and the number of cameras required for the detection area includes: determining the shooting time and shooting area of each camera for each object to be tested by combining the shape and volume of each object to be tested and the number of cameras required for the detection area.
[0010] By adopting the above technical solution, by considering the shape and volume differences of objects, a differentiated shooting scheme based on individual characteristics is realized, thereby improving the detection quality. Specifically, after determining the number of cameras, the system will distinguish the shape and volume characteristics of different objects. For objects with complex shapes and large volumes, the system will arrange more cameras for multi-angle shooting, and provide sufficient shooting time to obtain a more comprehensive and complete view. For objects with simple shapes and small volumes, due to the small number of observable surfaces, the system can arrange fewer cameras for shooting, and greatly reduce the shooting time to avoid waste of resources. Through this differentiated treatment, the system realizes a customized shooting scheme based on individual differences. Each object obtains reasonable monitoring resources according to its own conditions, which not only ensures the quality of detection, but also improves efficiency.
[0011] Optionally, the method of determining the shooting time and shooting area of each camera for each object to be tested in combination with the shape and volume of each object to be tested and the number of cameras required for the detection area includes: determining the number of surfaces of each object to be tested and the area ratio of each surface according to the shape and volume of each object to be tested; allocating a shooting area corresponding to each object to be tested to each camera according to the number of surfaces of each object to be tested and the area ratio of each surface, and determining the shooting time of each camera corresponding to each object to be tested based on the shooting area of each object to be tested allocated to each camera.
[0012] By adopting the above technical solution, considering the number and area ratio of the object surface, a differentiated shooting scheme based on the area is realized, which improves the detection quality and efficiency. Specifically, the number of surfaces and the area ratio of each surface are calculated according to the shape and volume of the object. Then, the system reasonably allocates the shooting area to each camera according to the surface characteristics, assigning more cameras to large areas and relatively fewer cameras to small areas. After allocating the shooting area, the system further formulates a differentiated shooting duration plan based on the area corresponding to each camera. For large areas captured by the camera, the system assigns a shorter shooting duration; for small areas, a longer shooting duration is assigned. Through the above area optimization configuration, the system realizes the reasonable allocation of resources, so that each surface obtains a matching monitoring duration, which not only ensures the detection quality, but also prevents the waste of resources caused by excessive monitoring, thereby improving efficiency.
[0013] Optionally, controlling each of the cameras to shoot each of the objects to be tested according to the shooting duration and the shooting area to obtain imaging data of each of the objects to be tested by each camera includes: calculating the time when each of the objects to be tested enters the shooting area corresponding to each of the cameras; generating control instructions for each of the cameras according to the time when each of the objects to be tested enters the shooting area corresponding to each of the cameras, the control instructions including the shooting start time and end time of each of the cameras; controlling each of the cameras to shoot the shooting area corresponding to each of the objects to be tested according to the control instructions to obtain image acquisition data obtained by each of the cameras shooting each of the objects to be tested, and merging the image acquisition data of the same object to be tested shot by each of the cameras to obtain imaging data of each of the objects to be tested by each of the cameras.
[0014] By adopting the above technical solution, efficient and accurate image acquisition is achieved by accurately calculating and controlling the shooting time, thereby improving the detection effect. First, the exact time when each object enters the field of view of the corresponding camera is calculated, and then the camera's shooting start and end instructions are generated according to the entry time. After obtaining the control instruction, each camera is turned on on time according to the instruction, shoots and collects the object, and automatically turns off at the end time. The entire shooting process strictly follows the pre-calculated time plan. Through accurate time control, the system achieves accurate shooting of high-speed moving objects, avoids problems such as blurring and ghosting caused by excessive speed, and ensures image quality. At the same time, accurate time coordination also avoids omissions or duplications in shooting, and improves acquisition efficiency. This solution further optimizes shooting control, making detection more accurate and efficient.
[0015] Optionally, the synthesis of the imaging data of each of the objects to be measured to generate target imaging of each of the objects to be measured includes: obtaining internal and external parameters of each of the cameras; determining the position of the imaging data of each of the cameras on the objects to be measured in three-dimensional space according to the internal and external parameters of each of the cameras; according to the position of the imaging data of each of the cameras on the objects to be measured in three-dimensional space, splicing the imaging data acquired by each of the cameras on the same object to be measured to generate a point cloud model of each of the objects to be measured; and generating three-dimensional target imaging of each of the objects to be measured according to the point cloud model.
[0016] By adopting the above technical solution, a high-precision three-dimensional target image is generated through three-dimensional reconstruction technology, which improves the accuracy and reliability of detection. First, the internal and external parameters of each camera are calibrated to determine its imaging geometric characteristics. Then, based on the calibration results, the three-dimensional spatial coordinates of the same object point in different views are calculated. After knowing the three-dimensional coordinates, the image point cloud data of different perspectives are accurately spliced according to their positions in three-dimensional space. Finally, based on the spliced three-dimensional point cloud, the three-dimensional grid model of the object, that is, the target image, is reconstructed in a voxel manner. The three-dimensional target image integrates the information of each view and provides an accurate and complete three-dimensional structure reference. Detection and recognition based on this image can comprehensively analyze the three-dimensional surface characteristics of the object.
[0017] Optionally, after comparing the target image of each object to be tested and the standard image of each object to be tested to determine whether each object to be tested has defects, it also includes: marking the defective objects to be tested and generating a defect detection report for the defective objects to be tested, and sending the defect detection report to the terminal device of the staff so that the staff can repair the defective objects to be tested.
[0018] By adopting the above technical solution, after the defect is detected by comparison, the relevant information of the object with the problem is automatically recorded, and a defect detection report of the corresponding object is generated based on this information. The report is then pushed to the mobile terminal of the quality inspector through the network to achieve rapid feedback. The quality inspector can find and deal with the object with the problem in time according to the report, and carry out repair or replacement.
[0019] In a second aspect, the present application provides a monocular test photometric stereo imaging detection device, the device comprising: an acquisition module, a determination module, a control module, a synthesis module and a comparison module; wherein the acquisition module is used to obtain the running speed of the conveyor belt, the intervals between adjacent objects to be tested among a plurality of objects to be tested placed on the conveyor belt, and the basic information of each of the objects to be tested; the determination module is used to determine the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt and the intervals between adjacent objects to be tested among a plurality of objects to be tested placed on the conveyor belt, and determine the shooting time and shooting time of each camera for each object to be tested according to the number of cameras required for the detection area and the basic information of each object to be tested. The method comprises the following steps: the first step is to control each camera to shoot each object to be tested according to the shooting time and the shooting area, wherein the object to be tested has multiple shooting areas, each camera shoots at least one shooting area of each object to be tested, and each camera has a corresponding shooting time when shooting at least one shooting area of each object to be tested; the second step is to control each camera to shoot each object to be tested according to the shooting time and the shooting area, and obtain imaging data of each object to be tested by each camera; the third step is to synthesize the imaging data of each object to be tested and generate a target imaging of each object to be tested; the fourth step is to compare the target imaging of each object to be tested with the standard imaging of each object to be tested, and determine whether each object to be tested has defects.
[0020] By adopting the above technical solution and establishing a monocular test photometric stereo imaging system, the automated, comprehensive and accurate quality inspection of high-speed moving objects is realized. The system can scientifically formulate a multi-camera shooting plan based on the conveyor belt and object parameters to ensure the coordination of each camera and obtain sufficient multi-view images, thus avoiding the problem that a single camera cannot achieve multi-angle shooting of high-speed objects. Through the three-dimensional imaging processing method, the system synthesizes multi-view images to generate a complete three-dimensional target image, overcoming the limitations of the detection effect based on a single two-dimensional image. Based on the three-dimensional target image, a comprehensive and accurate quality analysis and comparison of objects is realized, and objects with defects are effectively identified to meet the needs of industrial quality control. It can accurately capture clear images of the objects to be tested, thereby accurately determining whether the objects to be tested have defects.
[0021] In a third aspect, the present application provides an electronic device, adopting the following technical solution: including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes a computer program such as any of the above-mentioned monocular test photometric stereoscopic imaging detection methods.
[0022] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned monocular test photometric stereoscopic imaging detection methods.
[0023] In summary, the present application includes at least one of the following beneficial technical effects: 1. Accurately capture clear images of the object to be tested, so as to accurately determine whether there are defects in the object to be tested; 2. By automatically generating reports and pushing feedback, it not only prevents omissions or misunderstandings of test results, but also achieves zero-delay connection between testing and subsequent processing, greatly improving the efficiency of quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of a monocular test photometric stereoscopic imaging detection method provided in an embodiment of the present application; Figure 2 It is a structural schematic diagram of a monocular test photometric stereoscopic imaging detection device provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0025] Description of reference numerals: 1000, electronic device; 1001, processor; 1002, communication bus; 1003, user interface; 1004, network interface; 1005, memory. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0027] In the description of the embodiments of the present application, words such as "illustrative", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "illustrative", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "illustrative", "for example" or "for example" is intended to present related concepts in a concrete way.
[0028] The present application adopts, including but not limited to, a 2.5D camera, and the camera has a 360-degree octahedral lens. The cameras mentioned in the present application can be understood as 2.5D cameras without explanation. Compared with ordinary cameras, 2.5D cameras can obtain three-dimensional information of the photographed target, including the length, width and height data of the target. This is very important for accurately judging the shape and volume of the object. The 360-degree octahedral lens can provide a full range of shooting angles to ensure that all surface information of the object is obtained without missing dead angles, thereby improving the comprehensiveness of the detection. The 2.5D camera combined with the 360-degree lens can obtain the three-dimensional structural data of the object to be tested in all directions within a limited shooting time, providing a basis for the subsequent generation of three-dimensional target images. This combination does not require a complex lens mechanical motion system, can reduce costs, and improve stability. The three-dimensional data acquisition and 360-degree full-view coverage of the 2.5D camera are very consistent with the needs of the batch detection scene of the present application.
[0029] The application scenario of this application can be understood as detecting whether each object in mass-produced objects has defects. Since the conveyor belt has a fixed conveying speed, the conveying speed is fixed, and there are multiple objects to be tested on the conveyor belt, which also move at a uniform speed following the conveyor belt, and there is a fixed interval between each object to be tested, in order to accurately detect whether each object to be tested has defects, it is necessary to determine the minimum number of cameras to be used (the camera is a 2.5D camera and a 360-degree octahedral lens). For example, if the conveyor belt speed is slow and the intervals between the objects to be tested are large, then the time left for the camera to shoot is more sufficient, and the number of cameras required is also less. Similarly, if the conveyor belt speed is fast or the intervals between the objects to be tested are small, then the number of cameras is relatively large.
[0030] On this basis, since each object to be tested moves with the conveyor belt, the shooting time is limited. Multiple cameras are used to shoot specific positions of the object to be tested, and finally the shooting results of each camera are combined to obtain the entire imaging data of each object to be tested.
[0031] It should be noted that the shooting mode of the camera in the present application is fixed shooting. For example, the current object to be measured is a cube, and there are six faces A, B, C, D, E, F, and G. There are several objects to be measured. After calculation, three cameras J, K, and L are needed to shoot the several objects to be measured. Then, camera J can be assigned to shoot the A and B faces of the several objects to be measured, camera K can shoot the C and D faces of the several objects to be measured, and camera L can shoot the E, F, and G faces of the several objects to be measured. Then, the shooting results of the three cameras J, K, and L can be combined to obtain the shooting results of all faces of the several objects to be measured.
[0032] Figure 1 is a flow chart of a monocular test photometric stereoscopic imaging detection method provided in an embodiment of the present application. It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0033] This application discloses a monocular test photometric stereo imaging detection method, such as Figure 1 As shown, the method includes S101-S105.
[0034] S101, obtaining the running speed of the conveyor belt, the interval between adjacent objects to be measured among a plurality of objects to be measured placed on the conveyor belt, and basic information of each object to be measured.
[0035] In one example, in order to accurately detect whether there are defects on multiple objects to be tested placed on a conveyor belt, it is necessary to image each object to be tested and compare it with a standard image. However, since the conveyor belt transports the objects to be tested at a certain linear speed and there is a certain interval between each object to be tested, the detection system faces limited shooting time when shooting each object to be tested. In order to obtain a complete image of each object to be tested within a limited time, it is necessary to intelligently determine the number of cameras required and the shooting plan for each camera. Specifically, the running speed of the conveyor belt determines the total time for each object to be tested to pass through the detection area, and the interval between the objects to be tested determines the independent time that each object can be photographed. These two together determine the available time for each camera to shoot each object.
[0036] Therefore, in this embodiment, the conveyor belt sensor is first used to measure and record the actual running speed of the conveyor belt; then the distance sensor is used to measure the distance between two adjacent objects to be tested on the conveyor belt; finally, the three-dimensional point cloud information of each object to be tested is scanned and extracted by a three-dimensional scanner, and the shape and volume parameters of each object are calculated based on the point cloud. After obtaining the above three types of information, the detection system can determine the number of cameras that need to be enabled in the conveyor belt detection area, as well as the specific shooting plan of each camera for each object, based on the conveyor belt speed, interval and basic information, so as to achieve subsequent efficient and comprehensive detection of all objects to be tested.
[0037] For the convenience of description, the multiple objects to be tested involved in this application are the same object. Of course, the multiple objects to be tested can also be different objects, depending on the actual situation. Even if the objects to be tested are different objects, the detection method is the same as the detection method when the objects to be tested are the same object. The specific implementation method can refer to the embodiments of this application, and no more details will be given here.
[0038] S102, determining the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt and the intervals between adjacent objects to be tested among multiple objects to be tested placed on the conveyor belt, and determining the shooting time and shooting area of each camera for each object to be tested according to the number of cameras required for the detection area and the basic information of each object to be tested, wherein there are multiple shooting areas for the object to be tested, each camera shoots at least one shooting area of each object to be tested, and each camera has a corresponding shooting time when shooting at least one shooting area of each object to be tested.
[0039] In one example, in order to obtain a complete image of each object to be tested within a limited shooting time, it is necessary to intelligently plan the shooting plan of each camera based on the conveyor belt speed, object interval and basic information obtained in S101. Specifically, the system first calculates the time it takes for each object to pass through the detection area based on the conveyor belt speed and interval, and then determines the minimum number of cameras required based on the time and the number of surfaces that need to be photographed. Next, the system determines whether the field of view of a single camera can completely cover each surface based on the shape and volume of each object. If not, multiple cameras are required for faceted shooting. The system assigns different surfaces to different cameras according to their area size. Surfaces with large areas are assigned longer shooting times, and surfaces with small areas are assigned shorter shooting times to ensure that each surface achieves the desired shooting effect.
[0040] After the above calculations, the system can obtain the object number, surface and required shooting time length that each camera needs to shoot, and generate a detailed shooting plan for each object to be tested. This plan takes into account both the limitation of limited shooting time and the impact of object shape and volume on the number of cameras and field of view, thereby reducing the number of cameras required while obtaining clear and complete images of the entire surface of the object to be tested to the greatest extent possible, thereby optimizing the cost-effectiveness of the detection system.
[0041] On the basis of the above embodiment, as an optional implementation, in S102: according to the running speed of the conveyor belt and the interval between adjacent objects to be measured among the multiple objects to be measured placed on the conveyor belt, the number of cameras required for the detection area of the conveyor belt is determined, and according to the number of cameras required for the detection area and the basic information of each object to be measured, the shooting time and shooting area of each camera for each object to be measured are determined. Specifically, it includes: according to the running speed of the conveyor belt and the interval between adjacent objects to be measured among the multiple objects to be measured placed on the conveyor belt, the time for each object to be measured to pass through the detection area of the conveyor belt is determined; according to the time for each object to be measured to pass through the detection area of the conveyor belt, the number of cameras required for the detection area of the conveyor belt is determined; in combination with the basic information of each object to be measured and the number of cameras required for the detection area, the shooting time and shooting area of each camera for each object to be measured are determined.
[0042] In one example, the system calculates the time it takes for each object to pass through the detection area based on the conveyor belt speed and object spacing, in accordance with the principle of equal time intervals. Then, based on the passing time and the number of surfaces that need to be photographed, the system uses the idea of time averaging to determine the minimum number of cameras required to complete the shooting requirements. After determining the number of cameras, the system determines whether the field of view of a single camera can completely cover all surfaces based on the shape and volume information of each object. If it can be fully covered, the shooting time of each camera for each object is the passing time calculated previously. If it cannot be fully covered, it is necessary to determine the surfaces that need to be assigned to multiple cameras, and determine the reasonable shooting time for each surface based on the size of the surface.
[0043] Through the above steps, the system can reasonably utilize limited camera resources and minimize the shooting time of a single camera while ensuring a complete and clear image. This can increase the overall throughput of the inspection system and meet the real-time online inspection needs of high-speed production lines.
[0044] The basic information includes shape and volume. Combined with the basic information of each object to be tested and the number of cameras required for the detection area, the shooting time and shooting area of each camera for each object to be tested are determined, including: Combined with the shape and volume of each object to be tested and the number of cameras required for the detection area, the shooting time and shooting area of each camera for each object to be tested are determined.
[0045] In one example, in order to develop a personalized shooting plan that takes both shape and volume into consideration, the system needs to comprehensively analyze the impact of both. Specifically, after the minimum number of cameras required has been determined, the system will first determine the shape of the object to be tested. If it is a simple shape such as a sphere or cube, based on its symmetry, all surfaces can be covered by moving one or a small number of cameras. If it is an asymmetrical shape, more cameras are required for multi-angle shooting.
[0046] Next, the system will determine whether the larger volume will cause a single camera to be unable to cover all surfaces. If so, the area ratio of different surfaces will be calculated, and the surfaces will be assigned to different cameras according to the size of the area. Large areas will be assigned longer shooting time, and small areas will be assigned shorter shooting time. Of course, the time allocation must be based on the total duration. After comprehensively considering the shape and volume, the system can develop a personalized shooting plan that ensures that a complete image is obtained while avoiding waste of resources, including parameters such as the shooting object, duration, and area of each camera, thereby optimizing detection efficiency and cost.
[0047] In combination with the shape and volume of each object to be measured and the number of cameras required for the detection area, the shooting time and shooting area of each camera for each object to be measured are determined, including: determining the number of surfaces of each object to be measured and the area ratio of each surface according to the shape and volume of each object to be measured; allocating a shooting area corresponding to each object to be measured to each camera according to the number of surfaces of each object to be measured and the area ratio of each surface, and determining the shooting time of each camera corresponding to each object to be measured according to the shooting area of each object to be measured allocated to each camera.
[0048] In one example, in order to reasonably arrange the shooting time of each camera, the system adopts a strategy in which the area ratio is inversely proportional to the shooting time. Specifically, after determining the required number of cameras and completing the surface area allocation, the system calculates the specific area of each surface of each object and calculates the percentage of the area of each surface to the total area of the object. Then, the system sorts the surfaces from large to small according to the area ratio, and allocates the shooting time in sequence according to the sorting results, so that the large-area surface is allocated with a longer shooting time, and the small-area surface is allocated with a shorter shooting time. This is because, within the limited total shooting time, the small-area surface itself can be shot in a shorter time; while the large-area surface requires a longer exposure time to obtain a clear image. Of course, the specific time allocation should be allocated according to the actual situation.
[0049] Through the above-mentioned time allocation method that is inversely proportional to the area, the system can make efficient use of the limited shooting time, ensuring that large-area surfaces have sufficient repeated shooting times and that small-area surfaces obtain clear details. In this way, a complete and high-quality multi-view image of the object can be obtained within a limited time, providing reliable guarantee for subsequent recognition and detection.
[0050] S103, controlling each camera to shoot each object to be measured according to the shooting time and shooting area, and obtaining imaging data of each object to be measured by each camera.
[0051] In one example, in order to guide each camera to accurately shoot the corresponding object to be measured according to the shooting plan generated in S102, each camera needs to be dynamically controlled in real time. Specifically, the system will first calculate the exact time when each object enters the field of view of each camera according to the plan, and then generate the corresponding camera control instructions based on this time. The instructions include parameters such as the opening time, closing time, and exposure mode of each camera. The system then transmits the instructions to the execution controller of each camera in real time through the communication interface. When the object enters the field of view, the controller will automatically turn on the camera and shoot according to the instructions; when the shooting is completed, the camera will be turned off. At the same time, the execution controller will transmit the captured data back to the system in real time.
[0052] Through the above closed-loop control method, the system can accurately grasp the working status of each camera and the motion status of each object, so as to ensure that each camera strictly shoots the corresponding object to be tested according to the shooting plan. This not only ensures that the entire surface of each object is captured, but also avoids unnecessary repeated shooting that wastes time and storage resources. Ultimately, the system can obtain complete and usable imaging data of each camera for each object to be tested as scheduled, laying the foundation for subsequent image processing and defect detection.
[0053] On the basis of the above embodiment, as an optional implementation mode, in S103: controlling each camera to shoot each object to be tested according to the shooting duration and the shooting area, and obtaining the imaging data of each object to be tested by each camera, including: calculating the time when each object to be tested enters the shooting area corresponding to each camera; generating a control instruction for each camera according to the time when each object to be tested enters the shooting area corresponding to each camera, the control instruction including the shooting start time and end time of each camera; controlling each camera to shoot the shooting area corresponding to each object to be tested according to the control instruction, and obtaining the image acquisition data obtained by each camera shooting each object to be tested, and merging the image acquisition data of each camera shooting the same object to be tested to obtain the imaging data of each camera for each object to be tested.
[0054] In one example, in order to accurately control each camera to shoot the corresponding object strictly according to the shooting plan, S103 adopts closed-loop control. Specifically, the system first calculates the exact time when each object enters the field of view of each camera according to the shooting plan formulated in S102. Then, the system generates a control instruction in advance based on the calculated entry time. The instruction contains parameters such as the start time and end time of each camera. During actual shooting, the system sends the instruction to the execution controller of each camera through the communication interface. When the object enters the field of view, the controller turns on the camera to shoot according to the instruction; when the end time is reached, it automatically turns off. At the same time, the controller will also feedback the shooting data in real time.
[0055] Through the above closed-loop control process, the system can accurately grasp the working status of each camera and the motion status of each object, so as to guide the camera to complete the shooting strictly according to the plan to avoid duplication or omission. In the end, the system obtains the object image data captured strictly according to the predetermined plan, laying a solid foundation for subsequent processing.
[0056] S104, synthesizing the imaging data of each object to be measured to generate a target imaging of each object to be measured.
[0057] In one example, in order to obtain a complete three-dimensional target image of each object to be measured, it is necessary to synthesize the two-dimensional images taken by each camera from different perspectives. Specifically, the system first calibrates each camera to obtain parameters such as the intrinsic parameter matrix and extrinsic parameter matrix of each camera. Then, based on these parameters, the system calculates the three-dimensional spatial coordinates of the object in each two-dimensional image through the principle of triangulation. Next, the system splices and aligns the two-dimensional images from different cameras but belonging to the same object according to their three-dimensional coordinate information. Finally, the system uses these aligned two-dimensional image point clouds to generate a three-dimensional mesh model of the object to be measured, that is, a complete target imaging.
[0058] The above image synthesis process makes full use of the positional relationship between different cameras. Through the geometric transformation algorithm, the scattered two-dimensional views are unified into three-dimensional space to generate a full range of three-dimensional target images. This not only overcomes the limitation of a single image perspective, but also enables objects of complex shapes to be fully modeled through faceted shooting. The final generated three-dimensional target image retains all the three-dimensional features of the object, providing a reliable basis for subsequent comparison detection and precise defect positioning.
[0059] The imaging data of each object to be measured are synthesized to generate a target imaging of each object to be measured, including: obtaining internal and external parameters of each camera; determining the position of the imaging data of each object to be measured by the camera in three-dimensional space according to the internal and external parameters of each camera; according to the position of the imaging data of each object to be measured by each camera in three-dimensional space, splicing the imaging data obtained by each camera for the same object to be measured to generate a point cloud model of each object to be measured; and generating a three-dimensional target imaging of each object to be measured according to the point cloud model.
[0060] In one example, in order to obtain a 3D target image of an object, the following steps are required: First, calibrate each camera separately, and obtain the intrinsic parameter matrix and extrinsic parameter matrix of each camera by calculation. The intrinsic parameter reflects the optical properties of the camera itself, and the extrinsic parameter determines the position and posture of the camera in space. These parameters are the basis for determining the geometric relationship of camera imaging. Then, based on the calibrated intrinsic and extrinsic parameters, the multi-view Figure 3The three-dimensional reconstruction algorithm calculates the three-dimensional spatial coordinates of the corresponding points of the object in each two-dimensional image. Although the views are very different, they can correspond to the same coordinate system through geometric relationships. Then, the system stitches and aligns the image point cloud data of different views but representing the same object according to their three-dimensional coordinates. With the help of this three-dimensional space, the influence of different camera viewing angles and distances can be overcome. Finally, the system generates a three-dimensional mesh model of the object based on the stitched three-dimensional point cloud, and establishes a complete three-dimensional image of the target object in a voxel manner. The image fully integrates the information of each view and provides a comprehensive three-dimensional description. This method of generating a three-dimensional target image from multiple views overcomes the limitations of a single view, provides an accurate three-dimensional reference, and lays a solid foundation for subsequent detection and recognition.
[0061] S105 , comparing the target image of each object to be tested with the standard image of each object to be tested to determine whether each object to be tested has a defect.
[0062] In one example, in order to detect whether each object to be tested has defects, its 3D target imaging needs to be compared with the standard imaging. First, the system reconstructs the standard imaging in 3D so that it is in the same coordinate system as the target imaging. Then, the system uses a 3D image registration algorithm to achieve precise alignment between the target imaging and the standard imaging. Next, the system compares the two at the pixel level and extracts the difference area between the two through threshold judgment. Finally, the system determines whether these areas constitute product defects based on the shape, size and other information of the difference areas.
[0063] The above image comparison technology makes full use of the three-dimensional information of target imaging and standard imaging, and can find local defects in a global range to avoid missed detection. Compared with the traditional method that only uses two-dimensional images, three-dimensional comparison significantly improves the accuracy and reliability of detection. Ultimately, the system can accurately determine whether each object to be tested has defects, and then generate a test report to provide a basis for the quality control department to make timely processing of the product.
[0064] After comparing the target image of each object to be tested with the standard image of each object to be tested to determine whether each object to be tested has defects, it also includes: marking the defective objects to be tested and generating a defect detection report for the defective objects to be tested, and sending the defect detection report to the terminal device of the staff so that the staff can repair the defective objects to be tested.
[0065] In one example, in order to apply the test results to quality control, after comparing and judging the existence of defects, the following operations need to be performed: First, the system automatically records the relevant information of the defective object to be tested, including object number, type, detection time, defect category, defect location distribution and other data. Then, based on this information, the system calls the report template to generate a text and image defect detection report for the corresponding object. The report clearly marks the location, shape, scale, etc. of the defect, and presents the problem intuitively. Then, the system pushes the automatically generated defect detection report to the mobile terminal of the quality inspector through the network to achieve rapid feedback. Finally, the quality inspector can find the problem object in time according to the report and repair or replace it. In this way, the test results are well connected with the maintenance process. By automatically generating reports and pushing feedback, not only can the mistakes caused by omissions in manual reports be prevented, but also the seamless connection between detection and processing is achieved, which greatly improves the efficiency of quality control.
[0066] Based on the above method, the present application also discloses a monocular test photometric stereo imaging detection device, such as Figure 2 As shown, Figure 2 It is a structural schematic diagram of a monocular test photometric stereo imaging detection device provided in an embodiment of the present application.
[0067] A monocular test photometric stereo imaging detection device, comprising: the device comprises: an acquisition module, a determination module, a control module, a synthesis module and a comparison module; wherein the acquisition module is used to acquire the running speed of a conveyor belt, the intervals between adjacent objects to be tested placed on the conveyor belt and the basic information of each object to be tested; the determination module is used to determine the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt and the intervals between adjacent objects to be tested placed on the conveyor belt, and determine the shooting time of each camera for each object to be tested according to the number of cameras required for the detection area and the basic information of each object to be tested. length and shooting area, wherein there are multiple shooting areas for the object to be tested, each camera shoots at least one shooting area of each object to be tested, and there is a corresponding shooting time when each camera shoots at least one shooting area of each object to be tested; a control module is used to control each camera to shoot each object to be tested according to the shooting time and shooting area, and obtain imaging data of each object to be tested by each camera; a synthesis module is used to synthesize the imaging data of each object to be tested and generate a target imaging of each object to be tested; a comparison module is used to compare the target imaging of each object to be tested with the standard imaging of each object to be tested to determine whether each object to be tested has defects.
[0068] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0069] See also Figure 3 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 3 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0070] The communication bus 1002 is used to realize the connection and communication between these components.
[0071] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0072] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0073] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.
[0074] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 3 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for a monocular test photometric stereoscopic imaging detection method.
[0075] exist Figure 3In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call an application program stored in the memory 1005 for a monocular test photometric stereo imaging detection method. When executed by one or more processors, the electronic device executes one or more methods described in the above embodiments.
[0076] An electronic device readable storage medium stores instructions, which, when executed by one or more processors, enable the electronic device to execute one or more of the methods described in the above embodiments.
[0077] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0078] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0079] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0080] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0083] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A monocular test photometric stereo imaging detection method, It is characterized in that The method comprises: Acquire the running speed of the conveyor belt, the interval between adjacent objects to be measured among a plurality of objects to be measured placed on the conveyor belt, and basic information of each of the objects to be measured; Determine the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt and the intervals between adjacent objects to be detected among a plurality of objects to be detected placed on the conveyor belt, and determine the shooting time and shooting area of each camera for each object to be detected according to the number of cameras required for the detection area and the basic information of each object to be detected, wherein there are a plurality of shooting areas for the object to be detected, each camera shoots at least one shooting area of each object to be detected, and each camera has a corresponding shooting time when shooting at least one shooting area of each object to be detected; Controlling each of the cameras to shoot each of the objects to be measured according to the shooting duration and the shooting area, and obtaining imaging data of each of the cameras on the objects to be measured; Synthesizing the imaging data of each of the objects to be measured to generate target imaging of each of the objects to be measured; The target image of each of the objects to be tested is compared with the standard image of each of the objects to be tested to determine whether each of the objects to be tested has defects.
2. The monocular test photometric stereo imaging detection method according to claim 1, It is characterized in that The method of determining the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt, the intervals between adjacent objects to be detected among a plurality of objects to be detected placed on the conveyor belt, and the basic information of each object to be detected, and determining the shooting time and shooting area of each camera for each object to be detected according to the number of cameras required for the detection area, includes: Determining the time for each of the objects to be detected to pass through the detection area of the conveyor belt according to the running speed of the conveyor belt and the interval between adjacent objects to be detected among a plurality of objects to be detected placed on the conveyor belt; Determining the number of cameras required for the detection area of the conveyor belt according to the time when each of the objects to be detected passes through the detection area of the conveyor belt; The shooting time and shooting area of each camera for each object to be detected are determined in combination with the basic information of each object to be detected and the number of cameras required for the detection area.
3. The monocular test photometric stereo imaging detection method according to claim 2, It is characterized in that The basic information includes shape and volume, and the combining the basic information of each object to be detected and the number of cameras required for the detection area to determine the shooting time and shooting area of each camera for each object to be detected includes: The shooting time and shooting area of each camera for each object to be detected are determined in combination with the shape and volume of each object to be detected and the number of cameras required for the detection area.
4. The monocular test photometric stereo imaging detection method according to claim 3, It is characterized in that The determining of the shooting time and shooting area of each camera for each object to be detected based on the shape and volume of each object to be detected and the number of cameras required for the detection area includes: Determining the number of surfaces of each of the objects to be measured and the area proportion of each of the surfaces according to the shape and the volume of each of the objects to be measured; According to the number of surfaces of each object to be measured and the area ratio of each surface, a shooting area corresponding to each object to be measured is allocated to each camera, and according to the shooting area of each object to be measured allocated to each camera, the shooting time of each camera corresponding to each object to be measured is determined.
5. The monocular test photometric stereo imaging detection method according to claim 1, It is characterized in that The controlling each of the cameras to shoot each of the objects to be measured according to the shooting duration and the shooting area to obtain imaging data of each of the objects to be measured by each of the cameras includes: Calculating the time when each of the objects to be measured enters the shooting area corresponding to each of the cameras; Generate a control instruction for each camera according to the time when each object to be measured enters the shooting area corresponding to each camera, wherein the control instruction includes the shooting start time and the end time of each camera; Control each of the cameras to shoot a shooting area corresponding to each of the objects to be tested according to the control instructions, obtain image acquisition data obtained by each of the cameras shooting each of the objects to be tested, merge the image acquisition data of the same object to be tested shot by each of the cameras, and obtain imaging data of each of the cameras for the objects to be tested.
6. The monocular test photometric stereo imaging detection method according to claim 1, It is characterized in that The step of synthesizing the imaging data of each of the objects to be measured to generate target imaging of each of the objects to be measured includes: Obtaining internal and external parameters of each of the cameras; Determining the position of the imaging data of each camera on each object to be measured in three-dimensional space according to the internal and external parameters of each camera; According to the positions of the imaging data of each camera on each of the objects to be measured in three-dimensional space, the imaging data acquired by each camera on the same object to be measured are spliced to generate a point cloud model of each of the objects to be measured; A three-dimensional target image of each of the objects to be measured is generated according to the point cloud model.
7. The monocular test photometric stereo imaging detection method according to claim 1, It is characterized in that After comparing the target image of each of the objects to be tested with the standard image of each of the objects to be tested to determine whether each of the objects to be tested has a defect, the method further includes: The defective object to be tested is marked and a defect detection report of the defective object to be tested is generated, and the defect detection report is sent to a terminal device of a staff member so that the staff member can repair the defective object to be tested.
8. A monocular test photometric stereo imaging detection device, It is characterized in that The device comprises: an acquisition module, a determination module, a control module, a synthesis module and a comparison module; wherein, The acquisition module is used to acquire the running speed of the conveyor belt, the interval between adjacent objects to be measured among a plurality of objects to be measured placed on the conveyor belt, and the basic information of each of the objects to be measured; The determination module is used to determine the number of cameras required for the detection area of the conveyor belt according to the running speed of the conveyor belt, the intervals between adjacent objects to be detected among multiple objects to be detected placed on the conveyor belt, and the basic information of each of the objects to be detected, and determine the shooting time and shooting area of each camera for each of the objects to be detected according to the number of cameras required for the detection area, wherein there are multiple shooting areas for the objects to be detected, each of the cameras shoots at least one shooting area of each of the objects to be detected, and each of the cameras has a corresponding shooting time when shooting at least one shooting area of each of the objects to be detected; The control module is used to control each of the cameras to shoot each of the objects to be measured according to the shooting duration and the shooting area, so as to obtain imaging data of each of the cameras on the objects to be measured; The synthesis module is used to synthesize the imaging data of each of the objects to be tested to generate target imaging of each of the objects to be tested; The comparison module is used to compare the target image of each of the objects to be tested with the standard image of each of the objects to be tested to determine whether each of the objects to be tested has defects.
9. An electronic device, It is characterized in that It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-7.
10. A computer-readable storage medium, It is characterized in that A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.
