Detection system and method, computer device, and computer readable storage medium
Patent Information
- Application Number
- NZ807236
- Authority / Receiving Office
- NZ · NZ
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-07-30
- Filing Date
- 2022-05-07
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-05-07
AI Technical Summary
When existing optical inspection technology detects surface defects on fruits and vegetables, due to the inability to align the spliced images, all images on the surface of fruits and vegetables cannot be fully displayed, and the defect locations cannot be accurately located and identified, which affects the sorting accuracy.
A laser is used to divide the area of interest on the surface of the object being measured, and images are collected from different angles through a camera group. Computing equipment is used to analyze the proportion of the area of interest in each image for image splicing to obtain a complete surface image of the object being measured.
It achieves precise positioning and identification of surface defects on fruits and vegetables, improves sorting accuracy, and ensures the eating safety of fruits and vegetables.
Smart Images

Figure 1_ABST
Abstract
Description
Detection system, method, computer device and computer readable storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application with application number 202110870046.9 filed with the State Intellectual Property Office of China on July 30, 2021, entitled “Detection system, method, computer device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of detection technology, and in particular to a detection system, method, computer device, and computer-readable storage medium. Background Art
[0004] Fruits and vegetables are easily damaged by collision, squeezing, vibration, etc. during the process of picking, grading, packaging and transportation. This not only reduces the appearance quality of the fruits and vegetables themselves, but also makes them susceptible to fungal or bacterial invasion, leading to fruit and vegetable rot (such as late blight, dry rot, soft rot, etc.), affecting their food safety.
[0005] At present, relevant technologies use optical detection technology to inspect the surface of fruits and vegetables. Optical detection technology usually uses multiple cameras to image the fruit, and then manually calibrates and splices the obtained images to obtain pictures of the fruit surface. This method causes the spliced images to be misaligned, resulting in the inability to fully display the entire image of the fruit surface, and thus unable to accurately locate and identify the position of defects on the fruit surface, which brings trouble to the subsequent fruit sorting work and leads to a decrease in sorting accuracy.
[0006] Summary of the Invention
[0007] In view of this, the present application provides a detection system, method, computer device and computer-readable storage medium for obtaining a complete surface image of the object under test, providing a basis for subsequent accurate positioning and identification of surface defect positions.
[0008] The technical solution of this application can be implemented as follows:
[0009] Some embodiments of the present application provide a detection system, comprising a laser, a camera group, and a computer device; the camera group is installed in an area above the object to be measured; the laser is installed directly above the object to be measured, with the emission port of the laser facing the object to be measured; the laser is configured to project a laser plane, which intersects with the surface of the object to be measured to form a laser line, and the laser line divides the surface into multiple different regions of interest; the camera group is used to capture images of the object to be measured from different shooting angles; wherein each of the images contains part or all of each of the regions of interest; the computer device is configured to cut and splice all the images according to the regions of interest contained in each of the images to obtain a target image of the surface.
[0010] In an embodiment of the present application, a laser is used to calibrate the surface of the object to be measured, and the surface is divided into regions of interest. Then, a camera group is used to capture images from different angles. Since the laser line divides the surface into non-overlapping regions, the proportion of the regions of interest in each image can be analyzed by a computing device to perform image stitching, thereby obtaining a complete surface image of the object to be measured, thereby ensuring that the position of surface defects can be accurately located and identified subsequently.
[0011] Optionally, the computer device can be specifically configured to: cut the image to be processed according to the position of the laser line in the image to be processed to obtain multiple cut images, where the image to be processed is any one of all the images; use the cut image with the largest proportion of the area of interest among the multiple cut images as the image to be spliced corresponding to the image to be processed; traverse all the images to obtain the image to be spliced corresponding to each image; and expand and splice each image to be spliced according to a preset reference coordinate system to obtain the target image.
[0012] In the embodiment of the present application, a complete surface image of the object to be measured can be obtained, which can improve the accuracy of locating and identifying the position of surface defects.
[0013] Optionally, the camera group may include at least one camera. When there are multiple cameras, the multiple cameras may be installed side by side.
[0014] In the embodiment of the present application, by installing multiple cameras side by side, the coordinate system alignment problem caused by different camera orientations can be avoided, and the difficulty of subsequent image processing can be reduced.
[0015] Optionally, the camera group may be a group, and the camera group may be moved to different shooting positions to capture images at different shooting angles.
[0016] In an embodiment of the present application, by moving a group of cameras to different shooting positions to shoot surface images, more reference information about the surface image of the object being measured can be provided, thereby improving the accuracy of subsequent image stitching.
[0017] Optionally, the camera groups can be three groups, namely the first camera group, the second camera group and the third camera group; the first camera group can be located directly above the object to be measured, and the field of view direction of the first camera group can be parallel to the laser; the angles between the normal of the second camera group and the normal of the third camera group and the normal of the first camera group can be the same.
[0018] In an embodiment of the present application, by using multiple camera groups to capture surface images, more reference information can be provided for obtaining a complete surface image of the object being measured, thereby improving the accuracy of subsequent image stitching.
[0019] Optionally, the angle may range from 30 degrees to 50 degrees.
[0020] Optionally, the angle may be 40 degrees.
[0021] In the embodiment of the present application, by controlling the above-mentioned angle within a reasonable range, the problem of excessive overlap or missing of the shooting areas of multiple camera groups due to the angle being too small or too large can be avoided, thereby improving the accuracy of subsequent image stitching.
[0022] Optionally, there may be at least one laser. When the number of the lasers is two, the two lasers are distributed on both sides of the first camera group.
[0023] In the embodiment of the present application, multiple lasers can be used to divide the surface area of the object to be measured more finely, thereby improving the accuracy of subsequent image stitching.
[0024] Optionally, the width of the laser line may be less than 2 mm.
[0025] In the embodiment of the present application, by controlling the laser line width within a reasonable range, it is possible to avoid the laser line covering small defects on the surface of the target object, resulting in the inability to accurately obtain all defects on the surface of the target object.
[0026] Optionally, the detection system may further include a rotating device; the rotating device may be configured to drive the detected object to rotate.
[0027] Optionally, the rotating device can be composed of a cup, a bracket and a cup wheel, the cup can hold the object to be measured, the bracket can support the cup, the cup wheel can be located in the middle of the bracket, and the cup wheel can rotate around the cup axis, thereby driving the object to be measured to rotate.
[0028] In the embodiment of the present application, each surface of the object under test can be detected in real time, providing more surface information for accurate positioning and identification of surface defects.
[0029] Optionally, the detection system may further include a conveyor belt, which may be in contact with the cup wheel of the rotating device. The conveyor belt may be driven by a motor to circulate, and the friction between the conveyor belt and the cup wheel may drive the cup wheel to rotate, thereby driving the object to be measured to rotate.
[0030] In the embodiments of the present application, it is possible to facilitate real-time detection of various surfaces of the object being measured, and provide more surface information for accurate positioning and identification of surface defects.
[0031] Optionally, the object to be measured may be a circular or elliptical object.
[0032] In the embodiment of the present application, the surface curve of the circular or elliptical object is smooth, and the laser line formed on the surface is a smooth curve, which can evenly divide the surface and reduce the difficulty of subsequent image processing.
[0033] Other embodiments of the present application provide a detection method, which may include: acquiring images of the object to be measured captured by a camera group at different shooting angles, wherein each of the images contains part or all of each region of interest; wherein the region of interest is cut by a laser line formed by the intersection of a laser plane projected by a laser located in an area directly above the object to be measured and the surface of the object to be measured; and cutting and splicing all the images according to the region of interest present in each of the images to obtain a target image of the surface.
[0034] In an embodiment of the present application, a laser is used to calibrate the surface of the object to be measured, and the surface is divided into regions of interest. Then, a camera group is used to capture images from different angles. Since the laser line divides the surface into non-overlapping regions, the images can be stitched together based on the proportion of the regions of interest in each image to obtain a complete surface image of the object to be measured, thereby ensuring that the position of surface defects can be accurately located and identified later.
[0035] Optionally, according to the region of interest existing in each of the images, all the images are cut and spliced to obtain the target image of the surface, which may include: cutting the image to be processed according to the position of the laser line in the image to be processed to obtain multiple cut images, and the image to be processed is any one of all the images; taking the cut image with the largest proportion of the region of interest among the multiple cut images as the image to be spliced corresponding to the image to be processed; traversing all the images to obtain the image to be spliced corresponding to each image; and according to a preset reference coordinate system, expanding each image to be spliced and splicing it to obtain the target image.
[0036] In the embodiment of the present application, a complete surface image of the object to be measured can be obtained, which can improve the accuracy of locating and identifying the position of surface defects.
[0037] Some further embodiments of the present application provide a computer device, which may include a processor and a memory, wherein the memory may store a computer program that can be executed by the processor, and the processor may execute the computer program to implement the detection method described in the embodiments of the present application.
[0038] Some further embodiments of the present application provide a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the detection method as described in the embodiments of the present application is implemented.
[0039] The detection system, method, computer device and computer readable storage medium provided by the present application may include a laser, a camera group and a computer device, wherein the camera group is installed in the upper area of the object to be measured; the laser is installed directly above the object to be measured, and the emission port of the laser is directly facing the object to be measured; the laser is configured to project a laser plane, the laser plane intersects with the surface of the object to be measured to form a laser line, and the laser line divides the surface into multiple different regions of interest; the camera group is configured to capture images of the object to be measured from different shooting angles; each image contains part or all of each region of interest; the computer device is configured to cut and splice all images according to the regions of interest contained in each image to obtain a target image of the surface. The difference from the related art is that the related optical detection technology manually calibrates and splices the obtained images, and the obtained surface images are not aligned, and there are missing or overlapping areas, which results in the inability to fully display the entire image of the fruit surface, and the position of the defect on the fruit surface cannot be accurately located and identified, which brings trouble to the subsequent fruit sorting work and leads to a decrease in sorting accuracy. The present application uses a laser to calibrate the surface of the object to be measured, divides the surface into regions of interest through laser lines, and then uses a camera group to capture images from different angles. Since the laser lines divide the surface into non-overlapping areas, the proportion of the regions of interest in each image can be analyzed by a computing device to perform image stitching, thereby obtaining a complete surface image of the object to be measured, ensuring that the position of surface defects can be accurately located and identified later. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0041] FIG1 is a schematic diagram of a related fruit optical detection technology;
[0042] FIG2 is an architecture diagram of a detection system provided in an embodiment of the present application;
[0043] FIG3 is a schematic diagram of a laser plane projected by a laser;
[0044] FIG4 is a schematic diagram of a laser line provided in an embodiment of the present application;
[0045] FIG5 is a schematic diagram of a region of interest provided in an embodiment of the present application;
[0046] FIG6 is a schematic diagram of an embodiment of the present application using a camera group to photograph an object under test;
[0047] FIG7 is a schematic diagram of an implementation method of three camera groups provided in an embodiment of the present application;
[0048] FIG8 is a three-view diagram of a detection system with a laser provided in an embodiment of the present application;
[0049] 9A to 9C are schematic diagrams of shooting angles of three camera groups provided in an embodiment of the present application;
[0050] FIG10 is a schematic diagram of another region of interest provided in an embodiment of the present application;
[0051] FIG11 is a three-view diagram of a detection system including two lasers provided in an embodiment of the present application;
[0052] FIG12 is a schematic diagram of a reference coordinate system provided in an embodiment of the present application;
[0053] FIG13 is a three-view diagram of another detection system provided in an embodiment of the present application;
[0054] FIG14 is a schematic flow chart of a detection method provided in an embodiment of the present application;
[0055] FIG15 is a block diagram of a computer device structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0057] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.
[0058] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0059] In the description of this application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the invented product is usually placed when in use. It is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on this application.
[0060] In addition, the terms "first", "second", etc., if used, are merely used to distinguish and describe, and should not be understood as indicating or implying relative importance.
[0061] It should be noted that, in the absence of conflict, the features in the embodiments of this application can be combined with each other.
[0062] At present, in order to accurately locate and identify the position of defects on the surface of fruits, relevant technologies use optical detection technology to detect the surface of fruits and vegetables. Optical detection technology usually uses multiple cameras to image the fruit, and then manually calibrates and splices the obtained images to obtain the fruit surface picture. The specific implementation method is shown in Figure 1, which is a schematic diagram of a related fruit optical detection technology.
[0063] Related fruit optical inspection technologies use multiple cameras to capture images of the fruit surface. For example, in some possible embodiments, a camera is set directly above the object to be measured, and then a camera is set on both sides of the camera to image the fruit at the same time. The captured images can be shown as (a) and (b) in Figure 1, and then manually integrated to obtain the fruit surface image shown in (c) in Figure 1.
[0064] As shown in Figure 1 (a), the image processing personnel first manually determined the calibration line (the black straight line in the figure) in Figure 1 (a) and (b). Then, they cut the image according to the calibration line (the black straight line in the figure) in (a), and retained the image area above the black line. In Figure 1 (b), the image processing personnel cut (b) according to the black line in Figure 1, and retained the image area below the black line. Then, the retained partial images of (a) and (b) were spliced together to obtain the image shown in Figure 1 (c). It can be seen that the spliced images are misaligned, with missing or overlapping areas. As a result, the entire image of the fruit surface cannot be fully displayed. The location of the fruit surface defects cannot be accurately located and identified, which brings difficulties to the subsequent fruit sorting work and leads to a decrease in sorting accuracy.
[0065] In order to solve the above technical problems, an embodiment of the present application provides a detection system. See Figure 2, which is a schematic flow chart of a detection system provided by an embodiment of the present application. The detection system 10 may include: a laser 11, a camera group 12 and a computer device 13.
[0066] The camera group 12 can be installed in the area above the object to be measured 14 ; the laser 11 can be installed directly above the object to be measured 14 , and the emission port of the laser 11 can face the object to be measured 14 .
[0067] The laser 11 may be configured to project a laser plane, which may intersect with the surface of the object 14 to form a laser line, and the laser line may divide the surface into a plurality of different regions of interest.
[0068] In an embodiment of the present application, the above-mentioned region of interest may refer to the non-overlapping areas on both sides of the laser line on the surface of the object to be measured. In the image taken by the camera group, the region of interest may be the visible area of the object to be measured in the image.
[0069] The camera group 12 may be configured to capture images of the object 14 from different shooting angles; wherein each image may include part or all of each region of interest.
[0070] The computer device 13 may be configured to cut and splice all images according to the region of interest contained in each image to obtain a target image of the surface.
[0071] The difference from the related technology is that the related optical detection technology manually calibrates and splices the obtained images, and the surface images obtained are not aligned, and there are missing or overlapping areas, which makes it impossible to fully display the entire image of the fruit surface or to display it repeatedly. The position of the fruit surface defects cannot be accurately located and identified, which brings trouble to the subsequent fruit sorting work and causes a decrease in sorting accuracy. However, this application calibrates the surface of the object to be measured by a laser, divides the surface into areas of interest by laser lines, and then uses a camera group to capture images from different angles. Since the laser lines divide the surface into non-overlapping areas, the proportion of the area of interest in each image can be analyzed by a computing device to perform image stitching, thereby obtaining a complete surface image of the object to be measured, ensuring that the position of the surface defects can be accurately located and identified later.
[0072] Optionally, the laser 11 may be, but is not limited to, a linear laser generator. The laser 11 may emit fan-shaped laser light in one direction, as shown in FIG3 , which is a schematic diagram of a laser plane projected by a laser.
[0073] In an embodiment of the present application, the emission port of the laser 11 is facing the object to be measured 14. Therefore, the laser plane projected by the laser 11 can form a laser line when intersecting with the surface of the object to be measured 14. The laser line can divide the surface of the object to be measured 14 into multiple different areas of interest. For ease of understanding, please refer to Figure 4, which is a schematic diagram of a laser line provided in an embodiment of the present application. The position of the laser line is shown in Figure 4.
[0074] In a preferred embodiment, the width of the laser line may be less than 2 mm.
[0075] It is understandable that the laser line is emitted in a divergent manner, and the width of the laser line is too large. When it is irradiated on the surface of the target object, the laser line occupies too large an area of the target object surface. There is a possibility that the laser line covers small defects on the surface of the target object, resulting in the inability to accurately obtain all defects on the surface of the target object. It is foreseeable that the width of the laser line has a greater impact on small fruits. The smaller the fruit, the smaller the laser line width should be.
[0076] It can be understood that the above-mentioned area of interest is the area on both sides of the laser line. For the sake of convenience, a schematic diagram of the area of interest is given below by taking the shooting angle of a camera group directly above the object to be measured 14 as an example. Figure 5 is a schematic diagram of an area of interest provided in an embodiment of the present application.
[0077] It can be seen that the camera group 12 and the laser 11 are both located directly above the object to be measured, and the laser line divides the object to be measured into two regions of interest, namely region A and region B. Obviously, the image captured by the camera group located directly above the object to be measured 14 contains all of region A and region B. If the camera group forms a certain angle with the normal direction of the object to be measured, then the image taken by the camera group may contain part of region A and region B.
[0078] It can also be understood that when there is one laser 11, the surface of the object to be measured 14 can be divided into two regions of interest. If there are at least two lasers, the surface of the object to be measured 14 can be divided into multiple regions of interest, that is, the number of regions of interest is the number of lasers plus 1. It can be foreseen that the more lasers there are, the finer the surface of the object to be measured is divided, thereby improving the accuracy of subsequent image stitching.
[0079] Optionally, the above-mentioned camera group 12 may include but is not limited to one camera. In some scenarios, when there are multiple cameras in the camera group 12, the multiple cameras are installed side by side. The multiple cameras can simultaneously capture the same surface image of the object under test, providing more image resources for determining the image surface image, thereby facilitating the subsequent precise positioning and identification of the surface defect position.
[0080] In some possible implementations, the camera group 12 may be a group, and the camera group 12 may be moved to different shooting positions, thereby achieving the effect of capturing images at different shooting angles.
[0081] It should be noted that when there is a camera group performing image acquisition, the object 14 to be measured is in a stationary state, so that the camera group acquires the same surface image of the object 14 to be measured from different angles.
[0082] For example, see FIG6 , which is a schematic diagram of an embodiment of the present application using a camera group to shoot the object to be measured. As shown in FIG6 , assuming that the initial position (1) of the camera group 12 is directly above the object to be measured 14, after the camera group 12 has captured the image directly above, the camera group 12 can be controlled to move in the clockwise direction by a preset angle θ (e.g., 40 degrees, or any angle in the range of 30 to 50 degrees) to reach position (2), and after the image is captured at this shooting angle, the camera group 12 is controlled to move in the counterclockwise direction by the preset angle θ back to position (1), and then continue to move in the counterclockwise direction by the preset angle θ to reach position (3), and capture the image at this shooting position. After the shooting at position (3) is completed, the camera group 12 is controlled to move in the clockwise direction by the preset angle θ to return to the initial position (1), thereby completing the surface image capture of the object to be measured 14.
[0083] It should be noted that the initial installation position of the camera group 12 can be implemented in the following ways, which are not limited here.
[0084] Continuing to refer to FIG6 , in the process of using a camera group 12 to acquire images, in the first scenario, the initial position of the camera group 12 can be position (1) in FIG6 , and the process of changing the shooting position is as described above; in the second scenario, the initial position of the camera group 12 can also be position (2) as shown in FIG6 , then the shooting process is: after shooting an image at position (2), the camera group is controlled to move in a counterclockwise direction by a preset angle θ to reach position (1), and after shooting at position (1), the camera group 12 is controlled to move in a counterclockwise direction by a preset angle θ to reach position (3) for shooting; in the third scenario, the initial position of the camera group 12 can also be position (3) as shown in FIG6 , then the shooting process is: after shooting an image at position (3), the camera group is controlled to move in a clockwise direction by a preset angle θ to reach position (1), and after shooting at position (1), the camera group 12 is controlled to move in a clockwise direction by a preset angle θ to reach position (2) for shooting.
[0085] In another preferred embodiment, the camera group 12 may also be three groups, namely a first camera group 121 , a second camera group 122 and a third camera group 123 , and the installation positions of the three camera groups are fixed.
[0086] It should be noted that when three camera groups are used for image acquisition, the object 14 to be measured can be in a stationary state, and the three camera groups can start shooting at the same time to ensure that the three camera groups capture the same surface image of the object to be measured at the same time.
[0087] For example, a schematic diagram of the installation positions of the three camera groups can be seen in FIG7 , which is a schematic diagram of the implementation method of the three camera groups provided in an embodiment of the present application.
[0088] As shown in FIG7 , the first camera group 121 can be located directly above the object 14, and the field of view of the first camera group can be parallel to the laser. The normals of the second camera group 122 and the third camera group 123 can have the same angle with the normal of the first camera group 121, wherein the normals can be perpendicular to the camera group shooting plane.
[0089] In some possible embodiments, if the angle is too small or too large, the shooting areas of the second camera group 122 and the third camera group 123 may overlap too much with the shooting area of the first camera group 121, or may be missing. Therefore, the angle ranges from 30 degrees to 50 degrees. In a preferred embodiment, the angle is preferably 40 degrees.
[0090] For example, when there are three camera groups, the view of the entire detection system can be as shown in FIG8 , see FIG8 , FIG8 is a three-view diagram of a detection system with one laser provided in an embodiment of the present application, including (1) a front view, (2) a right view, and (3) a top view. In conjunction with the three views shown in FIG8 , a schematic diagram of the shooting angle of each camera group is also given below in comparison with FIG8 , see FIG9A to FIG9C , FIG9A to FIG9C are schematic diagrams of the shooting angles of the three camera groups provided in an embodiment of the present application. In FIG9A to FIG9C , there is one laser 11, and the laser line divides the object to be measured 14 into two regions of interest, namely, region A and region B.
[0091] First, taking the shooting angle of the first camera group 121 in Figure 9A as an example, it can be seen that the shooting range of the first camera group 121 can include all of area A and all of area B, that is, the image of the first camera group 121 includes all of area A and area B.
[0092] Optionally, at the shooting angle of the second camera group 122 in FIG9B , the shooting range of the second camera group 122 may include a partial area A and a partial area B, wherein the portion included in area A may be smaller than the portion included in area B. That is, the image of the second camera group 122 may include a partial area of area A and a partial area of area B, and the partial area of area A may be smaller than the partial area of area B.
[0093] Optionally, at the shooting angle of the third camera group 123 as shown in Figure 9C, the shooting range of the third camera group 123 may also include partial area A and partial area B, wherein the portion included in area A may be larger than the portion included in area B, that is, the image of the third camera group 123 may include partial area of area A and partial area of area B, and the partial area of area A may be larger than the partial area of area B.
[0094] For ease of understanding, an example is given below. Assume that the image of the first camera group 121 contains all of area A and area B, which can be expressed as: containing 100% of area A and 100% of area B, the image of the second camera group 122 contains 30% of area A and 70% of area B, and the image of the third camera group 123 contains 70% of area A and 30% of area B. Then, in the process of determining the target image, the ideal reference area is 70% of area B in the image of the second camera group 122 and 70% of area A in the image of the third camera group 123.
[0095] It should be noted that, in order to ensure that as much surface information of the target object as possible is included in the field of view of the three camera groups, the target surface information captured by the three camera groups can overlap. To locate the overlapping area and ensure the uniqueness of the image information of the first camera group 121, the second camera group 122, and the third camera group 123, a laser 11 can be installed near the position of the first camera group 121.
[0096] It should be noted that the embodiment of the present application can achieve the effect of obtaining a complete surface image by collecting images of the object to be measured from different shots through three camera groups. It can be foreseen that the technical effect achieved by using 4 or more camera groups should be the same as the technical effect achieved by 3 camera groups.
[0097] In some possible embodiments, there may be at least one laser 11 . When there are two lasers 11 , the two lasers 11 may be distributed on both sides of the first camera group 121 , and both lasers 11 may be parallel to the first camera group 121 .
[0098] Exemplarily, when there are two lasers, a schematic diagram of a region of interest is given below, taking the shooting angle of a camera group directly above the object to be measured 14 as an example. FIG10 is a schematic diagram of another region of interest provided in an embodiment of the present application.
[0099] As shown in Figure 10, two laser lines can be formed on the surface of the object 14 to divide the object into three regions of interest, namely region A, region B and region C. Obviously, the image captured by the camera group 12 contains all of region A, region B and region C. If the camera group 12 forms a certain angle with the normal direction of the object 14, then the image taken by the camera group 12 may contain part of region A, part of region B and part of region B.
[0100] Based on Figure 8, a three-view diagram of a detection system including two lasers is also given below. Please refer to Figure 11. Figure 11 is a three-view diagram of a detection system including two lasers provided in an embodiment of the present application, including (1) a main view, (2) a right view and (3) a top view.
[0101] For example, in combination with Figures 10 and 11, it can be seen that, first, taking the shooting angle of the first camera group 121 as an example, it can be seen that the shooting range of the first camera group 121 can include all of area A, all of area B, and all of area C. At the shooting angle of the second camera group 122, the shooting range of the second camera group 122 can include part of area A, part of area B, and part of area B. At the shooting angle of the third camera group 123, the shooting range of the third camera group 123 can also include part of area A and part of area B. In a possible example, the first camera group The image of the first camera group 121 may include 100% of area A, 100% of area B, and 100% of area C. The image of the second camera group 122 may include 10% of area A, 30% of area B, and 60% of area C. The image of the third camera group 123 may include 60% of area A, 30% of area B, and 60% of area C. Therefore, in the process of determining the target image, the most ideal reference area is 100% of area B included in the image of the first camera group, 60% of area C in the image of the second camera group 122, and 60% of area A in the image of the third camera group 123.
[0102] Alternatively, to ultimately obtain a complete surface image, the following implementation method is provided. Specifically, the computer device 13 shown in FIG. 1 can be configured to: segment the image to be processed based on the position of the laser line in the image to be processed, thereby obtaining multiple segmented images, where the image to be processed is any one of the images. The segmented image with the largest area of interest among the multiple segmented images can be used as the image to be stitched corresponding to the image to be processed.
[0103] For example, continuing with the above example, the image of the second camera group 122 contains 30% of area A and 70% of area B, and the image of the third camera group 123 contains 70% of area A and 30% of area B. Then, in the image to be processed taken by the second camera group, the image area containing 70% of area B will be used as the image to be stitched, and in the image to be processed taken by the third camera group, the image area containing 70% of area A will be used as the image to be stitched.
[0104] Then, all images can be traversed to obtain the image to be stitched corresponding to each image. According to the preset reference coordinate system, each image to be stitched is expanded and stitched together to obtain the target image.
[0105] In some possible embodiments, the preset reference coordinate system may be a reference coordinate system diagram as shown in FIG12 , and the image processing program may unfold the stitched image by referring to the longitude and latitude lines of the globe according to the laser line calibration position.
[0106] It should be noted that in scenarios where one laser is present, only the images captured by the second camera group 122 and the third camera group 123 can be stitched together, and the images captured by the first camera group 121 do not participate in the image stitching process. In scenarios where two lasers are present, the images captured by the first camera group 121, the second camera group 122, and the third camera group 123 all need to participate in the image stitching process. From the images captured by the first camera group 121 and the second camera group 122, the cut image with the largest proportion of the region of interest is selected for stitching. The first camera group 121 selects the cut image containing the middle region of interest for the image stitching process.
[0107] Optionally, in order to ensure that all surface information of the object to be measured can be obtained, the detection system in each of the above embodiments may also include a rotating device, which is configured to drive the object to be measured to rotate, so that the camera group can capture images of each surface in real time, thereby improving the accuracy of subsequent positioning and identification of surface defect positions, and bringing higher precision to subsequent sorting work.
[0108] In a possible embodiment, the above-mentioned rotating device can be composed of a cup, a bracket and a cup wheel. The cup can hold the object to be measured, the bracket can support the cup, the cup wheel can be located in the middle of the bracket, and the cup wheel can rotate around the cup axis, thereby driving the object to be measured to rotate, so as to ensure 360° detection of the object to be measured without blind spots.
[0109] In some possible embodiments, in order to promote the rotation of the rotating device, the above-mentioned detection system may further include a conveyor belt, please refer to Figure 13, which is a three-view diagram of another detection system provided in an embodiment of the present application. The object to be measured in the figure is placed in the cup of the above-mentioned rotating device (the rotating device is omitted in Figure 13), and the conveying direction of the conveyor belt can be consistent with the rotation direction of the cup wheel. The cup wheel of the rotating device can contact the conveyor belt, and the conveyor belt can circulate under the drive of the motor. The friction between the conveyor belt and the cup wheel drives the cup wheel to rotate, thereby driving the object to rotate.
[0110] Optionally, the detected object in each of the above embodiments may be, but is not limited to, a circular or elliptical object. For example, the detected object may be, but is not limited to, fruits and vegetables.
[0111] In the embodiment of the present application, the surface curve of the circular or elliptical object is smooth, and the laser line formed on the surface is a smooth curve, which can evenly divide the surface and reduce the difficulty of subsequent image processing.
[0112] Based on the same inventive concept, an embodiment of the present application further provides a detection method, which can be applied to the computer device shown in FIG1 . Please refer to FIG14 , which is a schematic flow chart of a detection method provided in an embodiment of the present application. The method may include:
[0113] S31, acquiring images of the object under test captured by the camera group at different shooting angles, wherein each image includes part or all of each region of interest;
[0114] The region of interest is cut by a laser line formed by the intersection of a laser plane projected by a laser located in an area directly above the object to be measured and the surface of the object to be measured.
[0115] S32, cutting and splicing all images according to the region of interest in each image to obtain a target image of the surface.
[0116] Optionally, in a possible implementation manner, the above step S32 may include the following sub-steps:
[0117] Sub-step 321 , cutting the image to be processed according to the position of the laser line in the image to be processed to obtain multiple cut images, where the image to be processed is any one of all the images;
[0118] Sub-step 322 , using the cut image with the largest proportion of the region of interest among the multiple cut images as the image to be stitched corresponding to the image to be processed;
[0119] Sub-step 323, traversing all images to obtain the image to be stitched corresponding to each image;
[0120] Sub-step 324 , according to a preset reference coordinate system, each image to be stitched is expanded and stitched together to obtain a target image.
[0121] In order to execute the steps of the detection method in the above embodiment, an implementation of a detection device is provided below. It should be noted that the basic principle and technical effects of the detection device provided in this embodiment are the same as those in the above embodiment. For the sake of simplicity, any parts not mentioned in this embodiment can be referred to the corresponding contents in the above embodiment. The detection device may include:
[0122] The acquisition module can be configured to acquire images of the object to be measured captured by the camera group at different shooting angles, wherein each image contains part or all of each region of interest; wherein the region of interest is cut by a laser line formed by the intersection of a laser plane projected by a laser located in an area directly above the object to be measured and the surface of the object to be measured.
[0123] The processing module can be configured to cut and splice all images according to the region of interest in each image to obtain a target image of the surface.
[0124] Optionally, the processing module can be specifically configured to: cut the image to be processed according to the position of the laser line in the image to be processed to obtain multiple cut images, where the image to be processed is any one of all the images; use the cut image with the largest proportion of the area of interest among the multiple cut images as the image to be spliced corresponding to the image to be processed; traverse all the images to obtain the image to be spliced corresponding to each image; and expand and splice each image to be spliced according to a preset reference coordinate system to obtain a target image.
[0125] The embodiment of the present application also provides a computer device, as shown in Figure 15, which is a block diagram of the structure of a computer device provided in the embodiment of the present application. The computer device 13 may include a communication interface 131, a processor 132 and a memory 133. The processor 132, the memory 133 and the communication interface 131 can be electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 133 can be used to store software programs and modules, such as the program instructions / modules corresponding to the detection method provided in the embodiment of the present application. The processor 132 can execute various functional applications and data processing by executing the software programs and modules stored in the memory 133. The communication interface 131 can be used to communicate signaling or data with other node devices. In the present application, the computer device 130 can have multiple communication interfaces 131.
[0126] Among them, the memory 133 can be, but is not limited to, random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0127] The processor 132 may be an integrated circuit chip with signal processing capabilities. The processor may be a general-purpose processor, including a central processing unit (CPU) or a network processor (NP); or a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0128] Optionally, the above modules can be stored in the memory shown in FIG15 in the form of software or firmware or fixed in the operating system (OS) of the computer device, and can be executed by the processor in FIG15. At the same time, the data, program code, etc. required to execute the above modules can be stored in the memory.
[0129] The present invention provides a computer-readable storage medium that can store a computer program. When executed by a processor, the computer program can implement any of the detection methods described in the aforementioned embodiments. The computer-readable storage medium can be, but is not limited to, a USB flash drive, a mobile hard drive, ROM, RAM, PROM, EPROM, EEPROM, a magnetic disk, or an optical disk, among other media capable of storing program code.
[0130] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims. Industrial Applicability
[0131] The present application discloses a detection system, method, computer equipment and computer-readable storage medium. The detection system includes a laser, a camera group and a computer equipment. The camera group is installed in the upper area of the object to be measured; the laser is installed directly above the object to be measured, and the emission port of the laser is facing the object to be measured; the laser is configured to project a laser plane, and the laser plane intersects with the surface of the object to be measured to form a laser line, and the laser line divides the surface into multiple different areas of interest; the camera group is configured to capture images of the object to be measured from different shooting angles; each image contains part or all of each area of interest; the computer equipment is configured to cut and splice all images according to the areas of interest contained in each image to obtain a target image of the surface. The present application can obtain a complete surface image after splicing, ensuring that the position of surface defects can be accurately located and identified later.
[0132] Furthermore, it is understood that the detection system, method, computer device, and computer-readable storage medium of the present application are reproducible and can be applied in a variety of industrial applications. For example, the detection system of the present application can be applied in the field of detection.
Claims
1. A detection system, characterized in that: including lasers, camera sets, and computer equipment; The camera group is installed in the upper area of the object to be measured; the laser is installed directly above the object to be measured, and the emission port of the laser is facing the object to be measured; The laser is configured to project a laser plane, wherein the laser plane intersects with the surface of the object to be measured to form a laser line, and the laser line divides the surface into a plurality of different regions of interest; The camera group is configured to capture images of the object from different shooting angles; wherein each image contains part or all of each region of interest; The computer device is configured to cut and splice all the images according to the region of interest contained in each of the images to obtain a target image of the surface.
2. The detection system according to claim 1, characterized in that The computer device is specifically configured to: cutting the image to be processed according to the position of the laser line in the image to be processed to obtain a plurality of cut images, wherein the image to be processed is any one of all the images; The cut image with the largest proportion of the region of interest among the multiple cut images is used as the image to be spliced corresponding to the image to be processed; Traversing all the images to obtain the image to be stitched corresponding to each image; According to a preset reference coordinate system, each of the images to be stitched is expanded and then stitched together to obtain the target image.
3. The detection system according to claim 1 or 2, characterized in that: The camera group includes at least one camera. When there are multiple cameras, the multiple cameras are installed side by side.
4. The detection system according to any one of claims 1 to 3, characterized in that: The camera group is a group, and the camera group moves to different shooting positions to capture images at different shooting angles.
5. The detection system according to any one of claims 1 to 3, characterized in that: There are three camera groups, namely a first camera group, a second camera group and a third camera group; The first camera group is located directly above the object to be measured, and the field of view of the first camera group is parallel to the laser; The normal line of the second camera group, the normal line of the third camera group, and the normal line of the first camera group have the same angle.
6. The detection system according to claim 5, characterized in that: The angle ranges from 30 degrees to 50 degrees.
7. The detection system according to claim 5, characterized in that The angle is 40 degrees.
8. The detection system according to any one of claims 5 to 7, characterized in that: There is at least one laser. When there are two lasers, the two lasers are distributed on both sides of the first camera group.
9. The detection system according to any one of claims 1 to 8, characterized in that: The width of the laser line is less than 2 mm.
10. The detection system according to any one of claims 1 to 9, characterized in that: It also includes a rotating device; the rotating device is configured to drive the object to be measured to rotate.
11. The detection system according to claim 10, characterized in that: The rotating device consists of a cup, a bracket and a cup wheel. The cup holds the object to be measured, the bracket supports the cup, and the cup wheel is located in the middle of the bracket. The cup wheel rotates around the cup axis, thereby driving the object to be measured to rotate.
12. The detection system according to claim 11, characterized in that: It also includes a conveyor belt, which is in contact with the cup wheel of the rotating device. The conveyor belt is driven by a motor to circulate, and the friction between the conveyor belt and the cup wheel drives the cup wheel to rotate, thereby driving the object to be measured to rotate.
13. The detection system according to any one of claims 1 to 12, characterized in that: The measured object is a circular or elliptical object.
14. A detection method, characterized in that: The detection method comprises: Acquire images of the object under test captured by the camera group at different shooting angles, wherein each image contains part or all of each region of interest; The region of interest is cut by a laser line formed by the intersection of a laser plane projected by a laser located in an area directly above the object being measured and the surface of the object being measured; According to the region of interest in each of the images, all the images are cut and spliced to obtain a target image of the surface.
15. The detection method according to claim 14, characterized in that: According to the region of interest in each of the images, all the images are cut and spliced to obtain a target image of the surface, including: cutting the image to be processed according to the position of the laser line in the image to be processed to obtain a plurality of cut images, wherein the image to be processed is any one of all the images; The cut image with the largest proportion of the region of interest among the multiple cut images is used as the image to be spliced corresponding to the image to be processed; Traversing all the images to obtain the image to be stitched corresponding to each image; According to a preset reference coordinate system, each of the images to be stitched is expanded and then stitched together to obtain the target image.
16. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor executes the computer program to implement the detection method according to claim 14 or 15.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the detection method according to claim 14 or 15 is implemented.