Method and system for merging detection results of multiple cameras, and storage medium
By acquiring and analyzing the mapping relationship between the outline image of the material to be inspected and the camera template image, and merging the detection results of multiple cameras, the problem of the inability to merge detection results caused by different camera lighting is solved, and the accurate positioning of material spatial information and the unification of detection results are achieved.
Patent Information
- Application Number
- CN202511547184.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2025-12-16
AI Technical Summary
Due to significant differences in lighting from different cameras, the detection results from multiple cameras cannot be merged onto the same material, and spatial information about the detected material cannot be provided.
By acquiring the outline image of the material to be inspected, determining its position and rotation angle relative to each camera template image, and using a visual inspection software platform to capture and analyze the images, a mapping relationship is established. The inspection results of each camera are then merged based on the material outline relationship to obtain the inspection results and spatial information of the material to be inspected.
It enables the merging of detection results onto the same material under different camera lighting conditions, and can provide spatial information on the position and rotation angle of the detected material, thereby improving the versatility and accuracy of the detection results.
Smart Images

Figure CN121147273A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of die cutting detection, in particular to a merging method and system of detection results of multiple cameras and a storage medium. BACKGROUND
[0002] In the traditional visual detection field, the positioning of materials is often achieved by template matching, and then distance measurement, defect detection and other visual detection are performed on the corresponding template. However, in the die cutting detection field, since the die cutting product has front and back sides, and different lighting is needed to present different defect characteristics, the detection of the same material often needs multiple cameras to take pictures and perform detection. How to correspond the detection results of multiple cameras to the same material is crucial for subsequent yield statistics.
[0003] At present, the existing technical solution is to select part or all features of the imaging of the same material under each camera to establish a template, and then detect multiple templates in the picture through the corresponding template after each camera takes a picture, so as to correspond to multiple materials. Then, through the coordinate relationship between the cameras, the templates of different cameras are merged by whether there is an intersection. This requires that the templates of different cameras must be in approximately the same position, but when there is a serious difference in lighting between different cameras, the recognizable features may not be in the same position, thereby failing to meet the requirements. Moreover, since the template is a rectangle of variable size, the template area can be selected at any position of the material, which cannot reflect the coverage area of the material, thereby failing to provide sufficient spatial information for the subsequent selection of the position of automatic rejection. SUMMARY
[0004] Embodiments of the present application aim to provide a merging method and system of detection results of multiple cameras and a storage medium, and aim to solve the problem that the detection results of different cameras cannot be merged into the same material due to the serious difference in lighting between different cameras, and the spatial information of the detected material cannot be provided.
[0005] To solve the above technical problems, a first aspect of the present application provides a merging method of detection results of multiple cameras, comprising: obtaining a contour picture of a material to be detected; determining a detection result of a position and a rotation angle of the contour picture of the material to be detected relative to a template picture of each camera according to the contour picture of the material to be detected and the template picture of each camera; After each camera takes a picture and completes detection, the detection results of each template picture in each camera are merged through the relationship with the material contour to obtain the detection result and spatial information of the material to be detected.
[0006] Optionally, the obtaining of the contour picture of the material to be detected comprises: acquire a raw contour picture of the material to be detected transmitted by each camera; save the acquired raw contour picture of the material to be detected by using a screenshot tool built in the visual detection software platform to obtain a contour picture of the material to be detected after screenshot; extract the contour picture of the material to be detected from the contour picture of the material to be detected after screenshot by using a preset analysis algorithm.
[0007] Optionally, the detection result of the position and rotation angle of the contour picture of the material to be detected relative to the template picture of the camera includes: establish a mapping relationship between the template picture of the camera and the contour picture of the material to be detected; determine the mapping relationship between the contour picture of the material to be detected and the template picture of the camera according to the mapping relationship between the template picture of the camera and the contour picture of the material to be detected; determine the detection result of the position and rotation angle of the contour picture of the material to be detected relative to the template picture of the camera according to the contour picture of the material to be detected and the mapping relationship between the contour picture of the material to be detected and the template picture of the camera.
[0008] Optionally, the establishment of the mapping relationship between the template picture of the camera and the contour picture of the material to be detected includes: match the corresponding position on the contour picture of the material to be detected by taking the template picture of the camera as a template to obtain a first affine transformation matrix of the template picture of the camera relative to the contour picture of the material to be detected, that is, to establish the mapping relationship between the template picture of the camera and the contour picture of the material to be detected.
[0009] Optionally, the determination of the mapping relationship between the contour picture of the material to be detected and the template picture of the camera according to the mapping relationship between the template picture of the camera and the contour picture of the material to be detected includes: determine a second affine transformation matrix of the contour picture of the material to be detected relative to the template picture of the camera according to the first affine transformation matrix of the template picture of the camera relative to the contour picture of the material to be detected, that is, to determine the mapping relationship between the contour picture of the material to be detected and the template picture of the camera, the second affine transformation matrix of the contour picture of the material to be detected relative to the template picture of the camera being an inverse matrix of the first affine transformation matrix of the template picture of the camera relative to the contour picture of the material to be detected.
[0010] Optionally, the detection result of the position and rotation angle of the contour picture of the material to be detected relative to the template picture of the camera is determined according to the contour picture of the material to be detected and the mapping relationship between the contour picture of the material to be detected and the template picture of the camera, and the detection result comprises: The position and rotation angle of the contour picture of the material to be detected relative to the template picture of the camera are determined according to the contour picture of the material to be detected and the second affine transformation matrix N.
[0011] Optionally, after the photographing and detection of each camera are completed, the detection results of each template picture in each camera are merged through the relationship with the material contour to obtain the detection result and spatial information of the material to be detected. The contour pictures of the material to be detected corresponding to the template pictures of the cameras are unified into the same two-dimensional coordinate system. The detection results of each template picture in each camera are merged through the relationship with the material contour to obtain the detection result and spatial information of the material to be detected based on the same two-dimensional coordinate system.
[0012] Correspondingly, the second aspect embodiment of the present application provides a merging system of detection results of multiple cameras, comprising a visual device and an image processing device, wherein: The visual device collects original contour pictures of the material to be detected in a visual manner and transmits the original contour pictures to the image processing device through a preset transmission manner. The image processing device is internally provided with a visual detection software platform, acquires the original contour pictures of the material to be detected transmitted by each camera, acquires the contour pictures of the material to be detected from the original contour pictures of the material to be detected transmitted by each camera by calling the visual detection software platform, determines the detection result of the position and rotation angle of the contour picture of the material to be detected relative to the template picture of the camera according to the contour picture of the material to be detected and the template picture of each camera, and after the photographing and detection of each camera are completed, the detection results of each template picture in each camera are merged through the relationship with the material contour to obtain the detection result and spatial information of the material to be detected.
[0013] Correspondingly, the third aspect embodiment of the present application provides a merging system of detection results of multiple cameras, comprising an image processing device, wherein the image processing device comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the computer program is executed by the processor to realize the merging method of the detection results of multiple cameras according to the first aspect embodiment of the present application.
[0014] Correspondingly, the fourth aspect of the present application provides a storage medium, wherein the storage medium stores a plurality of camera detection result merging method programs, and the plurality of camera detection result merging method programs are executed by a processor to implement the plurality of camera detection result merging method of the first aspect of the present application.
[0015] Compared with the prior art, the plurality of camera detection result merging method and system, and the storage medium provided by the embodiments of the present application, the plurality of camera detection result merging method comprises: obtaining a contour picture of a material to be detected; determining a detection result of a position and a rotation angle of the contour picture of the material to be detected relative to a template picture of each camera according to the contour picture of the material to be detected and the template picture of each camera; after each camera takes a picture and completes detection, merging the detection result of each template picture in each camera through a relationship with the material contour to obtain a detection result and spatial information of the material to be detected. Thus, by merging the detection result of each template through the relationship with the material contour, the versatility is improved, various lighting conditions can be compatible, the detection results of different cameras can be merged on the same material, and the spatial information of the detected material including the position and the rotation angle can be given. Thus, the problem that the detection results of different cameras cannot be merged on the same material due to serious differences in lighting of different cameras and the spatial information of the detected material cannot be given can be solved. BRIEF DESCRIPTION OF DRAWINGS
[0016] One or more embodiments are exemplarily illustrated by pictures in the drawings corresponding to the embodiments, and the exemplarily illustrations do not constitute a limitation on the embodiments, elements with the same reference numerals in the drawings represent similar elements, unless otherwise specified, and the drawings do not constitute a proportional limitation.
[0017] Figure 1 is a structural schematic diagram of a plurality of camera detection result merging system provided by the present application; Figure 2 is a flow schematic diagram of a plurality of camera detection result merging method provided by the present application; Figure 3 is a structural schematic diagram of an image processing device in a plurality of camera detection result merging system provided by the present application. DETAILED DESCRIPTION
[0018] For the purpose of facilitating the understanding of the present application, the present application will be described in more detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that when an element is described as "fixed to" another element, it can be directly on the other element or one or more intervening elements can be present therebetween. When an element is described as "electrically connected to" another element, it can be directly connected to the other element or one or more intervening elements can be present therebetween. The terms "upper", "lower", "inner", "outer", "bottom", and the like used in the present specification indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are merely for the purpose of facilitating the description of the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", "third", and the like are only for the purpose of description and cannot be understood as indicating or implying relative importance.
[0019] Unless otherwise defined, all technical and scientific terms used in the present specification have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The term "and / or" used in the present specification includes any and all combinations of one or more of the related listed items.
[0020] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0021] In one embodiment, as shown in Figure 1 The present application provides a merging system 10 of multiple camera detection results, comprising a vision device 100 and an image processing device 900, wherein: The vision device 100 comprises at least one camera, each camera acquires an original outline picture of a material to be detected 200 in a visual manner, and transmits the original outline picture of the material to be detected to the image processing device 900 through a preset transmission manner.
[0022] The image processing device 900 is internally provided with a visual detection software platform, acquires the original outline picture of the material to be detected transmitted by each camera, acquires the outline picture of the material to be detected from the original outline picture of the material to be detected transmitted by each camera by calling the visual detection software platform, determines the detection result of the position and rotation angle of the outline picture of the material to be detected relative to the template picture of the camera according to the outline picture of the material to be detected and the template picture of each camera, and after the picture is taken and detected by each camera, the detection result of each template picture in each camera is merged through the relationship with the material outline to obtain the detection result and spatial information of the material to be detected. For example, the image processing device 900 can be a computer.
[0023] The image processing device 900 comprises a display device for displaying the result output. The display device can be a display.
[0024] The image processing device 900 comprises an input device for human-computer interaction. The input device can be a keyboard.
[0025] The image processing device 900 comprises a graphical input device for graphical human-computer interaction. The graphical input device can be a mouse.
[0026] In the embodiment, a plurality of camera detection result merging systems are provided, comprising a vision device and an image processing device, wherein: each camera in the vision device acquires an original outline picture of a material to be detected in a visual manner, and transmits the original outline picture to the image processing device through a preset transmission manner; the image processing device is internally provided with a visual detection software platform, acquires the original outline picture of the material to be detected transmitted by each camera, acquires an outline picture of the material to be detected from the original outline picture of the material to be detected transmitted by each camera by calling the visual detection software platform, determines a detection result of a position and a rotation angle of the outline picture of the material to be detected relative to a template picture of the camera according to the outline picture of the material to be detected and the template picture of each camera, and after each camera completes picture taking and detection, merges the detection result of each template picture in each camera through a relationship with a material outline to obtain a detection result and spatial information of the material to be detected. Thus, by merging the detection result of each template through the relationship with the material outline, the generality is improved, various lighting conditions can be compatible, the detection results of different cameras can be merged on the same material, and spatial information including the position and the rotation angle of the detected material can be given. Thus, the problem that the detection results of different cameras cannot be merged on the same material due to serious differences in lighting of different cameras and spatial information of the detected material cannot be given can be solved.
[0027] In one embodiment, as shown in Figure 2 The present application provides a plurality of camera detection result merging method, comprising: S1, acquiring an outline picture of a material to be detected; S2, determining a detection result of a position and a rotation angle of the outline picture of the material to be detected relative to a template picture of the camera according to the outline picture of the material to be detected and the template picture of each camera; S3, after each camera completes picture taking and detection, merging the detection result of each template picture in each camera through a relationship with a material outline to obtain a detection result and spatial information of the material to be detected.
[0028] In the embodiment, a merging method of multiple camera detection results is provided. The profile of the material to be detected is obtained, the position and rotation angle of the profile of the material to be detected relative to the template of each camera are determined according to the profile of the material to be detected and the template of each camera, after each camera takes a picture and detects, the detection result of each template in each camera is merged through the relationship with the profile of the material to be detected, and the detection result and spatial information of each material are obtained. Thus, by merging the detection result of each template through the relationship with the profile of the material to be detected, the versatility is improved, various lighting conditions can be compatible, the detection results of different cameras can be merged on the same material, and the spatial information including the position and rotation angle of the detected material can be given. Thus, the problem that the detection results of different cameras cannot be merged on the same material due to the serious difference in lighting of different cameras and the spatial information of the detected material cannot be given can be solved.
[0029] In one embodiment, in step S1, the profile picture of the material to be detected is obtained; specifically comprising: S11, obtaining the original profile picture of the material to be detected transmitted by each camera.
[0030] Specifically, by adjusting the parameters of each camera and its light source in the visual equipment 100, each camera can obtain the original profile picture of the material to be detected which can clearly display, and the obtained clear original profile picture of the material to be detected is transmitted to the image processing equipment 900 through a preset transmission mode.
[0031] S12, the original profile picture of the corresponding material to be detected is saved by using the screenshot tool built in the visual detection software platform, and the profile picture of the material to be detected after screenshot is obtained.
[0032] Specifically, after the image processing equipment receives the clear original profile picture of the material to be detected obtained by each camera in the visual equipment, the screenshot tool built in the visual detection software platform is called to save the original profile picture of the material to be detected transmitted by each camera one by one, and the profile picture of the material to be detected after screenshot corresponding to each camera is obtained.
[0033] S13, the profile picture of the material to be detected is extracted from the saved profile picture of the material to be detected after screenshot by using a preset analysis algorithm, wherein the profile picture of the material to be detected is represented by a polygon, and the contour point set of the polygon is set as C i ={(x1,y1),(x2,y2),...,(x i ,y i ),...,(x n ,y n )},(x i ,yi ) represents the contour points, n is an integer, i is an integer between 1 and n, that is, the contour picture of the material to be detected is represented by the contour point set C i The contour picture of the material to be detected can clearly reflect the contour of the material to be detected.
[0034] The preset analysis algorithm includes a Blob analysis algorithm. The contour picture of the material to be detected is extracted from the saved contour picture of the material to be detected after the screenshot by the Blob analysis algorithm.
[0035] Blob analysis algorithm (Blob Detection) is a computer vision and image processing technology used to detect connected regions in an image that have similar features such as color, brightness, texture, etc. These regions are often referred to as "blobs" or "connected components". Blob analysis is widely used in object detection, industrial detection, medical image analysis, motion detection, etc.
[0036] The core of the Blob analysis algorithm is to find regions of pixels in an image that have similar properties (usually similar gray levels or colors) and are spatially connected, and to label, measure and analyze these regions.
[0037] The processing steps of the Blob analysis algorithm include: 1. Image preprocessing, including grayscale, filtering and thresholding, specifically: Grayscale: Convert color images to grayscale to simplify processing; Filtering: Use Gaussian filtering, median filtering, etc. to remove noise; Thresholding: Convert the image to a binary image (foreground / background) by binarization (e.g. fixed threshold, adaptive threshold, Otsu method).
[0038] 2. Connected component labeling (Connected Component Labeling, CCL), specifically including: Find the pixel blocks in the binary image that are connected to each other (usually based on 4-connected or 8-connected rules); Assign a unique label to each connected region for subsequent analysis.
[0039] 3. Blob feature extraction, including: For each detected blob, calculate a series of geometric or statistical features, such as: Position: Centroid (center coordinates), bounding box (Bounding Box); Size: Area (number of pixels), perimeter; Shape: Circular degree, aspect ratio, rectangular degree; Gray scale / intensity information: average gray scale, maximum / minimum gray scale value, etc.
[0040] 4. Blob screening and analysis, including: Screening the blobs according to the set conditions (e.g. area range, shape, position, etc.), and eliminating noise or areas that do not meet the requirements; Further analysis or for subsequent decision-making (e.g. defect detection, target tracking, etc.).
[0041] In this embodiment, by acquiring the original contour picture of the material to be detected transmitted by each camera, the original contour picture of the material to be detected corresponding to the original contour picture is acquired and saved through the screenshot tool built in the visual detection software platform, the contour picture of the material to be detected after screenshot is obtained, and the contour picture of the material to be detected is extracted from the saved contour picture of the material to be detected after screenshot through a preset analysis algorithm, so as to facilitate subsequent detection result merging.
[0042] In one embodiment, in step S2, according to the contour picture of the material to be detected and the template picture of each camera, the detection result of the position and rotation angle of the contour picture of the material to be detected relative to the template picture of the camera is determined, specifically including: S21, establishing a mapping relationship between the template picture of the camera and the contour picture of the material to be detected.
[0043] Specifically, due to different measurement defects, different lighting and template settings will be performed for each camera. The mapping relationship between the template picture of the different camera and the saved contour picture of the material to be detected is established.
[0044] The template picture of the camera is taken as a template through multi-scale template matching, and the corresponding position is matched on the contour picture of the material to be detected, so as to obtain the first affine transformation matrix M of the template picture of the camera relative to the contour picture of the material to be detected, that is, to establish the mapping relationship between the template picture of the camera and the contour picture of the material to be detected.
[0045] S22, according to the mapping relationship between the template picture of the camera and the contour picture of the material to be detected, determining the mapping relationship between the contour picture of the material to be detected and the template picture of the camera.
[0046] Specifically, according to the first affine transformation matrix M of the template picture of the camera relative to the contour picture of the material to be detected, the second affine transformation matrix N of the contour picture of the material to be detected relative to the template picture of the camera is determined, that is, the mapping relationship between the contour picture of the material to be detected and the template picture of the camera is determined. Wherein, the second affine transformation matrix N of the contour picture of the material to be detected relative to the template picture of the camera is the inverse matrix of the first affine transformation matrix M of the template picture of the camera relative to the contour picture of the material to be detected, that is, N=M-1 .
[0047] S23. Based on the contour image of the material to be detected and the mapping relationship between the contour image of the material to be detected and the template image of the camera, determine the detection results of the position and rotation angle of the contour image of the material to be detected relative to the template image of the camera.
[0048] Specifically, based on the contour image of the material to be detected obtained in step S13 and the second affine transformation matrix N, the position and rotation angle of the contour image of the material to be detected relative to the template image of the camera are determined, including: Multiply the second affine transformation matrix N by the contour point set C of the material to be detected obtained in step S13. i Each contour point (x) i y i ), to obtain the first position C of the outline image a of the material to be detected relative to the template image b of the camera. a,b , where C a,b =N·C i .
[0049] Since the template image for the camera only undergoes translation, rotation, and stretching during alignment, the linear part N of the second affine transformation matrix N... 线性部分 =R·S, where R is the rotation matrix and S is the stretching matrix. The first rotation angle Ra of the contour image a of the material to be detected relative to the template image b of the camera can be obtained through the rotation matrix R. a,b .
[0050] In summary, the first position C of the outline image of the material to be detected relative to the template image of the camera can be obtained. a,b and the first rotation angle R a,b The test results.
[0051] In this embodiment, the position of the template image for each camera is obtained by acquiring the contour image of the corresponding material to be detected. The position C of the contour image of the material to be detected within the template image of each camera is obtained by multiplying the second affine transformation matrix N of the contour image of the material to be detected relative to the template image of each camera by the position of the template image of each camera. a,b and rotation angle R a,b The test results.
[0052] In one embodiment, in step S3, after each camera captures and detects an image, the detection results of each template image in each camera are merged with the material outline to obtain the detection results and spatial information of the material to be detected; specifically including: S31. Unify the outline images of the materials to be inspected corresponding to the template images of each camera into the same two-dimensional coordinate system, including: S311. After each camera captures and detects an image, a series of template images for each camera will be matched. Based on the center point (x) of each detected template image for each camera... i y i ) and template angle θ i Establish a third affine transformation matrix T with respect to the center point (0,0) of the template image from the original camera and the template angle of 0°. i The third affine transformation matrix T i =[[cosθ i ,-sinθ i , x],[sinθ i cosθ i , y],[0,0,1]].
[0053] S312, transform the third affine transformation matrix T i Multiply by the position C of the outline image a of the material to be detected relative to the camera template image b. a,b For each contour point, the second position C of the contour image of the material to be detected in the template image of the camera is obtained. a,b,i =T i ·C a,b .
[0054] S313, Detect each template angle θ i Add the first rotation angle R of the outline image of the material to be detected relative to the template image of the camera. a,b The second rotation angle R of the outline image of the material to be detected in the template image of the camera is obtained. a,b,i =θ i + R a,b .
[0055] S314. Let the fourth affine transformation matrix of the template image for each camera be A. d This indicates that the fourth affine transformation matrix A of the camera's template image is... d Multiply by the second position C of the outline image of the material to be detected in the camera's template image. a,b,i The outline image of the material to be detected is obtained at the third position O in a unified two-dimensional coordinate system. a,b,i =Ad·C a,b,i .
[0056] S315, The fourth affine transformation matrix A from the template image of the camera. d Extracting the camera rotation angle θ d Adding the second rotation angle R of the outline image of the material to be detected in the template image of the camera. a,b,i The outline image of the material to be detected is obtained in a unified two-dimensional coordinate system with a third rotation angle K.a,b,i =R a,b,i +θ d .
[0057] By using the coordinate relationship between template images from different cameras, the outline images of the materials to be detected corresponding to the template images from each camera can be unified into the same two-dimensional coordinate system.
[0058] S32. Based on the same two-dimensional coordinate system, the detection results of each template image in each camera are merged with the material contour to obtain the detection results and spatial information of the material to be detected.
[0059] Specifically, the contour images of the material to be detected in each camera are unified to the same third position O in the same two-dimensional coordinate system. a,b,i and the third rotation angle K a,b,i Subsequently, due to factors such as material feeding, camera shooting time, algorithms, and coordinate mapping between template images from different cameras, there may be some deviations. This can lead to discrepancies in the outline images of the same material from different cameras after being transformed to the same two-dimensional coordinate system. To eliminate this deviation, the detection results of each template image from each camera can be merged based on the material outline relationship to obtain the detection results and spatial information of the material to be detected.
[0060] The positions and rotation angles of contour images of the same material to be detected from different cameras are compared pairwise. When the intersection over union (IoU) of the positions of the contour images of the material to be detected from different cameras is greater than a first preset threshold, and the difference in the rotation angles of the contour images of the material to be detected from different cameras is less than a second preset threshold, the contour images of the material to be detected from the two cameras are merged into a single contour image of the material to be detected. The position of the merged contour image can be taken from the position of the contour image of the material to be detected from one camera, or from the intersection of the positions of the contour images of the material to be detected from both cameras. The rotation angle of the merged contour image can be taken from the rotation angle of the contour image of the material to be detected from one camera, or from the average of the rotation angles of the contour images of the material to be detected from both cameras. The detection results from different cameras can also be attributed to the same final material contour due to the merging of the contour images of the material to be detected from different cameras.
[0061] Intersection over Union (IoU), also known as the intersection-over-union ratio, is a commonly used metric in computer vision and image processing. It measures the degree of overlap between two shapes (usually contours, bounding boxes, or segmented regions) and is widely used in tasks such as object detection, instance segmentation, image matching, material recognition, and sorting.
[0062] In this embodiment, by merging the detection results of each template with the material contour, the versatility is improved, and it can be compatible with various lighting conditions. By merging the detection results of different cameras onto the same material, it can provide spatial information of the detected material, including its position and rotation angle.
[0063] Based on the same concept, in one embodiment, the present invention also provides a system 10 for merging multiple camera detection results, including an image processing device 900, such as... Figure 1 and Figure 3 As shown, the image processing device 900 includes: a memory 902, a processor 901, and one or more computer programs stored in the memory 902 and executable on the processor 901. The memory 902 and the processor 901 are coupled together via a bus system 903. When the one or more computer programs are executed by the processor 901, they implement the following steps of a method for merging multiple camera detection results provided in this embodiment of the invention: S1. Obtain the outline image of the material to be inspected; S2. Based on the outline image of the material to be detected and the template image of each camera, determine the detection results of the position and rotation angle of the outline image of the material to be detected relative to the template image of the camera. S3. After each camera captures and detects an image, the detection results of each template image in each camera are merged with the material outline to obtain the detection results and spatial information of the material to be detected.
[0064] The methods disclosed in the above embodiments of the present invention can be applied to the processor 901, or implemented by the processor 901. The processor 901 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the processor 901. The processor 901 can be a general-purpose processor, a DSP (Digital Signal Processor), an MCU (Micro Control Unit), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 901 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present invention can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium, which is located in the memory 902. The processor 901 reads the information in the memory 902 and combines its hardware to complete the steps of the aforementioned method.
[0065] It is understood that the memory 902 in this embodiment of the invention can be a volatile memory or a non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory or other memory technologies, compact disk read-only memory (CD-ROM), digital video disk (DVD) or other optical disc storage, magnetic cartridges, magnetic tapes, disk storage or other magnetic storage devices; the volatile memory can be random access memory (RAM). By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). Memory, Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable types of memories.
[0066] It should be noted that the above-mentioned system embodiment and method embodiment for merging multiple camera detection results belong to the same concept. For details of its implementation process, please refer to the method embodiment. Furthermore, the technical features in the method embodiment are also applicable to the system embodiment for merging multiple camera detection results, and will not be repeated here.
[0067] In addition, in an exemplary embodiment, the present invention also provides a computer storage medium, specifically a computer-readable storage medium, such as a memory 902 storing a computer program. The computer storage medium stores one or more programs for a method of merging multiple camera detection results. When the processor 901 executes the one or more programs for merging multiple camera detection results, it implements the following steps of the method for merging multiple camera detection results provided in the present invention: S1. Obtain the outline image of the material to be inspected; S2. Based on the outline image of the material to be detected and the template image of each camera, determine the detection results of the position and rotation angle of the outline image of the material to be detected relative to the template image of the camera. S3. After each camera captures and detects an image, the detection results of each template image in each camera are merged with the material outline to obtain the detection results and spatial information of the material to be detected.
[0068] It should be noted that the above-mentioned method embodiment for merging multiple camera detection results on a computer-readable storage medium belongs to the same concept as the method embodiment. For details of its specific implementation process, please refer to the method embodiment. Furthermore, the technical features in the method embodiment are all applicable to the above-mentioned computer-readable storage medium embodiment, and will not be repeated here.
[0069] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for merging detection results from multiple cameras, characterized in that, include: Obtain the outline image of the material to be inspected; Based on the outline image of the material to be detected and the template image of each camera, the detection results of the position and rotation angle of the outline image of the material to be detected relative to the template image of the camera are determined. After each camera captures and detects an image, the detection results of each template image from each camera are merged with the material outline to obtain the detection results and spatial information of the material to be detected.
2. The method for merging multiple camera detection results according to claim 1, characterized in that, The process of obtaining the outline image of the material to be detected includes: Acquire the original outline image of the material to be inspected transmitted by each camera; Using the screenshot tool built into the visual inspection software platform, the original outline image of the material to be inspected is captured and saved to obtain the outline image of the material to be inspected after screenshotting. The outline image of the material to be detected is extracted from the outline image of the material to be detected after the screenshot using a preset analysis algorithm.
3. The method for merging multiple camera detection results according to claim 1, characterized in that, The step of determining the position and rotation angle of the outline image of the material to be detected relative to the template image of each camera, based on the outline image of the material to be detected and the template image of each camera, includes: Establish a mapping relationship between the template image of the camera and the outline image of the material to be detected; Based on the mapping relationship between the template image of the camera and the outline image of the material to be detected, the mapping relationship between the outline image of the material to be detected and the template image of the camera is determined. Based on the contour image of the material to be detected and the mapping relationship between the contour image of the material to be detected and the template image of the camera, the detection results of the position and rotation angle of the contour image of the material to be detected relative to the template image of the camera are determined.
4. The method for merging multiple camera detection results according to claim 3, characterized in that, The process of establishing a mapping relationship between the template image of the camera and the contour image of the material to be detected includes: Using the template image of the camera as a template, the corresponding position is matched on the outline image of the material to be detected, and the first affine transformation matrix of the template image of the camera relative to the outline image of the material to be detected is obtained, that is, the mapping relationship between the template image of the camera and the outline image of the material to be detected is established.
5. The method for merging multiple camera detection results according to claim 4, characterized in that, The step of determining the mapping relationship between the outline image of the material to be detected and the template image of the camera, based on the mapping relationship between the template image of the camera and the outline image of the material to be detected, includes: Based on the first affine transformation matrix of the template image of the camera relative to the contour image of the material to be detected, the second affine transformation matrix of the contour image of the material to be detected relative to the template image of the camera is determined, that is, the mapping relationship between the contour image of the material to be detected and the template image of the camera is determined. The second affine transformation matrix of the contour image of the material to be detected relative to the template image of the camera is the inverse of the first affine transformation matrix of the template image of the camera relative to the contour image of the material to be detected.
6. The method for merging multiple camera detection results according to claim 5, characterized in that, The detection result, which determines the position and rotation angle of the outline image of the material to be detected relative to the camera template image based on the mapping relationship between the outline image of the material to be detected and the template image of the camera, includes: Based on the outline image of the material to be detected and the second affine transformation matrix N, the position and rotation angle of the outline image of the material to be detected relative to the template image of the camera are determined.
7. The method for merging multiple camera detection results according to claim 1, characterized in that, After each camera captures and detects an image, the detection results of each template image from each camera are merged with the material outline to obtain the detection results and spatial information of the material to be detected, including: Unify the outline images of the materials to be detected corresponding to the template images of each camera into the same two-dimensional coordinate system; Based on the same two-dimensional coordinate system, the detection results of each template image in each camera are merged with the material contour to obtain the detection results and spatial information of the material to be detected.
8. A system for merging detection results from multiple cameras, characterized in that, include: Vision devices and image processing devices, of which: The vision device acquires the original outline image of the material to be detected through visual means and transmits it to the image processing device through a preset transmission method. The image processing device has a built-in visual inspection software platform. It acquires the original contour image of the material to be inspected transmitted by each camera. By calling the visual inspection software platform, it obtains the contour image of the material to be inspected from the original contour image of the material to be inspected transmitted by each camera. Based on the contour image of the material to be inspected and the template image of each camera, it determines the detection results of the position and rotation angle of the contour image of the material to be inspected relative to the template image of the camera. After each camera has captured and inspected the image, the detection results of each template image in each camera are merged with the material contour to obtain the detection result and spatial information of the material to be inspected.
9. A system for merging detection results from multiple cameras, characterized in that, The image processing device includes a memory, a processor, and a computer program stored in the memory and running on the processor. When executed by the processor, the computer program implements a method for merging multiple camera detection results according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores a program for a method of merging multiple camera detection results. When the program for merging multiple camera detection results is executed by a processor, it implements the method for merging multiple camera detection results as described in any one of claims 1 to 7.