Shadow elimination method, device and related equipment for three-dimensional point cloud reconstruction
By acquiring multi-view image sets in 3D visual inspection, performing 3D reconstruction and point cloud registration, and judging and removing shadow points, the problem of shadow areas affecting the accuracy of 3D models is solved and more accurate 3D model generation is achieved.
Patent Information
- Application Number
- CN202411071118.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-06
AI Technical Summary
In the existing three-dimensional visual inspection process, the existence of shadow areas on the surface of the target object causes the generated three-dimensional model to be inaccurate. The features of the shadow area are mistaken for outer surface features, causing the model to lose the outer surface features of the non-shadow area.
By acquiring multiple multi-view image sets of the target object under different lighting angles, 3D reconstruction and point cloud registration are performed, the first shadow point and the second shadow point are determined and removed, and the point cloud is denoised to generate a more accurate 3D model. .
It improves the accuracy of the 3D model and prevents point clouds in non-shadow areas from being mistaken for shadow points, thereby retaining the outer surface features of the target object and preventing the model from losing the characteristics of the non-shadow areas.
Smart Images

Figure CN118587370B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of visual detection, and in particular relates to a shadow elimination method, device and related equipment for three-dimensional point cloud reconstruction. Background Art
[0002] The existing three-dimensional visual detection process generally involves capturing an image of the target object, collecting a point cloud of the target object from the image, and performing three-dimensional reconstruction based on the three-dimensional information to generate a three-dimensional model of the target object. The capturing and capturing process of the target object image is generally carried out under lighting conditions. However, the light source in the capturing and capturing process generally has limitations and often cannot illuminate the target object in all directions. In addition, the part of the target object facing the light source may block the light path. Therefore, there may be a shadow area on the surface of the target object, and the shadow area and the target object surface area covered by it often have different shapes, colors and other characteristics. The three-dimensional information acquisition process is based on the outer surface features of the target object in the image, and in the three-dimensional information acquisition process, the features of the shadow area will be regarded as the outer surface features of the target object. Therefore, when there is a shadow area on the surface of the target object during the three-dimensional information acquisition process, the three-dimensional model generated based on the three-dimensional information will lose the outer surface features of the target object blocked by the shadow area, resulting in an inaccurate three-dimensional model.
[0003] Therefore, the existing technology needs to be improved and developed. Summary of the invention
[0004] The purpose of this application is to provide a shadow elimination method, device and related equipment for three-dimensional point cloud reconstruction, aiming to solve the problem of inaccurate generated three-dimensional model caused by the presence of shadow areas on the surface of the target object during three-dimensional visual inspection.
[0005] In a first aspect, the present application provides a shadow elimination method for three-dimensional point cloud reconstruction, comprising the following steps:
[0006] S1. Acquire multiple multi-view image sets of the target object under different illumination angles;
[0007] S2. perform three-dimensional reconstruction of the target object in each multi-view image set, and generate multiple point cloud sets accordingly; and perform point cloud registration on all point cloud sets together, and generate multiple registration point cloud sets accordingly;
[0008] S3. Perform a first shadow judgment on each registration point cloud set to select a first shadow point in each registration point cloud set, wherein the first shadow judgment comprises the following steps:
[0009] S31. traverse the point clouds in the registration point cloud set, and select preliminary shadow points in the point clouds in the registration point cloud set according to the RGB values of each point cloud, wherein each point cloud in each registration point cloud set includes its coordinate information and RGB value;
[0010] S32. judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets;
[0011] S4. Remove all first shadow points.
[0012] The shadow elimination method for three-dimensional point cloud reconstruction of the present application removes all first shadow points and can perform denoising preprocessing on the point cloud before generating a three-dimensional model based on the point cloud. Therefore, the present application can make the three-dimensional model generated based on the denoised point cloud only have the outer surface features of the target object, and not have the features of the shadow area on the target object surface, thereby making the generated three-dimensional model more accurate, and preventing the point cloud corresponding to the non-shadow area on the target object surface from being mistaken for the first shadow point, thereby preventing the generated three-dimensional model from losing the outer surface features of the non-shadow area on the target object.
[0013] Furthermore, in step S31, the process of selecting preliminary shadow points in the point cloud of the registration point cloud set according to the RGB value of each point cloud includes:
[0014] S311. Select preliminary shadow points from the point clouds of the registration point cloud set according to the magnitude relationship between the modulus represented by the vector of the RGB value of each point cloud and the first preset value.
[0015] In this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application determines the size relationship between the modulus of the vector representation of the RGB value of each point cloud and the first preset value, and can determine whether the point cloud of the registered point cloud set is a preliminary shadow point.
[0016] Further, in step S32, the process of judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets includes:
[0017] S322. Determine the relationship between the modulus of the vector representing the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets and the first preset value, and determine that the corresponding preliminary shadow point is the first shadow point when more than half of the moduli are greater than or equal to the first preset value.
[0018] Further, in step S32, in the process of judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets, when there is a registered point cloud set in which the distances between all point clouds and the preliminary shadow point exceed a preset threshold, the registered point cloud set is not used as the basis for judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets.
[0019] Furthermore, the shadow elimination method for three-dimensional point cloud reconstruction also includes:
[0020] S5. merging all the registered point cloud sets to generate a merged point cloud set;
[0021] S6. Traverse the point clouds in the merged point cloud set, perform a second shadow judgment on each point cloud to select a second shadow point in the merged point cloud set, the second shadow judgment comprising the following steps:
[0022] S61. Generate a three-dimensional neighborhood with the point cloud as the center, and determine whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point according to the RGB values of each point cloud in the three-dimensional neighborhood;
[0023] S7. Remove all second shadow points.
[0024] In this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application can remove all second shadow points, thereby further improving the accuracy of the three-dimensional model.
[0025] Furthermore, the process of judging whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point according to the RGB values of each point cloud in the three-dimensional neighborhood includes:
[0026] S611. Determine whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point based on the difference between the RGB value of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the remaining point clouds in the three-dimensional neighborhood.
[0027] Furthermore, the difference size is calculated based on a difference calculation function, which is as follows:
[0028] ;
[0029] in is the sequence number of the point cloud in the 3D neighborhood, is the number of point clouds in the 3D neighborhood, is the vector representation of the RGB value of the point cloud at the center of the three-dimensional neighborhood, For the The vector representation of the RGB values of the point cloud, for The model, for The model, is the difference calculation function;
[0030] In step S611, the process of judging whether the point cloud at the center of the three-dimensional neighborhood is a second shadow point according to the difference between the RGB value of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the remaining point clouds in the three-dimensional neighborhood includes:
[0031] S6111. When When it is greater than or equal to the second preset value, the point cloud at the center of the three-dimensional neighborhood is determined as the second shadow point. When it is less than the second preset value, it is determined that the point cloud at the center of the three-dimensional neighborhood is not the second shadow point.
[0032] In this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application performs a second shadow judgment based on a difference calculation function, and can perform a second shadow judgment based on the difference between the RGB value of the target point cloud and the RGB value of each remaining point cloud in the three-dimensional neighborhood.
[0033] In a second aspect, the present application provides a shadow removal device for three-dimensional point cloud reconstruction, comprising:
[0034] An acquisition module is used to acquire multiple multi-view image sets of a target object at different illumination angles;
[0035] The reconstruction and registration module is used to perform three-dimensional reconstruction of the target object in each multi-view image set, and generate multiple point cloud sets accordingly; and perform point cloud registration on all point cloud sets together, and generate multiple registration point cloud sets accordingly;
[0036] The first judgment module is used to perform a first shadow judgment on each registration point cloud set to select a first shadow point in each registration point cloud set. The first shadow judgment includes the following steps:
[0037] Traversing the point clouds in the registration point cloud set, and selecting preliminary shadow points in the point clouds in the registration point cloud set according to the RGB values of each point cloud, wherein each point cloud includes its coordinate information and RGB value;
[0038] According to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets, determine whether the corresponding preliminary shadow point is the first shadow point;
[0039] The first removal module is used to remove all first shadow points.
[0040] The shadow elimination device for three-dimensional point cloud reconstruction of the present application removes all first shadow points and can perform denoising preprocessing on the point cloud before generating a three-dimensional model based on the point cloud. Therefore, the present application can make the three-dimensional model generated based on the denoised point cloud only have the outer surface features of the target object, and not have the features of the shadow area on the target object surface, thereby making the generated three-dimensional model more accurate, and can prevent the point cloud corresponding to the non-shadow area on the target object surface from being mistaken for the first shadow point, thereby preventing the generated three-dimensional model from losing the outer surface features of the non-shadow area on the target object.
[0041] In a third aspect, the present application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, it runs the steps in any of the above methods.
[0042] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any of the above methods are performed.
[0043] From the above, it can be seen that the present application provides a shadow elimination method, device and related equipment for three-dimensional point cloud reconstruction, wherein the shadow elimination method for three-dimensional point cloud reconstruction provided by the present application removes all first shadow points, and can perform denoising preprocessing on the point cloud before generating a three-dimensional model based on the point cloud. Therefore, the present application can make the three-dimensional model generated based on the denoised point cloud only have the outer surface features of the target object, and not have the features of the shadow area on the target object surface, thereby making the generated three-dimensional model more accurate, and can prevent the point cloud corresponding to the non-shadow area on the target object surface from being mistaken for the first shadow point, thereby preventing the generated three-dimensional model from losing the outer surface features of the non-shadow area on the target object.
[0044] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A flowchart of a shadow elimination method for three-dimensional point cloud reconstruction provided in an embodiment of the present application.
[0046] Figure 2 A schematic diagram of the structure of a shadow removal device for three-dimensional point cloud reconstruction provided in an embodiment of the present application.
[0047] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0048] Explanation of reference numerals: 1. Acquisition module; 2. Reconstruction and registration module; 3. First judgment module; 4. First removal module; 5. Merging module; 6. Second judgment module; 7. Second removal module; 301. Processor; 302. Memory; 303. Communication bus. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0050] 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, further definition and explanation thereof is not required in subsequent drawings.
[0051] First, as Figure 1 As shown, the present application provides a shadow elimination method for three-dimensional point cloud reconstruction, comprising the following steps:
[0052] S1. Acquire multiple multi-view image sets of the target object under different illumination angles;
[0053] S2. perform three-dimensional reconstruction of the target object in each multi-view image set, and generate multiple point cloud sets accordingly; and perform point cloud registration on all point cloud sets together, and generate multiple registration point cloud sets accordingly;
[0054] S3. Perform a first shadow judgment on each registration point cloud set to select a first shadow point in each registration point cloud set, wherein the first shadow judgment comprises the following steps:
[0055] S31. traverse the point clouds in the registration point cloud set, and select preliminary shadow points in the point clouds in the registration point cloud set according to the RGB values of each point cloud, wherein each point cloud in each registration point cloud set includes its coordinate information and RGB value;
[0056] S32. judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets;
[0057] S4. Remove all first shadow points.
[0058] Specifically, the illumination angle is the angle at which the light source illuminates the target object, and the multi-view image set is a collection of images obtained by photographing the target object from multiple shooting angles. The method for obtaining multiple multi-view image sets of the target object at different illumination angles may be to obtain multiple multi-angle image sets of the target object under illumination from light sources at different positions, or to obtain multiple multi-angle image sets of the target object in different postures under illumination from the same light source, or other methods that can achieve the acquisition of multiple multi-view image sets of the target object at different illumination angles.
[0059] More specifically, the 3D reconstruction process is a process of collecting 3D data of the target object based on the outer surface features of the target object in each multi-view image set. This process can be based on the PnP algorithm, the SfM algorithm or other algorithms that can generate a point cloud set. The point cloud is the point generated based on the 3D reconstruction process that can characterize the outer surface features of the target object, and the point cloud set is a collection of point clouds. The point cloud registration process is a process of concentrating all point cloud sets into the same coordinate system. This process can be based on the ICP algorithm or other algorithms that can achieve point cloud registration.
[0060] More specifically, the RGB value of the point cloud in the point cloud set generated based on the three-dimensional reconstruction process can characterize the color characteristics of the area on the surface of the target object corresponding to the point cloud, and then the RGB value of the point cloud in the registered point cloud set generated based on the point cloud registration process can also characterize the color characteristics of the area on the outer surface of the target object corresponding to the point cloud; in the multi-view image set, the brightness of the shadow area on the surface of the target object is lower than that of the non-shadow area, so in the registered point cloud set, there is a difference between the RGB value of the point cloud corresponding to the non-shadow area on the surface of the target object and the RGB value of the point cloud corresponding to the shadow area, and the point cloud in the registered point cloud set is judged based on the difference, and the preliminary shadow point can be selected from the point cloud in the registered point cloud set. Among them, the preliminary shadow point is a point cloud suspected to correspond to the shadow area on the surface of the target object. After the preliminary shadow point is selected, the preliminary shadow point is further analyzed to confirm whether the preliminary shadow point corresponds to the shadow area on the surface of the target object, thereby judging whether the preliminary shadow point is the first shadow point.
[0061] More specifically, there may be areas on the surface of the target object with low color brightness. Even under sufficient lighting conditions, the brightness of such areas is low. To prevent such areas from being mistaken for the first shadow point, after selecting the preliminary shadow point in the registration point cloud set, the present application determines whether the corresponding preliminary shadow point is the first shadow point based on the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registration point cloud sets. This can determine whether the area on the target object surface corresponding to the preliminary shadow point also has low brightness at other lighting angles, and can prevent the point cloud corresponding to the non-shadow area on the target object surface from being mistaken for the first shadow point, thereby preventing the generated three-dimensional model from losing the outer surface features of the non-shadow area on the target object.
[0062] More specifically, the present application removes all first shadow points and can perform denoising preprocessing on the point cloud before generating a three-dimensional model based on the point cloud. Therefore, the present application can make the three-dimensional model generated based on the denoised point cloud only have the outer surface features of the target object, and not have the features of the shadow area on the surface of the target object, thereby making the generated three-dimensional model more accurate.
[0063] The shadow elimination method for three-dimensional point cloud reconstruction of the present application removes all first shadow points and can perform denoising preprocessing on the point cloud before generating a three-dimensional model based on the point cloud. Therefore, the present application can make the three-dimensional model generated based on the denoised point cloud only have the outer surface features of the target object, and not have the features of the shadow area on the target object surface, thereby making the generated three-dimensional model more accurate, and preventing the point cloud corresponding to the non-shadow area on the target object surface from being mistaken for the first shadow point, thereby preventing the generated three-dimensional model from losing the outer surface features of the non-shadow area on the target object.
[0064] In some preferred embodiments, in step S31, the process of selecting preliminary shadow points in the point clouds of the registration point cloud set according to the RGB values of each point cloud includes:
[0065] S311. Select preliminary shadow points from the point clouds of the registration point cloud set according to the magnitude relationship between the modulus represented by the vector of the RGB value of each point cloud and the first preset value.
[0066] Specifically, the first preset value can be set as needed.
[0067] More specifically, in the registered point cloud set, the sum of the three numbers of the RGB values of the point cloud corresponding to the shadow area of the target object surface is smaller than that of the point cloud corresponding to the non-shadow area of the target object surface, so the modulus of the RGB value vector representation of the point cloud corresponding to the shadow area of the target object surface is smaller than that of the point cloud corresponding to the non-shadow area of the target object surface. Therefore, in this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application determines the magnitude relationship between the modulus of the vector representation of the RGB value of each point cloud and the first preset value, and can determine whether the point cloud of the registered point cloud set is a preliminary shadow point.
[0068] Preferably, the process of selecting preliminary shadow points in the point cloud of the registration point cloud set according to the magnitude relationship between the modulus represented by the vector of the RGB value of each point cloud and the first preset value is performed based on a shadow judgment function, and the expression of the shadow judgment function is:
[0069] (1)
[0070] in is the vector representation of the point cloud RGB value, for The model, is the shadow judgment function, is a first preset value;
[0071] The process of selecting preliminary shadow points in the point cloud of the registration point cloud set according to the magnitude relationship between the modulus represented by the vector of the RGB value of each point cloud and the first preset value includes:
[0072] exist When it is 0, the point cloud is determined to be a preliminary shadow point; When it is 1, it is determined that the point cloud is not a preliminary shadow point.
[0073] In some preferred embodiments, in step S32, the process of judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets includes:
[0074] S322. Determine the relationship between the modulus of the vector representing the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets and the first preset value, and determine that the corresponding preliminary shadow point is the first shadow point when more than half of the moduli are greater than or equal to the first preset value.
[0075] Specifically, when more than half of the modules are greater than or equal to the first preset value, it can be known that when the area on the target object surface corresponding to the preliminary shadow point is under other lighting angles, the brightness is high in more than half of the scenes, and the area on the target object surface corresponding to the preliminary shadow point can be determined as a shadow area. Therefore, in this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application can determine whether the area on the target object surface corresponding to the preliminary shadow point is indeed a shadow area, so that the preliminary shadow point can be accurately selected from the registered point cloud set.
[0076] Preferably, the process of determining the magnitude relationship between the modulus of the vector representation of the point cloud RGB value closest to the preliminary shadow point in each of the remaining registered point cloud sets and the first preset value is performed based on the shadow determination function.
[0077] In some preferred embodiments, in step S32, in the process of judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets, when there is a registered point cloud set in which the distances between all point clouds and the preliminary shadow point exceed a preset threshold, the registered point cloud set is not used as the basis for judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets.
[0078] Specifically, due to the limitations of the point cloud reconstruction process, the point clouds in a single point cloud set and a single registered point cloud set may not cover all areas of the target object. Therefore, after a point cloud in the registered point cloud set is determined as a preliminary shadow point, there may be a registered point cloud set in the remaining registered point cloud sets, and the point cloud in the registered point cloud set that is closest to the preliminary shadow point is also far away from the preliminary shadow point. In this case, the point cloud does not correspond to the area corresponding to the preliminary shadow point on the target object, and cannot characterize the outer surface features of the area corresponding to the preliminary shadow point on the target object. Therefore, in this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application can not use the registered point cloud set with a long distance from the preliminary shadow point as the judgment basis of the first shadow point judgment process, and can prevent irrelevant point clouds from being used as the judgment basis of the first shadow point, resulting in misjudgment, so that the first shadow point can be selected more accurately.
[0079] In some preferred embodiments, the shadow elimination method for three-dimensional point cloud reconstruction further includes:
[0080] S5. merging all the registered point cloud sets to generate a merged point cloud set;
[0081] S6. Traverse the point clouds in the merged point cloud set, perform a second shadow judgment on each point cloud to select a second shadow point in the merged point cloud set, the second shadow judgment comprising the following steps:
[0082] S61. Generate a three-dimensional neighborhood corresponding to the point cloud as the center, and determine whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point according to the RGB values of each point cloud in the three-dimensional neighborhood;
[0083] S7. Remove all second shadow points.
[0084] Specifically, in this embodiment, "brighter brightness" and "darker brightness" refer to the relative brightness between shadow areas being brighter or darker. The first shadow point corresponds to the shadow area with darker brightness on the surface of the target object, which has been removed in step S4. However, since the light source has a certain volume, an object with the same illumination angle and the same shooting angle may have multiple shadows with different brightnesses. Therefore, there may still be some point clouds corresponding to the shadow area with brighter brightness on the surface of the target object in the registration point cloud set. Therefore, it is necessary to select and remove this part of the point cloud.
[0085] More specifically, the three-dimensional neighborhood is the local three-dimensional space where the point cloud adjacent to the point cloud as the judgment object is located. Since the darker shadow area on the surface of the target object is connected to the non-shadow area on the surface of the target object through the brighter shadow area on the surface of the target object, there are multiple point clouds corresponding to areas of different brightness on the surface of the target object in the three-dimensional neighborhood centered on the point cloud, and there are significant differences in the RGB values of these point clouds. Based on the difference, the point cloud in the merged point cloud set is judged to select the second shadow point in the merged point cloud set. Among them, the basis for judging the point cloud in the merged point cloud set can be the difference between the RGB value of the central point cloud of the three-dimensional neighborhood and the RGB values of other point clouds in the three-dimensional neighborhood, or the difference in RGB values between other point clouds in the three-dimensional neighborhood.
[0086] In this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application can remove all second shadow points, thereby further improving the accuracy of the three-dimensional model.
[0087] In some preferred implementations, in step S61, the process of judging whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point according to the RGB values of each point cloud in the three-dimensional neighborhood includes:
[0088] S611. Determine whether the point cloud at the center of the three-dimensional neighborhood is a second shadow point based on the difference between the RGB value of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the remaining point clouds in the three-dimensional neighborhood.
[0089] Specifically, there may be a situation where a larger non-shadow area surrounds a smaller shadow area on the surface of the target object. Therefore, the RGB value of the second shadow point may be very different from the RGB values of its neighboring point clouds, but the RGB values of its neighboring point clouds may be different little. Therefore, in this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application determines whether the point cloud at the center of each three-dimensional neighborhood is a second shadow point based on the difference between the RGB value of the point cloud at the center of each three-dimensional neighborhood and the RGB values of the remaining point clouds, and can perform second shadow judgment more accurately.
[0090] In some preferred embodiments, the difference size is calculated based on a difference calculation function, and the difference calculation function is as follows:
[0091] (2)
[0092] in is the sequence number of the point cloud in the 3D neighborhood, is the number of point clouds in the 3D neighborhood, is the vector representation of the RGB value of the point cloud at the center of the three-dimensional neighborhood, For the The vector representation of the RGB values of the point cloud, for The model, for The model, is the difference calculation function;
[0093] In step S611, the process of judging whether the point cloud at the center of the three-dimensional neighborhood is a second shadow point according to the difference between the RGB value of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the remaining point clouds in the three-dimensional neighborhood includes:
[0094] S6111. When When it is greater than or equal to the second preset value, the point cloud at the center of the three-dimensional neighborhood is determined as the second shadow point. When it is less than the second preset value, it is determined that the point cloud at the center of the three-dimensional neighborhood is not the second shadow point.
[0095] Specifically, express and The angle between the three-dimensional neighborhood center and the RGB value of the point cloud in the three-dimensional neighborhood. The difference in RGB values of the point clouds is accumulated based on the integral to obtain the overall difference between the RGB value of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the other point clouds. .
[0096] In this embodiment, the shadow elimination method for three-dimensional point cloud reconstruction of the present application performs a second shadow judgment based on a difference calculation function, and can perform a second shadow judgment based on the difference between the RGB value of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the remaining point clouds.
[0097] Second, as Figure 2 As shown, the present application provides a shadow removal device for three-dimensional point cloud reconstruction, comprising:
[0098] An acquisition module 1 is used to acquire a plurality of multi-view image sets of a target object at different illumination angles;
[0099] The reconstruction and registration module 2 is used to perform three-dimensional reconstruction of the target object in each multi-view image set, and generate multiple point cloud sets accordingly; and perform point cloud registration on all point cloud sets together, and generate multiple registration point cloud sets accordingly;
[0100] The first judgment module 3 is used to perform a first shadow judgment on each registration point cloud set to select a first shadow point in each registration point cloud set. The first shadow judgment includes the following steps:
[0101] Traversing the point clouds in the registration point cloud set, and selecting preliminary shadow points in the point clouds in the registration point cloud set according to the RGB values of each point cloud, wherein each point cloud includes its coordinate information and RGB value;
[0102] According to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets, determine whether the corresponding preliminary shadow point is the first shadow point;
[0103] The first removal module 4 is used to remove all first shadow points.
[0104] The shadow elimination device for three-dimensional point cloud reconstruction provided by the present application removes all first shadow points and can perform denoising preprocessing on the point cloud before generating a three-dimensional model based on the point cloud. Therefore, the present application can make the three-dimensional model generated based on the denoised point cloud only have the outer surface features of the target object, and not have the features of the shadow area on the target object surface, thereby making the generated three-dimensional model more accurate, and can prevent the point cloud corresponding to the non-shadow area on the target object surface from being mistaken for the first shadow point, thereby preventing the generated three-dimensional model from losing the outer surface features of the non-shadow area on the target object.
[0105] Preferably, the shadow removal device for three-dimensional point cloud reconstruction further includes:
[0106] A merging module 5 is used to merge all the registered point cloud sets to generate a merged point cloud set;
[0107] The second judgment module 6 is used to traverse the point clouds in the merged point cloud set, and perform a second shadow judgment on each point cloud to select a second shadow point in the merged point cloud set. The second shadow judgment includes the following steps:
[0108] Generate a 3D neighborhood with the point cloud as the center, and determine whether the point cloud at the center of the 3D neighborhood is the second shadow point according to the RGB values of each point cloud in the 3D neighborhood;
[0109] The second removing module 7 is used to remove all second shadow points.
[0110] Thirdly, Figure 3As shown, the present application provides an electronic device, including a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not shown). The memory 302 stores a computer program executable by the processor 301. When the electronic device is running, the processor 301 executes the computer program to execute the method in any optional implementation of the above embodiment to achieve the following functions: acquiring multiple multi-view image sets of a target object at different illumination angles; performing three-dimensional reconstruction of the target object in each multi-view image set; Generate multiple point cloud sets accordingly; and perform point cloud registration on all point cloud sets together, and generate multiple registered point cloud sets accordingly; perform a first shadow judgment on each registered point cloud set to select the first shadow point in each registered point cloud set, and the first shadow judgment includes the following steps: traverse the point clouds in the registered point cloud set, and select preliminary shadow points in the point clouds of the registered point cloud set according to the RGB values of each point cloud, wherein each point cloud includes its coordinate information and RGB value; judge whether the corresponding preliminary shadow point is the first shadow point according to the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets; and remove all first shadow points.
[0111] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method in any optional implementation method of the above-mentioned embodiment is executed to achieve the following functions: obtaining multiple multi-view image sets of the target object at different lighting angles; performing three-dimensional reconstruction of the target object in each multi-view image set, and correspondingly generating multiple point cloud sets; and performing point cloud registration on all point cloud sets together, and correspondingly generating multiple registration point cloud sets; performing a first shadow judgment on each registration point cloud set to select a first shadow point in each registration point cloud set, and the first shadow judgment includes the following steps: traversing the point clouds in the registration point cloud set, and selecting preliminary shadow points in the point clouds of the registration point cloud set according to the RGB values of each point cloud, wherein each point cloud includes its coordinate information and RGB values; judging whether the corresponding preliminary shadow point is the first shadow point according to the RGB values of the point clouds closest to the preliminary shadow points in each of the remaining registration point cloud sets; and removing all first shadow points. Among them, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0112] In summary, the present application provides a shadow elimination method, device and related equipment for three-dimensional point cloud reconstruction, wherein the shadow elimination method for three-dimensional point cloud reconstruction provided by the present application removes all first shadow points, and can perform denoising preprocessing on the point cloud before generating a three-dimensional model based on the point cloud. Therefore, the present application can make the three-dimensional model generated based on the denoised point cloud only have the outer surface features of the target object, and not have the features of the shadow area on the target object surface, thereby making the generated three-dimensional model more accurate, and can prevent the point cloud corresponding to the non-shadow area on the target object surface from being mistaken for the first shadow point, thereby preventing the generated three-dimensional model from losing the outer surface features of the non-shadow area on the target object.
[0113] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0114] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0115] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0116] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0117] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A shadow elimination method for 3D point cloud reconstruction, characterized in that: The following steps are involved: S1. Acquire multiple multi-view image sets of the target object under different illumination angles; S2. Perform three-dimensional reconstruction of the target object in each multi-view image set to generate multiple point cloud sets; and perform point cloud registration on all point cloud sets to generate multiple registered point cloud sets; S3. Perform a first shadow judgment on each registration point cloud set to select a first shadow point in each registration point cloud set, wherein the first shadow judgment comprises the following steps: S31. Traversing the point clouds in the registered point cloud set, and selecting preliminary shadow points in the point clouds in the registered point cloud set based on the RGB values of each point cloud, wherein each point cloud in each registered point cloud set includes its coordinate information and RGB value, and the process of selecting preliminary shadow points in the point clouds in the registered point cloud set based on the RGB values of each point cloud includes: S311. Selecting preliminary shadow points from the point cloud of the registration point cloud set based on the magnitude relationship between the modulus of the vector representation of the RGB value of each point cloud and the first preset value; S32. Determine whether the corresponding preliminary shadow point is the first shadow point based on the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets. The process of determining whether the corresponding preliminary shadow point is the first shadow point based on the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets comprises: S322. Determine the relationship between the modulus of the vector representing the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets and a first preset value, and determine that the corresponding preliminary shadow point is the first shadow point when more than half of the moduli are greater than or equal to the first preset value; S4. Remove all first shadow points.
2. The shadow elimination method for 3D point cloud reconstruction according to claim 1, characterized in that: In step S32, in the process of judging whether the corresponding preliminary shadow point is the first shadow point based on the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets, when there is a registered point cloud set in which the distances between all point clouds and the preliminary shadow point exceed a preset threshold, the registered point cloud set is not used as the basis for judging whether the corresponding preliminary shadow point is the first shadow point based on the RGB value of the point cloud closest to the preliminary shadow point in each of the remaining registered point cloud sets.
3. The shadow elimination method for 3D point cloud reconstruction according to claim 1, characterized in that: The shadow elimination method for three-dimensional point cloud reconstruction also includes: S5. Merge all registered point cloud sets to generate a merged point cloud set; S6. Traverse the point clouds in the merged point cloud set, and perform a second shadow judgment on each point cloud to select a second shadow point in the merged point cloud set, wherein the second shadow judgment comprises the following steps: S61. Generate a three-dimensional neighborhood with the point cloud as the center, and determine whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point based on the RGB values of each point cloud in the three-dimensional neighborhood; S7. Remove all second shadow points.
4. The shadow elimination method for 3D point cloud reconstruction according to claim 3, characterized in that: In step S61, the process of determining whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point according to the RGB values of each point cloud in the three-dimensional neighborhood includes: S611. Determine whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point based on the difference between the RGB values of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the remaining point clouds in the three-dimensional neighborhood.
5. The shadow elimination method for 3D point cloud reconstruction according to claim 4, characterized in that: The difference size is calculated based on a difference calculation function, which is as follows: Where m is the sequence number of the point cloud in the three-dimensional neighborhood, g is the number of point clouds in the three-dimensional neighborhood, is the vector representation of the RGB value of the point cloud at the center of the three-dimensional neighborhood, is the vector representation of the RGB value of the m-th point cloud, for The model, for The model, is the difference calculation function; In step S611, the process of determining whether the point cloud at the center of the three-dimensional neighborhood is the second shadow point based on the difference between the RGB value of the point cloud at the center of the three-dimensional neighborhood and the RGB values of the remaining point clouds in the three-dimensional neighborhood includes: S6111. When When it is greater than or equal to the second preset value, the point cloud of the 3D neighborhood center is determined as the second shadow point. When it is less than a second preset value, it is determined that the point cloud of the three-dimensional neighborhood center is not the second shadow point.
6. An electronic device, characterized in that: The invention comprises a processor (301) and a memory (302), wherein the memory (302) stores a computer program executable by the processor (301), and when the processor (301) executes the computer program, the steps in the method according to any one of claims 1 to 5 are executed.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor (301), the computer program executes the steps of the method according to any one of claims 1 to 5.
