WO2024093282A1 - Image processing method, related device, and structured light system - Google Patents

Image processing method, related device, and structured light system Download PDF

Info

Publication number
WO2024093282A1
WO2024093282A1 PCT/CN2023/103013 CN2023103013W WO2024093282A1 WO 2024093282 A1 WO2024093282 A1 WO 2024093282A1 CN 2023103013 W CN2023103013 W CN 2023103013W WO 2024093282 A1 WO2024093282 A1 WO 2024093282A1
Authority
WO
WIPO (PCT)
Prior art keywords
image groups
image
point
viewing angles
coding pattern
Prior art date
Application number
PCT/CN2023/103013
Other languages
French (fr)
Chinese (zh)
Inventor
宋钊
曹军
刘利刚
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024093282A1 publication Critical patent/WO2024093282A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration

Definitions

  • the present application relates to the field of image processing, and in particular to an image processing method, related equipment and a structured light system.
  • Structured light technology is a 3D reconstruction technology based on triangulation.
  • a typical structured light system consists of a camera and a projector. During the scanning process, the projector first projects a pattern with specific coded information onto the surface of the target scene. The industrial camera then obtains the reflected coded information, and then decodes to establish the correspondence between the projector and camera pixels. Finally, the depth information of the target scene is obtained based on the principle of triangulation.
  • the embodiments of the present application provide an image processing method, related equipment and a structured light system for acquiring material maps.
  • the first aspect of the embodiment of the present application provides an image processing method that can be applied to a structured light system.
  • the method can be performed by an image processing device, or by a component of the image processing device (such as a processor, a chip, or a chip system, etc.).
  • the method includes: obtaining at least three image groups, at least three image groups are reflection images of the object surface for a material coding pattern at at least three viewing angles; the at least three image groups correspond one-to-one to the at least three viewing angles; obtaining the initial depth of the object surface corresponding to any one of the at least three image groups; generating parameter information of the object based on the at least three image groups and the initial depth, the parameter information including material mapping parameters and/or geometric structure parameters.
  • At least three image groups are obtained by reflecting the material coding pattern from the object surface at least three viewing angles, and parameter information is generated based on the initial depth of the at least three image groups and the object surface, and the parameter information includes material mapping parameters and/or geometric structure parameters, thereby achieving the acquisition of material mapping parameters.
  • the method is applied to a structured light system, the structured light system comprising a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device being used to rotate multiple times so that the object is located at at least three viewing angles; acquiring at least three image groups, comprising: triggering the projection device to project a material coding pattern onto the object at each of the at least three viewing angles; triggering the camera to collect an image group reflected by the object for the material coding pattern at each viewing angle, so as to acquire at least three image groups.
  • the initial depth is obtained by the projection device projecting the structured light coding pattern onto the object.
  • this embodiment changes the encoding strategy of structured light, and can obtain multi-view RGB images required for material modeling without additional light sources and cameras.
  • the material coding pattern includes a full black pattern and a full white pattern.
  • Each of the at least three image groups includes two reflection images.
  • the multi-view RGB images required for material modeling can be obtained without adding additional light sources and cameras.
  • the above-mentioned step: generating parameter information of the object based on at least three images and the initial depth includes: obtaining occlusion information of the spatial point cloud of the object surface in the target image group corresponding to the spatial point cloud in the two image groups, any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group in the at least three image groups; eliminating pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix; obtaining the image matrix of each point on the surface of the object based on the pose calibration information and the initialization depth.
  • the observation matrix under at least three viewing angles includes: the incident light direction, the reflected light direction, the pixel observation values under at least three viewing angles of the light source intensity;
  • the posture calibration information includes: the intrinsic parameters of the projection device and the camera, the extrinsic parameters between the projection device and the camera, the projection device is used to project the material coding pattern, and the camera is used to collect at least three image groups; the parameter information is determined based on the visualization matrix and the observation matrix.
  • the observation matrix and the visualization matrix can be obtained through the posture calibration information and the relative position relationships, and then the parameter information of the object can be obtained according to the observation matrix and the visualization matrix.
  • the above steps: determining parameter information based on the visualization matrix and the observation matrix include: constructing an energy function based on the visualization matrix and the observation matrix, the energy function being used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value being related to the visualization matrix, and the observed value being related to the observation matrix; minimizing the value of the energy function to obtain parameter information.
  • the material mapping parameters and/or geometric structure parameters can be optimized in the process of minimizing the energy function.
  • the parameter information includes: material mapping parameters and/or geometric structure parameters, the geometric structure parameters include optimized depth or initialized depth; the energy function is shown in Formula 1:
  • the material mapping parameters include is the diffuse reflection variable; is the specular reflection variable; is the roughness; z * is the geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles, and the calculation method of the estimated value is shown in Formula 2, where Ii is the observation value of any point at any viewing angle obtained by the camera (it can also be understood as the pixel difference between the reflection image corresponding to the all-black pattern and the reflection image corresponding to the all-white pattern at any viewing angle); i is the number of different viewing angles; E is the regularization term;
  • E i is the light source intensity of any point at any viewing angle
  • d is the distance between any point and the projector
  • f() is the reflection characteristic function
  • the reflection characteristic function is shown in Formula 3
  • n is the surface normal vector of any point
  • l i is the incident light direction of any point at any viewing angle
  • vi is the reflected light direction of any point at any viewing angle
  • the second aspect of the embodiment of the present application provides an image processing method, which can be applied to a structured light system, the structured light system comprising: a camera, a projection device, a rotating device and an object.
  • the method can be performed by an image processing device, or by a component of the image processing device (such as a processor, a chip, or a chip system, etc.).
  • the method comprises: triggering/controlling a projection device to project a material coding pattern onto an object; triggering/controlling a camera to collect a reflection image of the object at different viewing angles for the material coding pattern, the reflection image being used to generate a material map of the object; triggering/controlling a rotating device to rotate the object to achieve that the object is located at different viewing angles.
  • this embodiment compared with the existing material measurement scheme based on structured light, which requires additional light sources and RGB cameras to obtain multi-view RGB images, this embodiment changes the encoding strategy of structured light, and can obtain multi-view RGB images required for material modeling without additional light sources and cameras.
  • the method further includes: generating material mapping parameters of the object based on reflection images at different viewing angles.
  • the material coding pattern includes a full black pattern and a full white pattern.
  • the number of the reflected images at each of the different viewing angles is two.
  • the multi-view RGB images required for material modeling can be obtained without adding additional light sources and cameras.
  • the third aspect of the embodiment of the present application provides an image processing device that can be applied to a structured light system.
  • the image processing device includes: an acquisition unit for acquiring at least three image groups, the at least three image groups being reflection images of the object surface for the material coding pattern at at least three viewing angles; the acquisition unit is also used to acquire the initial depth of the object surface corresponding to any one of the at least three image groups; a generation unit is used to generate parameter information of the object based on the at least three image groups and the initial depth, the parameter information including material mapping parameters and/or geometric structure parameters. number.
  • the above-mentioned image processing device is applied to a structured light system
  • the structured light system includes a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device is used to rotate multiple times so that the object is located at at least three viewing angles; an acquisition unit is specifically used to trigger the projection device to project a material coding pattern to the object at each of the at least three viewing angles; the acquisition unit is specifically used to trigger the camera to collect an image group reflected by the object for the material coding pattern at each viewing angle, so as to obtain at least three image groups.
  • the at least three image groups correspond to the at least three viewing angles one by one; the initial depth is obtained by the projection device projecting the structured light coding pattern to the object.
  • the material coding pattern includes a full black pattern and a full white pattern.
  • the number of the reflected images at each of the different viewing angles is two.
  • the above-mentioned generation unit is specifically used to obtain occlusion information of the spatial point cloud on the surface of the object in the target image group corresponding to the spatial point cloud in the two image groups, any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group in at least three image groups;
  • the generation unit is specifically used to eliminate the pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix;
  • the generation unit is specifically used to obtain the observation matrix of each point on the surface of the object under at least three viewing angles based on the pose calibration information and the initialization depth, the observation matrix including: pixel observation values under at least three viewing angles of incident light direction, reflected light direction, and light source intensity,
  • the pose calibration information including: intrinsic parameters of the projection device and the camera, extrinsic parameters between the projection device and the camera, the projection device is used to project material coding patterns, and the camera is used to collect at least three image groups;
  • the above-mentioned generation unit is specifically used to construct an energy function based on the visualization matrix and the observation matrix, the energy function is used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value is related to the visualization matrix, and the observed value is related to the observation matrix; the generation unit is specifically used to minimize the value of the energy function to obtain parameter information.
  • the parameter information includes: material mapping parameters and/or geometric structure parameters, the geometric structure parameters include optimized depth or initialized depth; the energy function is shown in Formula 1:
  • the material mapping parameters include is the diffuse reflection variable; is the specular reflection variable; is the roughness; z * is the geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles, and the calculation method of the estimated value is shown in Formula 2, where Ii is the observation value of any point at any viewing angle obtained by the camera (it can also be understood as the pixel difference between the reflection image corresponding to the all-black pattern and the reflection image corresponding to the all-white pattern at any viewing angle); i is the number of different viewing angles; E is the regularization term;
  • E i is the light source intensity of any point at any viewing angle
  • d is the distance between any point and the projector
  • f() is the reflection characteristic function
  • the reflection characteristic function is shown in Formula 3
  • n is the surface normal vector of any point
  • l i is the incident light direction of any point at any viewing angle
  • vi is the reflected light direction of any point at any viewing angle
  • the fourth aspect of the embodiment of the present application provides an image processing device that can be applied to a structured light system.
  • the image processing device includes: a control unit for triggering/controlling a projection device to project a material coding pattern onto an object; the control unit is also used to trigger/control a camera to collect reflection images of the object at different viewing angles for the material coding pattern, and the reflection images are used to generate material mapping parameters of the object; the control unit is also used to trigger/control a rotation device to rotate the object to achieve the object being located at different viewing angles.
  • the above-mentioned image processing device also includes a generation unit, which is used to generate material mapping parameters of the object based on the reflection images at different viewing angles.
  • the material coding pattern includes a full black pattern and a full white pattern.
  • the number of the reflected images at each of the different viewing angles is two.
  • a fifth aspect of an embodiment of the present application provides a structured light system, which includes: a camera, a projection device, a rotating device and an object; the camera is used to collect reflection images of the object at different viewing angles for a material coding pattern, and the material coding pattern is used to obtain material mapping parameters of the object; the projection device is used to project the material coding pattern onto the surface of the object; the rotating device is used to rotate the object to achieve that the object is located at different viewing angles.
  • this embodiment compared with the existing material measurement scheme based on structured light, which requires additional light sources and RGB cameras to obtain multi-view RGB images, this embodiment changes the encoding strategy of structured light, and can obtain multi-view RGB images required for material modeling without additional light sources and cameras.
  • a sixth aspect of an embodiment of the present application provides an image processing device, comprising: a processor, the processor being coupled to a memory, the memory being used to store programs or instructions, and when the programs or instructions are executed by the processor, the image processing device is enabled to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect, or the image processing device is enabled to implement the above-mentioned second aspect or any possible implementation of the second aspect.
  • a seventh aspect of an embodiment of the present application provides a computer-readable storage medium storing one or more computer-executable instructions.
  • the processor executes the method described in the first aspect or any possible implementation of the first aspect, or executes the method described in the second aspect or any possible implementation of the second aspect.
  • An eighth aspect of an embodiment of the present application provides a computer program product (or computer program) storing one or more computers.
  • the processor executes the method of the first aspect or any possible implementation of the first aspect, or executes the method of the second aspect or any possible implementation of the second aspect.
  • a ninth aspect of an embodiment of the present application provides a chip system, which includes at least one processor for supporting an image processing device to implement the functions involved in the above-mentioned first aspect or any possible implementation of the first aspect, or to implement the functions involved in the above-mentioned second aspect or any possible implementation of the second aspect.
  • the chip system may also include a memory for storing program instructions and data necessary for the first communication device.
  • the chip system may be composed of a chip, or may include a chip and other discrete devices.
  • the chip system also includes an interface circuit, which provides program instructions and/or data for the at least one processor.
  • the present application has the following advantages: at least three image groups are obtained from the reflection of the material coding pattern on the object surface at at least three viewing angles, and parameter information is generated based on the at least three image groups and the initial depth of the object surface, and the parameter information includes material mapping parameters and/or geometric structure parameters. Thus, the acquisition of material mapping parameters is realized.
  • FIG1 is a schematic diagram of the structure of an application scenario provided by an embodiment of the present application.
  • FIG2 is a flow chart of a data processing method provided in an embodiment of the present application.
  • FIG3 is an example diagram of a structured light coding pattern and a material coding pattern provided in an embodiment of the present application
  • FIG4 is another schematic flow chart of a data processing method provided in an embodiment of the present application.
  • FIG5 is another schematic flow chart of a data processing method provided in an embodiment of the present application.
  • FIG. 6 is an example diagram of a vase and a vase geometric structure provided in an embodiment of the present application.
  • FIG. 7 is an example diagram of a texture map generated by the prior art and an object reconstruction result based on the texture map
  • FIG8 is an example diagram of a material map and an object reconstruction result based on the material map provided in an embodiment of the present application
  • FIG9 is a schematic diagram of the structure of the system hardware provided in an embodiment of the present application.
  • FIG10 is a schematic diagram of a structure of an image processing device provided in an embodiment of the present application.
  • FIG. 11 is another schematic diagram of the structure of the image processing device provided in an embodiment of the present application.
  • the present application provides an image processing method, related equipment and structured light system for acquiring material maps.
  • stage one the structured light system only supports geometric output, without texture and material stickers.
  • stage two supports texture map output on the basis of stage one geometry by adding additional red, green and blue (RGB) cameras and light sources, but the texture map cannot correctly separate the diffuse and highlight components, there is obvious highlight noise, and it does not support physical base rendering (PBR).
  • RGB red, green and blue
  • PBR physical base rendering
  • the existing structured light technology can only obtain the depth information of the target scene. It is impossible to obtain the material map.
  • the existing hardware systems that support the spatial bidirectional reflectance distribution function (svBRDF) material measurement need to add additional light sources and cameras.
  • this method often consists of multiple cameras, multiple projectors, and dozens of high-power white light emitting diode (LED) surface light sources in different directions. It increases the complexity of system integration, and the equipment is bulky and inconvenient to use.
  • the embodiment of the present application provides an image processing method, which generates parameter information based on the initial depth of the at least three image groups and the object surface, without adding additional light sources and cameras, by obtaining at least three image groups reflected by the material coding pattern from the object surface at at least three viewing angles, and the parameter information includes material mapping parameters and/or geometric structure parameters, thereby achieving the acquisition of material mapping parameters.
  • Material maps that support svBRDF include: diffuse map, specular map, roughness map, and normal map.
  • the scenario to which the method provided in the embodiment of the present application is applicable may be the structured light system shown in FIG1 .
  • the structured light system includes: a camera 101, a projection device 102, a rotating device 103, and an object 104.
  • the camera 101 is used to collect reflection images of the object 104 at different viewing angles with respect to the coding pattern.
  • the coding pattern includes a material coding pattern, and the material coding pattern is used to obtain material mapping parameters.
  • the projection device 102 is used to project a coded pattern onto the surface of the object 104 .
  • the rotating device 103 is used to rotate the object 104 so that the object 104 is located at different viewing angles.
  • the object 104 can be understood as an object to be three-dimensionally scanned.
  • the rotating device 103 is used to place the object 104. It is understandable that the rotating device 103 may also include a plurality of brackets to support or fix the object 104, so as to realize the rotation of the rotating device 103 and drive the object 104 to rotate at the same time.
  • the coding pattern may further include a structured light coding pattern, which is used to obtain the machine geometry (such as depth) of the object.
  • the projection device 102 projects a specific coded pattern onto the object 104, and the camera 101 takes a picture to obtain the corresponding reflected image.
  • the rotation device 103 rotates a specific angle and repeats the above image acquisition process multiple times, which is usually greater than 2 times and can be set according to actual needs.
  • the image processing device generates parameter information of the object 104 based on the reflected images obtained in the above multiple acquisition processes to achieve three-dimensional reconstruction of the object 104.
  • the image processing device in the embodiments of the present application can be a server, a mobile phone, a tablet computer (pad), a portable game console, a personal digital assistant (PDA), a laptop computer, an ultra mobile personal computer (UMPC), a handheld computer, a netbook, a car media player, a wearable electronic device, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, and other devices with sufficient computing power.
  • PDA personal digital assistant
  • UMPC ultra mobile personal computer
  • a handheld computer a netbook
  • a car media player a wearable electronic device
  • VR virtual reality
  • AR augmented reality
  • the method can be performed by an image processing device. It can also be performed by a component of the image processing device (such as a processor, a chip, or a chip system, etc.).
  • the method can be applied to the structured light system shown in FIG. 1. Please refer to FIG. 2, which is a flow chart of the image processing method provided by the embodiment of the present application.
  • the method may include steps 201 to step 202. Step 207. Steps 201 to 207 are described in detail below.
  • Step 201 triggering the projector.
  • the image processing device sends a first trigger signal to the projector (ie, the projection device in FIG1 ).
  • the projector receives the first trigger signal sent by the image processing device.
  • the first trigger signal is used by the projector to project a structured light coding pattern onto an object.
  • Step 202 Project structured light coding.
  • the projector After the projector receives the first trigger signal, the projector projects a structured light coding pattern (or structured light coding) onto the object.
  • the structured light coding pattern is used to obtain the depth of the object.
  • the structured light coding pattern is shown in (a) of FIG3. It is understandable that (a) of FIG3 is only an example of 8 coding patterns (corresponding to 8 rows respectively). In practical applications, there may be fewer (e.g., 4, 5, etc.) or more (e.g., 16, 20, etc.) coding patterns. In addition, the structured light coding pattern may include multiple black and white patterns or multiple patterns corresponding to 0-255.
  • Step 203 triggering camera acquisition.
  • the image processing device After the projector projects the structured light coding pattern, the image processing device sends second trigger information to the camera to trigger the camera to acquire the image reflected by the object surface for the structured light coding pattern.
  • the second trigger information is used for the camera to collect the reflected image of the object surface.
  • this image can be used as input to structured light decoding to obtain an initial depth of the object.
  • Step 204 projecting the material code.
  • the image processing device After completing the structured light coding projection and acquisition, the image processing device sends a third trigger message to the projector to trigger the projector to project a material coding pattern (or material coding).
  • the third trigger message is used for the projector to project a material coding pattern onto the object.
  • the material coding pattern includes a full black pattern and a full white pattern.
  • the material coding pattern is shown in (b) of FIG3 .
  • Step 205 triggering camera acquisition.
  • the image processing device After the projector projects the material coding pattern, the image processing device sends fourth trigger information to the camera to trigger the camera to acquire the RGB image reflected by the surface of the object.
  • this RGB image can be used as input for photometric constraint modeling.
  • Step 206 turntable triggering.
  • the image processing device triggers the turntable (i.e., the rotating device in FIG1 ) to rotate to a specific angle, and obtains RGB images of different positions and postures through the relative movement of the object and each device in the structured light acquisition.
  • the turntable i.e., the rotating device in FIG1
  • the spatial point cloud stitching and fusion of the objects corresponding to the RGB images in different postures are completed to obtain the scanning results.
  • Step 207 end the determination.
  • light structure coding patterns can be projected at the main viewing angle
  • material coding patterns can be projected at the main viewing angle and other viewing angles, etc., which are not limited here.
  • a multi-view RGB image required for material modeling can be obtained. And the multi-view RGB image is used as the input for material modeling.
  • by changing the coding strategy of structured light by adding two material coding patterns of all white and all black, that is, by projecting the pattern through a projection device, the reflected image of the object for the projection pattern is obtained, and the multi-view RGB image required for material modeling can be obtained without adding an additional light source and camera.
  • FIG. 4 is a flowchart of an image processing method provided in an embodiment of the present application.
  • the method can be performed by an image processing device. It can also be performed by a component of the image processing device (such as a processor, a chip, or a chip system, etc.).
  • the method can be applied to the structured light system shown in FIG. 1, and the method can include steps 401 to 403. Steps 401 to 403 are described in detail below.
  • Step 401 Acquire at least three image groups.
  • the at least three image groups in the embodiment of the present application are reflection images of the object surface with respect to the material coding pattern at at least three viewing angles, wherein the at least three image groups correspond one-to-one to the at least three viewing angles.
  • the material coding pattern includes an all-black pattern and an all-white pattern.
  • a first reflection image of the object for the all-black pattern and a second reflection image of the all-white pattern are obtained.
  • an image group can be obtained, and the image group includes the first reflection image and the second reflection image. That is, three image groups include six reflection images.
  • the image processing device can obtain at least three image groups in the embodiment of the present application. It can be by receiving images sent by other devices, by selecting from a database, or by obtaining at least three image groups through the method of the embodiment shown in Figure 2 above, etc. The specifics are not limited here.
  • Step 402 Obtain an initial depth of the object surface corresponding to any one of at least three image groups.
  • the image processing device can obtain the initial depth in the embodiment of the present application. It can be by receiving it from other devices, by selecting it from a database, or by obtaining at least three image groups through the method of the embodiment shown in Figure 2 above, etc. The specifics are not limited here.
  • the projection device projects a structured light coding pattern onto the surface of the object
  • the camera collects a reflection image of the object surface for the structured light coding pattern, and obtains the initial depth of the object at the viewing angle through the image.
  • the at least three image groups in the aforementioned step 401 may also include a reflection image of the object surface for the structured light coding pattern.
  • each of the aforementioned at least three image groups includes a first reflection image and a second reflection image at a certain viewing angle.
  • the first reflection image is a reflection image of the object surface for the structured light coding pattern
  • the second reflection image is a reflection image of the object surface for the material coding pattern.
  • the initial depth can be obtained by processing at least three image groups, or it can be obtained by processing images other than at least three image groups (i.e., reflection images of the object surface for the structured light coding pattern).
  • the aforementioned at least three image groups may be four image groups, and the four image groups include: reflection images of the object surface for the material coding pattern at three viewing angles and reflection images of the object surface for the structured light coding pattern at the main viewing angle.
  • the number of reflection images corresponding to the structured light coding pattern for example, the description of (a) in the aforementioned FIG. 3).
  • Step 403 Generate parameter information of the object based on at least three image groups and the initial depth.
  • the image processing device After acquiring at least three image groups and an initial depth, the image processing device generates parameter information of the object based on the at least three image groups and the initial depth, where the parameter information includes material mapping parameters and/or geometric structure parameters.
  • step 403 may refer to Fig. 5.
  • Fig. 5 includes steps 501 to 506. Steps 501 to 506 are described in detail below.
  • Step 501 key frame.
  • the image processing device uses the image group corresponding to any one of the at least three perspectives as a key frame.
  • the perspective corresponding to the key frame is used as the main perspective.
  • the point cloud contained in the key frame is the optimization target (or understood as determining the range of the material map), and the pixel coordinates corresponding to the point cloud in the key frame are the image foreground.
  • the viewing angle corresponding to the initial depth in the above step 402 is used as the main viewing angle
  • the image group corresponding to the initial depth is the target image group.
  • Step 502 adjacent frames are determined to complete image registration (or image calibration).
  • At least two frames of images adjacent to the key frame are selected as adjacent frames.
  • the point cloud coordinates in the key frame are reprojected to the pixel positions and RGB values in each adjacent frame.
  • the image processing device can obtain the relative position relationship between at least three image groups and the object. And based on the relative position relationship, the occlusion information of the spatial point cloud of the object surface in the target image group corresponding to the spatial point cloud in the two image groups is obtained.
  • the two image groups are two image groups other than the target image group in the at least three image groups.
  • the occlusion information can be obtained by using methods such as reprojection, which are not specifically limited here.
  • Step 503 generate observation and visualization matrices.
  • the image processing device After the image processing device obtains the occlusion information, the pixel values corresponding to the occlusion information in the two image groups are removed to obtain a visualization matrix. This process can be understood as reducing the noise caused by occlusion.
  • the image processing device can also obtain the view of each point on the surface of the object from at least three perspectives based on the pose calibration information and the initialization depth.
  • the measurement matrix includes: pixel observation values under at least three viewing angles: incident light direction, reflected light direction, and light source intensity.
  • the pose calibration information includes: internal parameters of the projection device and the camera, and external parameters between the projection device and the camera.
  • the projection device is used to project the material coding pattern
  • the camera is used to collect at least three image groups.
  • the observation matrix can be Among them, for a point P on the surface of the object, L is the incident light direction of the point at the i viewing angle (it can also be understood as the irradiation direction of the projection device, that is, the irradiation direction of the light source), V is the reflected light direction of the point at the i viewing angle (it can also be understood as the observation direction of the camera), I is the pixel observation value at the point obtained by the camera at the i viewing angle (it can also be understood as the pixel difference between the reflected image corresponding to the all-black pattern and the reflected image corresponding to the all-white pattern at the i viewing angle). E is the light source intensity at the point at the i viewing angle.
  • the parameter information can be determined based on the visualization matrix and the observation matrix (as shown in steps 504 to 506 below).
  • the parameter information includes: material mapping parameters and/or geometric structure parameters, and the geometric structure parameters include optimized depth or initialized depth. Wherein, in the case where the geometric structure parameters include the initialized depth, this embodiment can be understood as obtaining material mapping parameters. In the case where the geometric structure parameters include the optimized depth, this embodiment can be understood as optimizing the geometric structure parameters of the object.
  • Step 504 Establish an energy function.
  • the image processing device constructs an energy function based on the visualization matrix and the observation matrix.
  • the energy function is used to represent the difference between the estimated value and the observed value of each point on the surface of the object.
  • the estimated value is related to the visualization matrix, and the observed value is related to the observation matrix.
  • the energy function is as shown in Formula 1:
  • the material mapping parameters include is the optimized diffuse reflection variable; is the optimized specular reflection variable; is the optimized roughness; z * is the optimized geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles.
  • the calculation method of the estimated value is shown in Formula 2, where I i is the observation value of any point obtained by the camera at any viewing angle; i is the number of different viewing angles; and E is the regularization term.
  • the regularization term includes regularization terms corresponding to normal vectors, depths, materials, etc., which are not specifically limited here.
  • E i is the light source intensity at any point at any viewing angle
  • d is the distance between any point and the projector
  • f() is the reflection characteristic function
  • the reflection characteristic function is shown in Formula 3
  • n is the surface normal vector of any point
  • l i is the incident light direction at any point at any viewing angle
  • vi is the reflected light direction at any point at any viewing angle
  • the initial diffuse reflectance variable is the initial specular reflection variable; rs is the initial roughness;
  • D() represents the microfacet distribution function, which is used to express the change of microfacet slope;
  • G() represents the geometric attenuation coefficient.
  • the incident light on the microfacet may be blocked by the adjacent microfacets before reaching a surface or after being reflected by the surface. This blocking will cause a slight dimming of the specular reflection, and the geometric attenuation coefficient can be used to measure this effect.
  • Step 505 Minimize the energy function.
  • the parameter information also includes: material mapping parameters and/or geometric structure parameters, and the geometric structure parameters include optimized depth or initialized depth. Among them, when the geometric structure parameters include the initialized depth, this embodiment can be understood as obtaining material mapping parameters. When the geometric structure parameters include the optimized depth, this embodiment can be understood as optimizing the geometric structure parameters of the object.
  • the parameter information may include the above
  • z * is the initial depth Z, i.e.
  • the initial depth is a fixed value
  • the material mapping parameters are the parameters to be optimized.
  • the parameter information may include the above-mentioned z * . for r s is the preset value, that is, the material mapping parameters are fixed values, and the geometric structure parameters are the parameters to be optimized.
  • the parameter information may include the above z * , In this case, it can be understood that both the material mapping parameters and the geometric structure parameters are parameters to be optimized.
  • the initial depth/optimized depth can be used to generate a normal map
  • the initial or optimized diffuse variables can be used to generate a diffuse map
  • the initial or optimized specular variables can be used to generate a specular map
  • the initial or optimized roughness can be used to generate a roughness map.
  • Step 506 Convergence determination.
  • the convergence condition includes at least one of the following: the number of repetitions is a first preset threshold, the value of the energy function is less than a second preset threshold, etc.
  • a new viewing angle can be selected as the main viewing angle to repeat the above process, and finally the parameter information of the object under multiple viewing angles is obtained. Then, the object material map is generated according to the fusion splicing and other processing.
  • At least three image groups are obtained by reflecting the material coding pattern on the surface of an object at least three viewing angles, and parameter information is generated based on the initial depth of the at least three image groups and the surface of the object, and the parameter information includes material mapping parameters and/or geometric structure parameters.
  • the projection device is changed into a light source, which can support PBR material mapping output.
  • the material map includes diffuse reflection map, specular reflection map, roughness map and normal map, which supports PBR rendering.
  • the above-mentioned material modeling and solution algorithm can be used for mobile phone material measurement, providing a material modeling solution for the existing mobile phone-based three-dimensional reconstruction algorithm, and supporting the material output function of the mobile phone.
  • the reconstruction of a vase is taken as an example below to exemplarily describe the reconstruction results of the vase using the prior art and the image processing method provided in the present application.
  • the object is a physical picture of a vase as shown in Figure 6 (a), and Figure 6 (b) is a geometric structure diagram of the object.
  • Figure 7 (a) is a texture map generated by the prior art
  • Figure 7 (b) is the reconstruction result of the texture map in the prior art.
  • Figure 8 (a) is a material map obtained by the method of the embodiment of the present application
  • Figure 8 (b) is the reconstruction result of the material map obtained by the method of the embodiment of the present application.
  • the embodiment of the present application also provides a system hardware.
  • the system hardware is shown in Figure 9, and the system hardware includes: a turntable unit, a control unit, a lighting unit, a sensor unit, a storage unit and a computing unit.
  • the control unit first sends a trigger signal to enable the projector to project a specific coded pattern, and the projector triggers the camera to take pictures to obtain the corresponding image, and upload it to the storage unit.
  • the control unit controls the turntable to rotate to a specific angle, and repeats the above image acquisition process to a preset number of times; after the complete scan is completed, the computing unit completes the calculation of the object parameter information (i.e., including the geometric structure and svBRDF).
  • the turntable unit may include a turntable and a power supply.
  • the control unit may include a central processing unit (CPU) and a cache.
  • the lighting unit includes a power supply and a projector.
  • the sensor unit includes a camera and a transmission line.
  • the storage unit includes a cache and an external storage.
  • the computing unit includes a CPU, a graphics processing unit (GPU), a cache and a transmission line.
  • An embodiment of the image processing device in the embodiment of the present application includes:
  • An acquisition unit 1001 is used to acquire at least three image groups, where the at least three image groups are reflection images of the object surface at at least three viewing angles with respect to the material coding pattern;
  • the acquisition unit 1001 is further used to acquire an initial depth of the object surface corresponding to any one of the at least three image groups;
  • a generating unit 1002 is used to generate parameter information of an object based on at least three image groups and an initial depth, wherein the parameter information includes material map parameters. number and/or geometric parameters.
  • the image processing device is applied to a structured light system, the structured light system comprising a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device being used to rotate multiple times so that the object is located at at least three viewing angles;
  • the acquisition unit 1001 is specifically used to trigger the projection device to project a material coding pattern onto the object at each of at least three viewing angles; the acquisition unit 1001 is specifically used to trigger the camera to capture an image group reflected by the object for the material coding pattern at each viewing angle to obtain at least three image groups.
  • the material coding pattern includes an all-black pattern and an all-white pattern.
  • the generation unit 1002 is specifically used to obtain the occlusion information of the spatial point cloud on the surface of the object in the target image group corresponding to the spatial point cloud in the two image groups, any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group in at least three image groups; the generation unit 1002 is specifically used to eliminate the pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix; the generation unit 1002 is specifically used to obtain the observation matrix of each point on the surface of the object under at least three viewing angles based on the pose calibration information and the initialization depth, the observation matrix including: the pixel observation values under at least three viewing angles of the incident light direction, the reflected light direction, and the light source intensity, the pose calibration information including: the intrinsic parameters of the projection device and the camera, the extrinsic parameters between the projection device and the camera, the projection device is used to project the material coding pattern, and the camera is used to collect at least three image groups; the generation unit 1002
  • the generating unit 1002 is specifically used to construct an energy function based on the visualization matrix and the observation matrix, the energy function is used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value is related to the visualization matrix, and the observed value is related to the observation matrix;
  • the generating unit 1002 is specifically configured to minimize the value of the energy function to obtain parameter information.
  • the projection device is turned into a light source, which can support PBR material map output.
  • the material map includes diffuse reflection map, specular reflection map, roughness map and normal map, which supports PBR rendering.
  • the above-mentioned material modeling and solution algorithm can be used for mobile phone material measurement, providing a material modeling solution for the existing mobile phone-based 3D reconstruction algorithm, and supporting the material output function of the mobile phone.
  • the image processing device may include a processor 1101, a memory 1102, and a communication port 1103.
  • the processor 1101, the memory 1102, and the communication port 1103 are interconnected via a line.
  • the memory 1102 stores program instructions and data.
  • the memory 1102 stores program instructions and data corresponding to the steps executed by the image processing device in the corresponding implementation modes shown in the aforementioned FIGS. 1 to 5 .
  • the processor 1101 is used to execute the steps performed by the image processing device shown in any of the embodiments shown in Figures 1 to 5 above.
  • the communication port 1103 can be used to receive and send data, and to execute the steps related to acquisition, sending, and receiving in any of the embodiments shown in FIG. 1 to FIG. 5 .
  • the image processing device may include more or fewer components than those in FIG. 11 , and this application is merely an illustrative description and is not intended to be limiting.
  • An embodiment of the present application further provides a computer-readable storage medium storing one or more computer-executable instructions.
  • the processor executes the method described in the possible implementation manner of the image processing device in the aforementioned embodiment.
  • An embodiment of the present application also provides a computer program product (or computer program) storing one or more computers.
  • the processor executes the method of the possible implementation mode of the above-mentioned image processing device.
  • the embodiment of the present application also provides a chip system, which includes at least one processor for supporting a terminal device to implement the functions involved in the possible implementation of the above-mentioned image processing device.
  • the chip system also includes an interface circuit, which provides program instructions and/or data for the at least one processor.
  • the chip system may also include a memory, which is used to store the necessary program instructions and data for the image processing device.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
  • 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.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The present application discloses an image processing method, a related device, and a structured light system, which can be applied to a structured light system. The method comprises: acquiring at least three image groups, the at least three image groups being reflection images of a surface of an object for a material coding pattern at at least three angles of view, and the at least three image groups being in one-to-one correspondence with the at least three angles of view; acquiring an initial depth of the surface of the object corresponding to any one of the at least three image groups; and generating parameter information of the object on the basis of the at least three image groups and the initial depth, the parameter information comprising a material map parameter and/or a geometric structure parameter. The parameter information is generated on the basis of the at least three image groups and the initial depth of the surface of the object by means of the three image groups, of the surface of the object, which are obtained by reflecting the material coding pattern at the at least three angles of view, and the parameter information comprises the material map parameter and/or the geometric structure parameter. Therefore, the material map parameter is acquired.

Description

一种图像处理方法、相关设备及结构光系统Image processing method, related equipment and structured light system
本申请要求于2022年10月31日提交中国专利局、申请号为202211349694.0、发明名称为“一种图像处理方法、相关设备及结构光系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on October 31, 2022, with application number 202211349694.0 and invention name “An image processing method, related equipment and structured light system”, the entire contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及图像处理领域,尤其涉及一种图像处理方法、相关设备及结构光系统。The present application relates to the field of image processing, and in particular to an image processing method, related equipment and a structured light system.
背景技术Background technique
结构光技术是一种基于三角测量的三维重建技术,典型的结构光系统由一个相机(camera)和投影仪(projector)构成。扫描过程中,投影仪首先投射具有特定编码信息的图案到目标场景表面,由工业相机获取被反射的编码信息,然后通过解码确立投影仪和相机像素的对应性,最后基于三角测量原理获取目标场景深度信息。Structured light technology is a 3D reconstruction technology based on triangulation. A typical structured light system consists of a camera and a projector. During the scanning process, the projector first projects a pattern with specific coded information onto the surface of the target scene. The industrial camera then obtains the reflected coded information, and then decodes to establish the correspondence between the projector and camera pixels. Finally, the depth information of the target scene is obtained based on the principle of triangulation.
然而,随着元宇宙和三维数字化产业的发展,三维重建技术和系统需同时满足高精度和高真实度的要求,即高精几何和材质贴图。However, with the development of the metaverse and three-dimensional digitalization industry, three-dimensional reconstruction technology and systems need to meet the requirements of high precision and high realism at the same time, that is, high-precision geometry and material mapping.
因此,如何获取材质贴图是亟待解决的技术问题。Therefore, how to obtain material maps is a technical problem that needs to be solved urgently.
发明内容Summary of the invention
本申请实施例提供了一种图像处理方法、相关设备及结构光系统,用于实现材质贴图的获取。The embodiments of the present application provide an image processing method, related equipment and a structured light system for acquiring material maps.
本申请实施例第一方面提供了一种图像处理方法,可以应用于结构光系统。该方法可以由图像处理设备执行,也可以由图像处理设备的部件(例如处理器、芯片、或芯片系统等)执行。该方法包括:获取至少三个图像组,至少三个图像组为物体表面在至少三个视角下针对于材质编码图案的反射图像;所述至少三个图像组与所述至少三个视角一一对应;获取至少三个图像组中任意一个图像组对应物体表面的初始深度;基于至少三个图像组与初始深度生成物体的参数信息,参数信息包括材质贴图参数和/或几何结构参数。The first aspect of the embodiment of the present application provides an image processing method that can be applied to a structured light system. The method can be performed by an image processing device, or by a component of the image processing device (such as a processor, a chip, or a chip system, etc.). The method includes: obtaining at least three image groups, at least three image groups are reflection images of the object surface for a material coding pattern at at least three viewing angles; the at least three image groups correspond one-to-one to the at least three viewing angles; obtaining the initial depth of the object surface corresponding to any one of the at least three image groups; generating parameter information of the object based on the at least three image groups and the initial depth, the parameter information including material mapping parameters and/or geometric structure parameters.
本申请实施例中,通过物体表面在至少三个视角下针对于材质编码图案反射得到的至少三个图像组,基于该至少三个图像组与物体表面的初始深度生成参数信息,参数信息包括材质贴图参数和/或几何结构参数。从而实现材质贴图参数的获取。In the embodiment of the present application, at least three image groups are obtained by reflecting the material coding pattern from the object surface at least three viewing angles, and parameter information is generated based on the initial depth of the at least three image groups and the object surface, and the parameter information includes material mapping parameters and/or geometric structure parameters, thereby achieving the acquisition of material mapping parameters.
可选地,在第一方面的一种可能的实现方式中,上述方法应用于结构光系统,结构光系统包括相机、投影设备、旋转设备以及与旋转设备连接的物体,旋转设备用于多次转动以使得物体位于至少三个视角;获取至少三个图像组,包括:在至少三个视角的每个视角下触发投影设备向物体投射材质编码图案;在每个视角下触发相机采集物体针对于材质编码图案反射的图像组,以获取至少三个图像组。所述初始深度由所述投影设备向所述物体投射结构光编码图案的方式得到。Optionally, in a possible implementation of the first aspect, the method is applied to a structured light system, the structured light system comprising a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device being used to rotate multiple times so that the object is located at at least three viewing angles; acquiring at least three image groups, comprising: triggering the projection device to project a material coding pattern onto the object at each of the at least three viewing angles; triggering the camera to collect an image group reflected by the object for the material coding pattern at each viewing angle, so as to acquire at least three image groups. The initial depth is obtained by the projection device projecting the structured light coding pattern onto the object.
该种可能的实现方式中,相较于现有基于结构光的材质测量方案需额外增加光源和RGB相机获取多视角RGB图像。本实施例通过改变结构光的编码策略,无需额外增加光源和相机即可获取材质建模所需多视角RGB图像。In this possible implementation, compared with the existing material measurement solution based on structured light, which requires additional light sources and RGB cameras to obtain multi-view RGB images, this embodiment changes the encoding strategy of structured light, and can obtain multi-view RGB images required for material modeling without additional light sources and cameras.
可选地,在第一方面的一种可能的实现方式中,上述的材质编码图案包括全黑图案与全白图案。所述至少三个图像组中的每个图像组包括两张反射图像。Optionally, in a possible implementation manner of the first aspect, the material coding pattern includes a full black pattern and a full white pattern. Each of the at least three image groups includes two reflection images.
该种可能的实现方式中,通过增加全白和全黑两张材质编码图案,无需额外增加光源和相机即可获取材质建模所需多视角RGB图像。In this possible implementation, by adding two material coding patterns, one completely white and one completely black, the multi-view RGB images required for material modeling can be obtained without adding additional light sources and cameras.
可选地,在第一方面的一种可能的实现方式中,上述步骤:基于至少三个图像与初始深度生成物体的参数信息,包括:获取目标图像组中物体表面的空间点云在两个图像组中对应空间点云的遮挡信息,任意一个图像组为目标图像组,两个图像组为至少三个图像组中除了目标图像组以外的两个图像组;剔除两个图像组中遮挡信息对应的像素值,以获取可视化矩阵;基于位姿标定信息与初始化深度获取物体表面各点 在至少三个视角下的观测矩阵,观测矩阵包括:入射光方向、反射光方向、光源强度至少三个视角下的像素观测值,位姿标定信息包括:投影设备与相机的内参、投影设备与相机之间的外参,投影设备用于投射材质编码图案,相机用于采集至少三个图像组;基于可视化矩阵与观测矩阵确定参数信息。Optionally, in a possible implementation of the first aspect, the above-mentioned step: generating parameter information of the object based on at least three images and the initial depth includes: obtaining occlusion information of the spatial point cloud of the object surface in the target image group corresponding to the spatial point cloud in the two image groups, any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group in the at least three image groups; eliminating pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix; obtaining the image matrix of each point on the surface of the object based on the pose calibration information and the initialization depth. The observation matrix under at least three viewing angles includes: the incident light direction, the reflected light direction, the pixel observation values under at least three viewing angles of the light source intensity; the posture calibration information includes: the intrinsic parameters of the projection device and the camera, the extrinsic parameters between the projection device and the camera, the projection device is used to project the material coding pattern, and the camera is used to collect at least three image groups; the parameter information is determined based on the visualization matrix and the observation matrix.
该种可能的实现方式中,通过位姿标定信息、各相对位置关系可以获取观测矩阵与可视化矩阵,进而根据观测矩阵与可视化矩阵获取物体的参数信息。In this possible implementation, the observation matrix and the visualization matrix can be obtained through the posture calibration information and the relative position relationships, and then the parameter information of the object can be obtained according to the observation matrix and the visualization matrix.
可选地,在第一方面的一种可能的实现方式中,上述步骤:基于可视化矩阵与观测矩阵确定参数信息,包括:基于可视化矩阵与观测矩阵构建能量函数,能量函数用于表示物体表面各点的估计值与观测值之间的差异,估计值与可视化矩阵相关,观测值与观测矩阵相关;最小化能量函数的值以获取参数信息。Optionally, in a possible implementation of the first aspect, the above steps: determining parameter information based on the visualization matrix and the observation matrix, include: constructing an energy function based on the visualization matrix and the observation matrix, the energy function being used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value being related to the visualization matrix, and the observed value being related to the observation matrix; minimizing the value of the energy function to obtain parameter information.
该种可能的实现方式中,通过基于可视化矩阵与观测矩阵构建估计值与观测值的能量函数,可以在最小化能量函数的过程中,优化材质贴图参数和/或几何结构参数。In this possible implementation, by constructing an energy function of estimated values and observed values based on the visualization matrix and the observation matrix, the material mapping parameters and/or geometric structure parameters can be optimized in the process of minimizing the energy function.
可选地,在第一方面的一种可能的实现方式中,上述的参数信息包括:材质贴图参数和/或几何结构参数,几何结构参数包括优化后的深度或初始化深度;能量函数如公式一所示:Optionally, in a possible implementation manner of the first aspect, the parameter information includes: material mapping parameters and/or geometric structure parameters, the geometric structure parameters include optimized depth or initialized depth; the energy function is shown in Formula 1:
公式一: Formula 1:
其中,所述材质贴图参数包括为漫反射变量;为镜面反射变量;为粗糙度;z*为所述几何结构参数;为所述物体表面任意一点在不同视角下的所述估计值,所述估计值的计算方式如公式二所示,Ii为所述相机获取到的所述任意一点在任意一视角下的观测值(也可以理解为是在任意一视角下,全黑图案对应的反射图像与全白图案对应的反射图像之间的像素差值);i为所述不同视角的数量;E为正则项;The material mapping parameters include is the diffuse reflection variable; is the specular reflection variable; is the roughness; z * is the geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles, and the calculation method of the estimated value is shown in Formula 2, where Ii is the observation value of any point at any viewing angle obtained by the camera (it can also be understood as the pixel difference between the reflection image corresponding to the all-black pattern and the reflection image corresponding to the all-white pattern at any viewing angle); i is the number of different viewing angles; E is the regularization term;
公式二: Formula 2:
其中,Ei为所述任意一点在任一视角下的光源强度,d为所述任意一点到所述投影仪之间的距离,f()为反射特性函数,所述反射特性函数如公式三所示所示,n为所述任意一点的表面法向量,li为所述任意一点在所述任意一视角下的入射光方向,vi为所述任意一点在所述任意一视角下的反射光方向;Wherein, E i is the light source intensity of any point at any viewing angle, d is the distance between any point and the projector, f() is the reflection characteristic function, and the reflection characteristic function is shown in Formula 3, n is the surface normal vector of any point, l i is the incident light direction of any point at any viewing angle, and vi is the reflected light direction of any point at any viewing angle;
公式三: Formula 3:
其中,为初始漫反射变量;为初始镜面反射变量;rs为初始粗糙度;D()表示微平面分布函数,G()表示几何衰减系数。in, is the initial diffuse reflectance variable; is the initial specular reflection variable; rs is the initial roughness; D() represents the microfacet distribution function, and G() represents the geometric attenuation coefficient.
本申请实施例第二方面提供了一种图像处理方法,可以应用于结构光系统,该结构光系统包括:相机、投影设备、旋转设备以及物体。该方法可以由图像处理设备执行,也可以由图像处理设备的部件(例如处理器、芯片、或芯片系统等)执行。该方法包括:触发/控制投影设备向物体投射材质编码图案;触发/控制相机采集物体在不同视角下针对于材质编码图案的反射图像,反射图像用于生成物体的材质贴图;触发/控制旋转设备旋转物体以实现物体位于不同视角。The second aspect of the embodiment of the present application provides an image processing method, which can be applied to a structured light system, the structured light system comprising: a camera, a projection device, a rotating device and an object. The method can be performed by an image processing device, or by a component of the image processing device (such as a processor, a chip, or a chip system, etc.). The method comprises: triggering/controlling a projection device to project a material coding pattern onto an object; triggering/controlling a camera to collect a reflection image of the object at different viewing angles for the material coding pattern, the reflection image being used to generate a material map of the object; triggering/controlling a rotating device to rotate the object to achieve that the object is located at different viewing angles.
本实施例中,相较于现有基于结构光的材质测量方案需额外增加光源和RGB相机获取多视角RGB图像。本实施例通过改变结构光的编码策略,无需额外增加光源和相机即可获取材质建模所需多视角RGB图像。In this embodiment, compared with the existing material measurement scheme based on structured light, which requires additional light sources and RGB cameras to obtain multi-view RGB images, this embodiment changes the encoding strategy of structured light, and can obtain multi-view RGB images required for material modeling without additional light sources and cameras.
可选地,在第二方面的一种可能的实现方式中,上述方法还包括:基于不同视角下的反射图像生成物体的材质贴图参数。Optionally, in a possible implementation manner of the second aspect, the method further includes: generating material mapping parameters of the object based on reflection images at different viewing angles.
可选地,在第二方面的一种可能的实现方式中,上述的材质编码图案包括全黑图案与全白图案。所述不同视角中每个视角下的反射图像数量为两个。Optionally, in a possible implementation manner of the second aspect, the material coding pattern includes a full black pattern and a full white pattern. The number of the reflected images at each of the different viewing angles is two.
该种可能的实现方式中,通过增加全白和全黑两张材质编码图案,无需额外增加光源和相机即可获取材质建模所需多视角RGB图像。In this possible implementation, by adding two material coding patterns, one completely white and one completely black, the multi-view RGB images required for material modeling can be obtained without adding additional light sources and cameras.
本申请实施例第三方面提供了一种图像处理设备,可以应用于结构光系统。该图像处理设备包括:获取单元,用于获取至少三个图像组,至少三个图像组为物体表面在至少三个视角下针对于材质编码图案的反射图像;获取单元,还用于获取至少三个图像组中任意一个图像组对应物体表面的初始深度;生成单元,用于基于至少三个图像组与初始深度生成物体的参数信息,参数信息包括材质贴图参数和/或几何结构参 数。The third aspect of the embodiment of the present application provides an image processing device that can be applied to a structured light system. The image processing device includes: an acquisition unit for acquiring at least three image groups, the at least three image groups being reflection images of the object surface for the material coding pattern at at least three viewing angles; the acquisition unit is also used to acquire the initial depth of the object surface corresponding to any one of the at least three image groups; a generation unit is used to generate parameter information of the object based on the at least three image groups and the initial depth, the parameter information including material mapping parameters and/or geometric structure parameters. number.
可选地,在第三方面的一种可能的实现方式中,上述的图像处理设备应用于结构光系统,结构光系统包括相机、投影设备、旋转设备以及与旋转设备连接的物体,旋转设备用于多次转动以使得物体位于至少三个视角;获取单元,具体用于在至少三个视角的每个视角下触发投影设备向物体投射材质编码图案;获取单元,具体用于在每个视角下触发相机采集物体针对于材质编码图案反射的图像组,以获取至少三个图像组。所述至少三个图像组与所述至少三个视角一一对应;所述初始深度由所述投影设备向所述物体投射结构光编码图案的方式得到。Optionally, in a possible implementation of the third aspect, the above-mentioned image processing device is applied to a structured light system, the structured light system includes a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device is used to rotate multiple times so that the object is located at at least three viewing angles; an acquisition unit is specifically used to trigger the projection device to project a material coding pattern to the object at each of the at least three viewing angles; the acquisition unit is specifically used to trigger the camera to collect an image group reflected by the object for the material coding pattern at each viewing angle, so as to obtain at least three image groups. The at least three image groups correspond to the at least three viewing angles one by one; the initial depth is obtained by the projection device projecting the structured light coding pattern to the object.
可选地,在第三方面的一种可能的实现方式中,上述的材质编码图案包括全黑图案与全白图案。所述不同视角中每个视角下的反射图像数量为两个。Optionally, in a possible implementation manner of the third aspect, the material coding pattern includes a full black pattern and a full white pattern. The number of the reflected images at each of the different viewing angles is two.
可选地,在第三方面的一种可能的实现方式中,上述的生成单元,具体用于获取目标图像组中物体表面的空间点云在两个图像组中对应空间点云的遮挡信息,任意一个图像组为目标图像组,两个图像组为至少三个图像组中除了目标图像组以外的两个图像组;生成单元,具体用于剔除两个图像组中遮挡信息对应的像素值,以获取可视化矩阵;生成单元,具体用于基于位姿标定信息与初始化深度获取物体表面各点在至少三个视角下的观测矩阵,观测矩阵包括:入射光方向、反射光方向、光源强度至少三个视角下的像素观测值,位姿标定信息包括:投影设备与相机的内参、投影设备与相机之间的外参,投影设备用于投射材质编码图案,相机用于采集至少三个图像组;生成单元,具体用于基于可视化矩阵与观测矩阵确定参数信息。Optionally, in a possible implementation manner of the third aspect, the above-mentioned generation unit is specifically used to obtain occlusion information of the spatial point cloud on the surface of the object in the target image group corresponding to the spatial point cloud in the two image groups, any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group in at least three image groups; the generation unit is specifically used to eliminate the pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix; the generation unit is specifically used to obtain the observation matrix of each point on the surface of the object under at least three viewing angles based on the pose calibration information and the initialization depth, the observation matrix including: pixel observation values under at least three viewing angles of incident light direction, reflected light direction, and light source intensity, the pose calibration information including: intrinsic parameters of the projection device and the camera, extrinsic parameters between the projection device and the camera, the projection device is used to project material coding patterns, and the camera is used to collect at least three image groups; the generation unit is specifically used to determine parameter information based on the visualization matrix and the observation matrix.
可选地,在第三方面的一种可能的实现方式中,上述的生成单元,具体用于基于可视化矩阵与观测矩阵构建能量函数,能量函数用于表示物体表面各点的估计值与观测值之间的差异,估计值与可视化矩阵相关,观测值与观测矩阵相关;生成单元,具体用于最小化能量函数的值以获取参数信息。Optionally, in a possible implementation of the third aspect, the above-mentioned generation unit is specifically used to construct an energy function based on the visualization matrix and the observation matrix, the energy function is used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value is related to the visualization matrix, and the observed value is related to the observation matrix; the generation unit is specifically used to minimize the value of the energy function to obtain parameter information.
可选地,在第三方面的一种可能的实现方式中,上述的参数信息包括:材质贴图参数和/或几何结构参数,几何结构参数包括优化后的深度或初始化深度;能量函数如公式一所示:Optionally, in a possible implementation manner of the third aspect, the parameter information includes: material mapping parameters and/or geometric structure parameters, the geometric structure parameters include optimized depth or initialized depth; the energy function is shown in Formula 1:
公式一: Formula 1:
其中,所述材质贴图参数包括为漫反射变量;为镜面反射变量;为粗糙度;z*为所述几何结构参数;为所述物体表面任意一点在不同视角下的所述估计值,所述估计值的计算方式如公式二所示,Ii为所述相机获取到的所述任意一点在任意一视角下的观测值(也可以理解为是在任意一视角下,全黑图案对应的反射图像与全白图案对应的反射图像之间的像素差值);i为所述不同视角的数量;E为正则项;The material mapping parameters include is the diffuse reflection variable; is the specular reflection variable; is the roughness; z * is the geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles, and the calculation method of the estimated value is shown in Formula 2, where Ii is the observation value of any point at any viewing angle obtained by the camera (it can also be understood as the pixel difference between the reflection image corresponding to the all-black pattern and the reflection image corresponding to the all-white pattern at any viewing angle); i is the number of different viewing angles; E is the regularization term;
公式二: Formula 2:
其中,Ei为所述任意一点在任一视角下的光源强度,d为所述任意一点到所述投影仪之间的距离,f()为反射特性函数,所述反射特性函数如公式三所示所示,n为所述任意一点的表面法向量,li为所述任意一点在所述任意一视角下的入射光方向,vi为所述任意一点在所述任意一视角下的反射光方向;Wherein, E i is the light source intensity of any point at any viewing angle, d is the distance between any point and the projector, f() is the reflection characteristic function, and the reflection characteristic function is shown in Formula 3, n is the surface normal vector of any point, l i is the incident light direction of any point at any viewing angle, and vi is the reflected light direction of any point at any viewing angle;
公式三: Formula 3:
其中,为初始漫反射变量;为初始镜面反射变量;rs为初始粗糙度;D()表示微平面分布函数,G()表示几何衰减系数。in, is the initial diffuse reflectance variable; is the initial specular reflection variable; rs is the initial roughness; D() represents the microfacet distribution function, and G() represents the geometric attenuation coefficient.
本申请实施例第四方面提供了一种图像处理设备,可以应用于结构光系统。该图像处理设备包括:控制单元,用于触发/控制投影设备向物体投射材质编码图案;控制单元,还用于触发/控制相机采集物体在不同视角下针对于材质编码图案的反射图像,反射图像用于生成物体的材质贴图参数;控制单元,还用于触发/控制旋转设备旋转物体以实现物体位于不同视角。The fourth aspect of the embodiment of the present application provides an image processing device that can be applied to a structured light system. The image processing device includes: a control unit for triggering/controlling a projection device to project a material coding pattern onto an object; the control unit is also used to trigger/control a camera to collect reflection images of the object at different viewing angles for the material coding pattern, and the reflection images are used to generate material mapping parameters of the object; the control unit is also used to trigger/control a rotation device to rotate the object to achieve the object being located at different viewing angles.
可选地,在第四方面的一种可能的实现方式中,上述的图像处理设备还包括生成单元,用于基于不同视角下的反射图像生成物体的材质贴图参数。 Optionally, in a possible implementation manner of the fourth aspect, the above-mentioned image processing device also includes a generation unit, which is used to generate material mapping parameters of the object based on the reflection images at different viewing angles.
可选地,在第四方面的一种可能的实现方式中,上述的材质编码图案包括全黑图案与全白图案。所述不同视角中每个视角下的反射图像数量为两个。Optionally, in a possible implementation manner of the fourth aspect, the material coding pattern includes a full black pattern and a full white pattern. The number of the reflected images at each of the different viewing angles is two.
本申请实施例第五方面提供了一种结构光系统,该结构光系统包括:相机、投影设备、旋转设备以及物体;相机,用于采集物体在不同视角下针对于材质编码图案的反射图像,材质编码图案用于获取物体的材质贴图参数;投影设备,用于向物体的表面投射材质编码图案;旋转设备,用于旋转物体,以实现物体位于不同视角。A fifth aspect of an embodiment of the present application provides a structured light system, which includes: a camera, a projection device, a rotating device and an object; the camera is used to collect reflection images of the object at different viewing angles for a material coding pattern, and the material coding pattern is used to obtain material mapping parameters of the object; the projection device is used to project the material coding pattern onto the surface of the object; the rotating device is used to rotate the object to achieve that the object is located at different viewing angles.
本实施例中,相较于现有基于结构光的材质测量方案需额外增加光源和RGB相机获取多视角RGB图像。本实施例通过改变结构光的编码策略,无需额外增加光源和相机即可获取材质建模所需多视角RGB图像。In this embodiment, compared with the existing material measurement scheme based on structured light, which requires additional light sources and RGB cameras to obtain multi-view RGB images, this embodiment changes the encoding strategy of structured light, and can obtain multi-view RGB images required for material modeling without additional light sources and cameras.
本申请实施例第六方面提供了一种图像处理设备,包括:处理器,处理器与存储器耦合,存储器用于存储程序或指令,当程序或指令被处理器执行时,使得该图像处理设备备实现上述第一方面或第一方面的任意可能的实现方式中的方法,或者使得该图像处理设备实现上述第二方面或第二方面的任意可能的实现方式中的方法。A sixth aspect of an embodiment of the present application provides an image processing device, comprising: a processor, the processor being coupled to a memory, the memory being used to store programs or instructions, and when the programs or instructions are executed by the processor, the image processing device is enabled to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect, or the image processing device is enabled to implement the above-mentioned second aspect or any possible implementation of the second aspect.
本申请实施例第七方面提供一种存储一个或多个计算机执行指令的计算机可读存储介质,当计算机执行指令被处理器执行时,该处理器执行如上述第一方面或第一方面任意一种可能的实现方式所述的方法,或者执行如上述第二方面或第二方面任意一种可能的实现方式所述的方法。A seventh aspect of an embodiment of the present application provides a computer-readable storage medium storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect, or executes the method described in the second aspect or any possible implementation of the second aspect.
本申请实施例第八方面提供一种存储一个或多个计算机的计算机程序产品(或称计算机程序),当计算机程序产品被该处理器执行时,该处理器执行上述第一方面或第一方面任意一种可能实现方式的方法,或者执行如上述第二方面或第二方面任意一种可能的实现方式所述的方法。An eighth aspect of an embodiment of the present application provides a computer program product (or computer program) storing one or more computers. When the computer program product is executed by the processor, the processor executes the method of the first aspect or any possible implementation of the first aspect, or executes the method of the second aspect or any possible implementation of the second aspect.
本申请实施例第九方面提供了一种芯片系统,该芯片系统包括至少一个处理器,用于支持图像处理设备实现上述第一方面或第一方面任意一种可能的实现方式中所涉及的功能,或者实现上述第二方面或第二方面任意一种可能的实现方式中所涉及的功能。A ninth aspect of an embodiment of the present application provides a chip system, which includes at least one processor for supporting an image processing device to implement the functions involved in the above-mentioned first aspect or any possible implementation of the first aspect, or to implement the functions involved in the above-mentioned second aspect or any possible implementation of the second aspect.
在一种可能的设计中,该芯片系统还可以包括存储器,存储器,用于保存该第一通信装置必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。可选的,所述芯片系统还包括接口电路,所述接口电路为所述至少一个处理器提供程序指令和/或数据。In one possible design, the chip system may also include a memory for storing program instructions and data necessary for the first communication device. The chip system may be composed of a chip, or may include a chip and other discrete devices. Optionally, the chip system also includes an interface circuit, which provides program instructions and/or data for the at least one processor.
从以上技术方案可以看出,本申请具有以下优点:通过物体表面在至少三个视角下针对于材质编码图案反射得到的至少三个图像组,基于该至少三个图像组与物体表面的初始深度生成参数信息,参数信息包括材质贴图参数和/或几何结构参数。从而实现材质贴图参数的获取。It can be seen from the above technical solutions that the present application has the following advantages: at least three image groups are obtained from the reflection of the material coding pattern on the object surface at at least three viewing angles, and parameter information is generated based on the at least three image groups and the initial depth of the object surface, and the parameter information includes material mapping parameters and/or geometric structure parameters. Thus, the acquisition of material mapping parameters is realized.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的应用场景的结构示意图;FIG1 is a schematic diagram of the structure of an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的数据处理方法的一个流程示意图;FIG2 is a flow chart of a data processing method provided in an embodiment of the present application;
图3为本申请实施例提供的结构光编码图案与材质编码图案的示例图;FIG3 is an example diagram of a structured light coding pattern and a material coding pattern provided in an embodiment of the present application;
图4为本申请实施例提供的数据处理方法的另一个流程示意图;FIG4 is another schematic flow chart of a data processing method provided in an embodiment of the present application;
图5为本申请实施例提供的数据处理方法的另一个流程示意图;FIG5 is another schematic flow chart of a data processing method provided in an embodiment of the present application;
图6为本申请实施例提供的花瓶与花瓶几何结构的示例图;FIG. 6 is an example diagram of a vase and a vase geometric structure provided in an embodiment of the present application;
图7为通过现有技术生成的纹理贴图以及基于纹理贴图的物体重建结果的示例图;FIG. 7 is an example diagram of a texture map generated by the prior art and an object reconstruction result based on the texture map;
图8为本申请实施例提供的材质贴图以及基于材质贴图的物体重建结果的示例图;FIG8 is an example diagram of a material map and an object reconstruction result based on the material map provided in an embodiment of the present application;
图9为本申请实施例提供的系统硬件的一个结构示意图;FIG9 is a schematic diagram of the structure of the system hardware provided in an embodiment of the present application;
图10为本申请实施例提供的图像处理设备的一个结构示意图;FIG10 is a schematic diagram of a structure of an image processing device provided in an embodiment of the present application;
图11为本申请实施例提供的图像处理设备的另一个结构示意图。FIG. 11 is another schematic diagram of the structure of the image processing device provided in an embodiment of the present application.
具体实施方式Detailed ways
本申请提供了一种图像处理方法、相关设备及结构光系统,用于实现材质贴图的获取。The present application provides an image processing method, related equipment and structured light system for acquiring material maps.
目前,结构光技术可分为三个发展阶段,处于阶段一的结构光系统仅支持几何输出,无纹理和材质贴 图输出功能;处于阶段二的结构光系统通过额外增加红绿蓝(RGB)相机和光源在阶段一几何基础上支持纹理贴图输出,但纹理贴图无法正确分离漫反射和高光分量,存在明显的高光噪声,且不支持基于物理的渲染(Physical base rendering,PBR);为了满足高真实感和高精度的三维建模需求,能够支持PBR材质贴图输出的结构光系统是下一阶段的发展趋势。At present, structured light technology can be divided into three development stages. In stage one, the structured light system only supports geometric output, without texture and material stickers. The structured light system in stage two supports texture map output on the basis of stage one geometry by adding additional red, green and blue (RGB) cameras and light sources, but the texture map cannot correctly separate the diffuse and highlight components, there is obvious highlight noise, and it does not support physical base rendering (PBR). In order to meet the needs of high realism and high-precision 3D modeling, the structured light system that can support PBR material map output is the development trend of the next stage.
一方面,由背景技术所述,现有的结构光技术只能获取目标场景深度信息。无法获取材质贴图。另一方面,目前,为了获取材质测量所需的多视角图像,在结构光系统的基础上,现有支持空间双向反射分布函数(Spatially-Variant Bidirectional Reflectance Distribution Function,svBRDF)材质测量的硬件系统均需额外增加光源和相机。然而该种方式常常由多个相机、多个投影仪和几十个个不同方向的高功率白光发光二极管(light-emitting diode,LED)面光源组成。增加了系统集成复杂度,且设备体积庞大,不便于使用。On the one hand, as described in the background technology, the existing structured light technology can only obtain the depth information of the target scene. It is impossible to obtain the material map. On the other hand, at present, in order to obtain the multi-view images required for material measurement, on the basis of the structured light system, the existing hardware systems that support the spatial bidirectional reflectance distribution function (svBRDF) material measurement need to add additional light sources and cameras. However, this method often consists of multiple cameras, multiple projectors, and dozens of high-power white light emitting diode (LED) surface light sources in different directions. It increases the complexity of system integration, and the equipment is bulky and inconvenient to use.
为解决上述问题,本申请实施例提供一种图像处理方法,在不额外增加光源和相机的前提下,通过物体表面在至少三个视角下针对于材质编码图案反射得到的至少三个图像组,基于该至少三个图像组与物体表面的初始深度生成参数信息,参数信息包括材质贴图参数和/或几何结构参数。从而实现材质贴图参数的获取。To solve the above problems, the embodiment of the present application provides an image processing method, which generates parameter information based on the initial depth of the at least three image groups and the object surface, without adding additional light sources and cameras, by obtaining at least three image groups reflected by the material coding pattern from the object surface at at least three viewing angles, and the parameter information includes material mapping parameters and/or geometric structure parameters, thereby achieving the acquisition of material mapping parameters.
为了便于理解,下面先对本申请实施例主要涉及的相关术语和概念进行介绍。To facilitate understanding, the relevant terms and concepts mainly involved in the embodiments of the present application are first introduced below.
1、材质贴图1. Material Mapping
支持svBRDF的材质贴图(即)包括:漫反射贴图(diffuse map)、镜面反射贴图(specular map)、粗糙度贴图(roughness map)、法向贴图(normal map)。Material maps that support svBRDF include: diffuse map, specular map, roughness map, and normal map.
在对本申请实施例所提供的方法进行描述之前,先对本申请实施例所提供的方法所适用的应用场景进行描述。本申请实施例提供的方法所适用场景可以是图1所示的结构光系统。该结构光系统包括:相机101、投影设备102、旋转设备103、物体104。Before describing the method provided in the embodiment of the present application, the application scenario to which the method provided in the embodiment of the present application is applicable is described. The scenario to which the method provided in the embodiment of the present application is applicable may be the structured light system shown in FIG1 . The structured light system includes: a camera 101, a projection device 102, a rotating device 103, and an object 104.
其中,相机101,用于采集物体104在不同视角下针对于编码图案的反射图像。该编码图案包括材质编码图案,材质编码图案用于获取材质贴图参数。The camera 101 is used to collect reflection images of the object 104 at different viewing angles with respect to the coding pattern. The coding pattern includes a material coding pattern, and the material coding pattern is used to obtain material mapping parameters.
投影设备102,用于向物体104表面投射编码图案。The projection device 102 is used to project a coded pattern onto the surface of the object 104 .
旋转设备103,用于旋转物体104,以实现物体104位于不同视角。The rotating device 103 is used to rotate the object 104 so that the object 104 is located at different viewing angles.
物体104,可以理解为待被三维扫描的物体。The object 104 can be understood as an object to be three-dimensionally scanned.
可选地,旋转设备103用于放置物体104。可以理解的是,旋转设备13也可以包括多个支架,以支撑或固定物体104。以实现旋转设备103转动的同时带动物体104进行转动。Optionally, the rotating device 103 is used to place the object 104. It is understandable that the rotating device 103 may also include a plurality of brackets to support or fix the object 104, so as to realize the rotation of the rotating device 103 and drive the object 104 to rotate at the same time.
可选地,编码图案还可以包括结构光编码图案,该结构光编码图案用于获取物体的机几何结构(例如深度)。Optionally, the coding pattern may further include a structured light coding pattern, which is used to obtain the machine geometry (such as depth) of the object.
在采集过程中,投影设备102向物体104投射特定编码图案,相机101拍照获取相应反射图像。一次扫描完成后,旋转设备103转动特定角度,重复上述图像采集过程多次,该次数常大于2次,次数可以根据实际需要设置。在计算过程中,图像处理设备根据上述多次采集过程中获取的反射图像生成物体104的参数信息,以实现物体104的三维重建。During the acquisition process, the projection device 102 projects a specific coded pattern onto the object 104, and the camera 101 takes a picture to obtain the corresponding reflected image. After one scan is completed, the rotation device 103 rotates a specific angle and repeats the above image acquisition process multiple times, which is usually greater than 2 times and can be set according to actual needs. During the calculation process, the image processing device generates parameter information of the object 104 based on the reflected images obtained in the above multiple acquisition processes to achieve three-dimensional reconstruction of the object 104.
本申请实施例中的图像处理设备可以是服务器、手机、平板电脑(pad)、便携式游戏机、掌上电脑(personal digital assistant,PDA)、笔记本电脑、超级移动个人计算机(ultra mobile personal computer,UMPC)、手持计算机、上网本、车载媒体播放设备、可穿戴电子设备、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备等算力足够的设备。The image processing device in the embodiments of the present application can be a server, a mobile phone, a tablet computer (pad), a portable game console, a personal digital assistant (PDA), a laptop computer, an ultra mobile personal computer (UMPC), a handheld computer, a netbook, a car media player, a wearable electronic device, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, and other devices with sufficient computing power.
下面对本申请实施例提供的图像处理方法进行详细的介绍。该方法可以由图像处理设备执行。也可以由图像处理设备的部件(例如处理器、芯片、或芯片系统等)执行。该方法可以应用于图1所示的结构光系统,请参阅图2,本申请实施例提供的图像处理方法的一个流程示意图,该方法可以包括步骤201至步 骤207。下面对步骤201至步骤207进行详细说明。The following is a detailed description of the image processing method provided by the embodiment of the present application. The method can be performed by an image processing device. It can also be performed by a component of the image processing device (such as a processor, a chip, or a chip system, etc.). The method can be applied to the structured light system shown in FIG. 1. Please refer to FIG. 2, which is a flow chart of the image processing method provided by the embodiment of the present application. The method may include steps 201 to step 202. Step 207. Steps 201 to 207 are described in detail below.
步骤201,触发投影仪。Step 201, triggering the projector.
图像处理设备向投影仪(即图1中的投影设备)发送第一触发信号。相应的,投影仪接收图像处理设备发送的第一触发信号。该第一触发信号用于投影仪向物体投射结构光编码图案。The image processing device sends a first trigger signal to the projector (ie, the projection device in FIG1 ). Correspondingly, the projector receives the first trigger signal sent by the image processing device. The first trigger signal is used by the projector to project a structured light coding pattern onto an object.
步骤202,投射结构光编码。Step 202: Project structured light coding.
投影仪接收到第一触发信号之后,投影仪向物体投射结构光编码图案(或称为结构光编码)。该结构光编码图案用于获取物体的深度。After the projector receives the first trigger signal, the projector projects a structured light coding pattern (or structured light coding) onto the object. The structured light coding pattern is used to obtain the depth of the object.
示例性的,结构光编码图案如图3中的(a)所示。可以理解的是,图3中的(a)只是以8张编码图案(分别对应8行)为例。在实际应用中,还可以是更少(例如4张、5张等)或更多(例如16张、20张等)数量的编码图案。另外,对于结构光编码图案可以是包括多个黑白图案也可以是包括多个0-255对应的图案。Exemplarily, the structured light coding pattern is shown in (a) of FIG3. It is understandable that (a) of FIG3 is only an example of 8 coding patterns (corresponding to 8 rows respectively). In practical applications, there may be fewer (e.g., 4, 5, etc.) or more (e.g., 16, 20, etc.) coding patterns. In addition, the structured light coding pattern may include multiple black and white patterns or multiple patterns corresponding to 0-255.
步骤203,触发相机采集。Step 203, triggering camera acquisition.
在投影仪投射结构光编码图案之后,图像处理设备向相机发送第二触发信息,以触发相机获取物体表面针对于结构光编码图案所反射的图像。该第二触发信息用于相机采集物体表面的反射图像。After the projector projects the structured light coding pattern, the image processing device sends second trigger information to the camera to trigger the camera to acquire the image reflected by the object surface for the structured light coding pattern. The second trigger information is used for the camera to collect the reflected image of the object surface.
可选地,该图像可以作为结构光解码的输入,以获取物体的初始深度。Optionally, this image can be used as input to structured light decoding to obtain an initial depth of the object.
步骤204,投射材质编码。Step 204, projecting the material code.
在完成结构光编码投射和采集后。图像处理设备向投影仪发送第三触发信息,以触发投影仪投射材质编码图案(或称为材质编码)。该第三触发信息用于投影仪向物体投射材质编码图案。该材质编码图案包括全黑图案与全白图案。After completing the structured light coding projection and acquisition, the image processing device sends a third trigger message to the projector to trigger the projector to project a material coding pattern (or material coding). The third trigger message is used for the projector to project a material coding pattern onto the object. The material coding pattern includes a full black pattern and a full white pattern.
示例性的,材质编码图案如图3中的(b)所示。Exemplarily, the material coding pattern is shown in (b) of FIG3 .
步骤205,触发相机采集。Step 205, triggering camera acquisition.
在投影仪投射材质编码图案之后,图像处理设备向相机发送第四触发信息,以触发触发相机获取物体表面反射的RGB图像。After the projector projects the material coding pattern, the image processing device sends fourth trigger information to the camera to trigger the camera to acquire the RGB image reflected by the surface of the object.
可选地,该RGB图像可以作为光度约束建模的输入。Optionally, this RGB image can be used as input for photometric constraint modeling.
步骤206,转台触发。Step 206, turntable triggering.
图像处理设备触发转台(即图1中的旋转设备)转动特定角度,通过物体和结构光采集中各设备的相对运动,获取不同位姿的RGB图像。The image processing device triggers the turntable (i.e., the rotating device in FIG1 ) to rotate to a specific angle, and obtains RGB images of different positions and postures through the relative movement of the object and each device in the structured light acquisition.
此外,基于设定的转台角度,完成不同位姿的RGB图像对应物体的空间点云拼接和融合,获取扫描结果。In addition, based on the set turntable angle, the spatial point cloud stitching and fusion of the objects corresponding to the RGB images in different postures are completed to obtain the scanning results.
步骤207,结束判定。Step 207, end the determination.
判定系统是否已完成预设的采集次数;如是,则停止投影仪触发,结束采集;如未达到,则重复步骤201至步骤207,直至结束。Determine whether the system has completed the preset number of acquisitions; if so, stop triggering the projector and end the acquisition; if not, repeat steps 201 to 207 until the end.
可以理解的是,上述过程是以每个视角下投射光结构编码图案与材质编码图案为例,在实际应用中,可以在主视角下投射光结构编码图案,以及在主视角与其他视角下投射材质编码图案等,具体此处不做限定。It can be understood that the above process takes the projection of light structure coding patterns and material coding patterns at each viewing angle as an example. In actual applications, light structure coding patterns can be projected at the main viewing angle, and material coding patterns can be projected at the main viewing angle and other viewing angles, etc., which are not limited here.
本实施例中,通过提供一种图像采集方式,可以获取材质建模所需要的多视角RGB图像。并将该多视角RGB图像作为材质建模输入。相较于现有基于结构光的材质测量方案需额外增加光源和RGB相机获取多视角RGB图像。本实施例通过改变结构光的编码策略,通过增加全白和全黑两张材质编码图案,即通过投影设备投影图案的方式获取物体针对于投影图案的反射图像,无需额外增加光源和相机即可获取材质建模所需多视角RGB图像。In this embodiment, by providing an image acquisition method, a multi-view RGB image required for material modeling can be obtained. And the multi-view RGB image is used as the input for material modeling. Compared with the existing material measurement scheme based on structured light, it is necessary to add an additional light source and an RGB camera to obtain a multi-view RGB image. In this embodiment, by changing the coding strategy of structured light, by adding two material coding patterns of all white and all black, that is, by projecting the pattern through a projection device, the reflected image of the object for the projection pattern is obtained, and the multi-view RGB image required for material modeling can be obtained without adding an additional light source and camera.
请参阅图4,本申请实施例提供的图像处理方法的一个流程示意图,该方法可以由图像处理设备执行。也可以由图像处理设备的部件(例如处理器、芯片、或芯片系统等)执行。该方法可以应用于图1所示的结构光系统,该方法可以包括步骤401至步骤403。下面对步骤401至步骤403进行详细说明。Please refer to FIG. 4, which is a flowchart of an image processing method provided in an embodiment of the present application. The method can be performed by an image processing device. It can also be performed by a component of the image processing device (such as a processor, a chip, or a chip system, etc.). The method can be applied to the structured light system shown in FIG. 1, and the method can include steps 401 to 403. Steps 401 to 403 are described in detail below.
步骤401,获取至少三个图像组。 Step 401: Acquire at least three image groups.
本申请实施例中的至少三个图像组为物体表面在至少三个视角下针对于材质编码图案的反射图像。其中,至少三个图像组与至少三个视角一一对应。The at least three image groups in the embodiment of the present application are reflection images of the object surface with respect to the material coding pattern at at least three viewing angles, wherein the at least three image groups correspond one-to-one to the at least three viewing angles.
可选地,该材质编码图案包括全黑图案与全白图案。该种情况下,每一个视角下,获取物体对于全黑图案的第一反射图像以及全白图案的第二反射图像。第一个视角下可以获取一个图像组,该图像组包括第一反射图像与第二反射图像。即三个图像组包括六张反射图像。Optionally, the material coding pattern includes an all-black pattern and an all-white pattern. In this case, at each viewing angle, a first reflection image of the object for the all-black pattern and a second reflection image of the all-white pattern are obtained. At the first viewing angle, an image group can be obtained, and the image group includes the first reflection image and the second reflection image. That is, three image groups include six reflection images.
本申请实施例中图像处理设备获取至少三个图像组的方式有多种,可以是通过接收其他设备发送的方式,还可以是从数据库中选取的方式,也可以是通过前述图2所示实施例的方式获取至少三个图像组等,具体此处不做限定。There are many ways for the image processing device to obtain at least three image groups in the embodiment of the present application. It can be by receiving images sent by other devices, by selecting from a database, or by obtaining at least three image groups through the method of the embodiment shown in Figure 2 above, etc. The specifics are not limited here.
步骤402,获取至少三个图像组中任意一个图像组对应物体表面的初始深度。Step 402: Obtain an initial depth of the object surface corresponding to any one of at least three image groups.
本申请实施例中图像处理设备获取初始深度的方式有多种,可以是通过接收其他设备发送的方式,还可以是从数据库中选取的方式,也可以是通过前述图2所示实施例的方式获取至少三个图像组等,具体此处不做限定。There are many ways for the image processing device to obtain the initial depth in the embodiment of the present application. It can be by receiving it from other devices, by selecting it from a database, or by obtaining at least three image groups through the method of the embodiment shown in Figure 2 above, etc. The specifics are not limited here.
可选地,在至少一个视角下(即至少包括后续目标图像组对应的视角),投影设备向物体表面投射结构光编码图案,相机采集物体表面针对于该结构光编码图案的反射图像,并通过该图像获取该视角下物体的初始深度。Optionally, at least one viewing angle (i.e., at least the viewing angle corresponding to the subsequent target image group), the projection device projects a structured light coding pattern onto the surface of the object, the camera collects a reflection image of the object surface for the structured light coding pattern, and obtains the initial depth of the object at the viewing angle through the image.
可以理解的是,前述步骤401中的至少三个图像组还可以包括物体表面针对于结构光编码图案的反射图像。例如,假设每个视角下都投射结构光编码图案的场景,前述至少三个图像组中的每个图像组包括某一视角下的第一反射图像与第二反射图像。其中,第一反射图像为物体表面针对于结构光编码图案的反射图像,第二反射图像为物体表面针对于材质编码图案的反射图像。换句话说,该初始深度可以是根据至少三个图像组处理得到,也可以是根据除了至少三个图像组以外的图像(即物体表面针对于结构光编码图案的反射图像)处理得到。可以理解的是,假设在一个视角(或称为主视角)下投射结构光编码图案的场景,前述的至少三个图像组可以为四个图像组,四个图像组包括:物体表面在三个视角下针对于材质编码图案的反射图像以及物体表面在主视角下针对于结构光编码图案的反射图像。另外,对于结构光编码图案对应反射图像的数量不做限定(例如,前述图3中(a)的描述)。It is understandable that the at least three image groups in the aforementioned step 401 may also include a reflection image of the object surface for the structured light coding pattern. For example, assuming a scene in which a structured light coding pattern is projected at each viewing angle, each of the aforementioned at least three image groups includes a first reflection image and a second reflection image at a certain viewing angle. Among them, the first reflection image is a reflection image of the object surface for the structured light coding pattern, and the second reflection image is a reflection image of the object surface for the material coding pattern. In other words, the initial depth can be obtained by processing at least three image groups, or it can be obtained by processing images other than at least three image groups (i.e., reflection images of the object surface for the structured light coding pattern). It is understandable that, assuming a scene in which a structured light coding pattern is projected at one viewing angle (or referred to as a main viewing angle), the aforementioned at least three image groups may be four image groups, and the four image groups include: reflection images of the object surface for the material coding pattern at three viewing angles and reflection images of the object surface for the structured light coding pattern at the main viewing angle. In addition, there is no limitation on the number of reflection images corresponding to the structured light coding pattern (for example, the description of (a) in the aforementioned FIG. 3).
步骤403,基于至少三个图像组与初始深度生成物体的参数信息。Step 403: Generate parameter information of the object based on at least three image groups and the initial depth.
图像处理设备获取至少三个图像组与初始深度之后,基于至少三个图像组与初始深度生成物体的参数信息,该参数信息包括材质贴图参数和/或几何结构参数。After acquiring at least three image groups and an initial depth, the image processing device generates parameter information of the object based on the at least three image groups and the initial depth, where the parameter information includes material mapping parameters and/or geometric structure parameters.
该步骤403的流程可以参考图5。该图5包括包括步骤501至步骤506。下面对步骤步骤501至步骤506进行详细说明。The process of step 403 may refer to Fig. 5. Fig. 5 includes steps 501 to 506. Steps 501 to 506 are described in detail below.
步骤501,关键帧。Step 501, key frame.
图像处理设备将至少三个视角中的任一视角对应的图像组作为关键帧。以该关键帧对应的视角作为主视角。该关键帧中包含的点云为优化目标(或理解为确定材质贴图的范围),关键帧中点云对应的像素坐标为图像前景。The image processing device uses the image group corresponding to any one of the at least three perspectives as a key frame. The perspective corresponding to the key frame is used as the main perspective. The point cloud contained in the key frame is the optimization target (or understood as determining the range of the material map), and the pixel coordinates corresponding to the point cloud in the key frame are the image foreground.
可选地,将上述步骤402中初始深度对应的视角作为主视角,则该初始深度对应的图像组为目标图像组。Optionally, the viewing angle corresponding to the initial depth in the above step 402 is used as the main viewing angle, and the image group corresponding to the initial depth is the target image group.
步骤502,确定相邻帧,完成图像配准(或理解为图像校准)。Step 502, adjacent frames are determined to complete image registration (or image calibration).
基于已知不同帧间的位姿关系,选取关键帧周围相邻的至少两帧图像作为相邻帧。将关键帧中点云坐标重投影在各相邻帧中的像素位置和RGB值。Based on the known pose relationship between different frames, at least two frames of images adjacent to the key frame are selected as adjacent frames. The point cloud coordinates in the key frame are reprojected to the pixel positions and RGB values in each adjacent frame.
具体的,图像处理设备可以获取至少三个图像组与物体之间的相对位置关系。并基于上述相对位置关系获取目标图像组中物体表面的空间点云在两个图像组中对应空间点云的遮挡信息。该两个图像组为至少三个图像组中除了目标图像组以外的两个图像组。该遮挡信息的获取方式可以采用重投影等方法,具体此处不做限定。Specifically, the image processing device can obtain the relative position relationship between at least three image groups and the object. And based on the relative position relationship, the occlusion information of the spatial point cloud of the object surface in the target image group corresponding to the spatial point cloud in the two image groups is obtained. The two image groups are two image groups other than the target image group in the at least three image groups. The occlusion information can be obtained by using methods such as reprojection, which are not specifically limited here.
步骤503,生成观测和可视化矩阵。Step 503, generate observation and visualization matrices.
图像处理设备获取遮挡信息之后,剔除两个图像组中遮挡信息对应的像素值,以获取可视化矩阵。该过程可以理解为用于减少遮挡带来的噪声。After the image processing device obtains the occlusion information, the pixel values corresponding to the occlusion information in the two image groups are removed to obtain a visualization matrix. This process can be understood as reducing the noise caused by occlusion.
另外,图像处理设备还可以基于位姿标定信息与初始化深度获取物体表面各点在至少三个视角下的观 测矩阵。该观测矩阵包括:入射光方向、反射光方向、光源强度至少三个视角下的像素观测值。In addition, the image processing device can also obtain the view of each point on the surface of the object from at least three perspectives based on the pose calibration information and the initialization depth. The measurement matrix includes: pixel observation values under at least three viewing angles: incident light direction, reflected light direction, and light source intensity.
其中,位姿标定信息包括:投影设备与相机的内参、投影设备与相机之间的外参,投影设备用于投射材质编码图案,相机用于采集至少三个图像组。Among them, the pose calibration information includes: internal parameters of the projection device and the camera, and external parameters between the projection device and the camera. The projection device is used to project the material coding pattern, and the camera is used to collect at least three image groups.
可选地,观测矩阵可以为其中,对于物体表面一点P来说,L为i视角下该点的入射光方向(也可以理解为投影设备的照射方向,即光源的照射方向),V为i视角下该点的反射光方向(也可以理解为相机的观测方向),I为i视角下相机获取到的该点处的像素观测值(也可以理解为是在i视角下,全黑图案对应的反射图像与全白图案对应的反射图像之间的像素差值)。E为i视角下该点处的光源强度。Alternatively, the observation matrix can be Among them, for a point P on the surface of the object, L is the incident light direction of the point at the i viewing angle (it can also be understood as the irradiation direction of the projection device, that is, the irradiation direction of the light source), V is the reflected light direction of the point at the i viewing angle (it can also be understood as the observation direction of the camera), I is the pixel observation value at the point obtained by the camera at the i viewing angle (it can also be understood as the pixel difference between the reflected image corresponding to the all-black pattern and the reflected image corresponding to the all-white pattern at the i viewing angle). E is the light source intensity at the point at the i viewing angle.
图像处理设备获取可视化矩阵与观测矩阵之后,可以基于可视化矩阵与观测矩阵确定参数信息(如下述步骤504至步骤506所示)。该参数信息包括:材质贴图参数和/或几何结构参数,几何结构参数包括优化后的深度或初始化深度。其中,在几何结构参数包括初始化深度的情况下,本实施例可以理解为获取材质贴图参数。在几何结构参数包括优化后的深度的情况下,本实施例可以理解为优化物体的几何结构参数。After the image processing device obtains the visualization matrix and the observation matrix, the parameter information can be determined based on the visualization matrix and the observation matrix (as shown in steps 504 to 506 below). The parameter information includes: material mapping parameters and/or geometric structure parameters, and the geometric structure parameters include optimized depth or initialized depth. Wherein, in the case where the geometric structure parameters include the initialized depth, this embodiment can be understood as obtaining material mapping parameters. In the case where the geometric structure parameters include the optimized depth, this embodiment can be understood as optimizing the geometric structure parameters of the object.
步骤504,建立能量函数。Step 504: Establish an energy function.
图像处理设备基于可视化矩阵与观测矩阵构建能量函数,能量函数用于表示物体表面各点的估计值与观测值之间的差异,估计值与可视化矩阵相关,观测值与观测矩阵相关。The image processing device constructs an energy function based on the visualization matrix and the observation matrix. The energy function is used to represent the difference between the estimated value and the observed value of each point on the surface of the object. The estimated value is related to the visualization matrix, and the observed value is related to the observation matrix.
可选地,能量函数如公式一所示:Optionally, the energy function is as shown in Formula 1:
公式一: Formula 1:
其中,材质贴图参数包括为优化后的漫反射变量;为优化后的镜面反射变量;为优化后的粗糙度;z*为优化后的几何结构参数;为物体表面任意一点在不同视角下的估计值,估计值的计算方式如公式二所示,Ii为相机获取到的任意一点在任意一视角下的观测值;i为不同视角的数量;E为正则项。Among them, the material mapping parameters include is the optimized diffuse reflection variable; is the optimized specular reflection variable; is the optimized roughness; z * is the optimized geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles. The calculation method of the estimated value is shown in Formula 2, where I i is the observation value of any point obtained by the camera at any viewing angle; i is the number of different viewing angles; and E is the regularization term.
可选地,该正则项包括法向量、深度、材质等对应的正则项,具体此处不做限定。Optionally, the regularization term includes regularization terms corresponding to normal vectors, depths, materials, etc., which are not specifically limited here.
公式二: Formula 2:
其中,Ei为任意一点在任一视角下的光源强度,d为任意一点到投影仪之间的距离,f()为反射特性函数,反射特性函数如公式三所示,n为任意一点的表面法向量,li为任意一点在任意一视角下的入射光方向,vi为任意一点在任意一视角下的反射光方向;Wherein, E i is the light source intensity at any point at any viewing angle, d is the distance between any point and the projector, f() is the reflection characteristic function, and the reflection characteristic function is shown in Formula 3, n is the surface normal vector of any point, l i is the incident light direction at any point at any viewing angle, and vi is the reflected light direction at any point at any viewing angle;
公式三: Formula 3:
其中,为初始漫反射变量;为初始镜面反射变量;rs为初始粗糙度;D()表示微平面分布函数,用于表达微平面斜率的变化,G()表示几何衰减系数。微平面上的入射光,在到达一个表面之前或被该表面反射之后,可能会被相邻的微平面阻挡,这种阻挡会造成镜面反射的轻微昏暗,可以用几何衰减系数来衡量这种影响。in, is the initial diffuse reflectance variable; is the initial specular reflection variable; rs is the initial roughness; D() represents the microfacet distribution function, which is used to express the change of microfacet slope; G() represents the geometric attenuation coefficient. The incident light on the microfacet may be blocked by the adjacent microfacets before reaching a surface or after being reflected by the surface. This blocking will cause a slight dimming of the specular reflection, and the geometric attenuation coefficient can be used to measure this effect.
可以理解的是,上述公式一、公式二和/或公式三只是举例,在实际应用中,上述公式一、公式二和/或公式三还可以是其他方式,具体此处不做限定。It can be understood that the above formula 1, formula 2 and/or formula 3 are just examples. In practical applications, the above formula 1, formula 2 and/or formula 3 can also be other forms, which are not specifically limited here.
步骤505,能量函数最小化。Step 505: Minimize the energy function.
图像处理设备构建能量函数之后,可以最小化能量函数的值以获取物体的参数信息。还参数信息包括:材质贴图参数和/或几何结构参数,几何结构参数包括优化后的深度或初始化深度。其中,在几何结构参数包括初始化深度的情况下,本实施例可以理解为获取材质贴图参数。在几何结构参数包括优化后的深度的情况下,本实施例可以理解为优化物体的几何结构参数。After the image processing device constructs the energy function, the value of the energy function can be minimized to obtain parameter information of the object. The parameter information also includes: material mapping parameters and/or geometric structure parameters, and the geometric structure parameters include optimized depth or initialized depth. Among them, when the geometric structure parameters include the initialized depth, this embodiment can be understood as obtaining material mapping parameters. When the geometric structure parameters include the optimized depth, this embodiment can be understood as optimizing the geometric structure parameters of the object.
在一种可能实现的方式中,参数信息可以包括上述的该种情况下的z*为初始深度Z,即初 始深度是定值,材质贴图参数为待优化的参数。In a possible implementation, the parameter information may include the above In this case, z * is the initial depth Z, i.e. The initial depth is a fixed value, and the material mapping parameters are the parameters to be optimized.
在另一种可能实现的方式中,参数信息可以包括上述的z*。该种情况下的rs为预设值,即材质贴图参数是定值,几何结构参数为待优化的参数。In another possible implementation, the parameter information may include the above-mentioned z * . for r s is the preset value, that is, the material mapping parameters are fixed values, and the geometric structure parameters are the parameters to be optimized.
在另一种可能实现的方式中,参数信息可以包括上述的z*,该种情况下可以理解为材质贴图参数与几何结构参数都为待优化的参数。In another possible implementation, the parameter information may include the above z * , In this case, it can be understood that both the material mapping parameters and the geometric structure parameters are parameters to be optimized.
可选地,初始深度/优化后的深度可以用于生成法向贴图,初始或优化后的漫反射变量用于生成漫反射贴图,初始或优化后的镜面反射变量用于生成镜面反射贴图,初始或优化后的粗糙度用于生成粗糙度贴图。Optionally, the initial depth/optimized depth can be used to generate a normal map, the initial or optimized diffuse variables can be used to generate a diffuse map, the initial or optimized specular variables can be used to generate a specular map, and the initial or optimized roughness can be used to generate a roughness map.
步骤506,收敛判定。Step 506: Convergence determination.
最小化能量函数的值的过程中,判定是否满足收敛条件。若满足,结束最小化能量函数,输出最优解。若不满足,重复执行步骤502至步骤506,直至满足收敛条件。其中,该收敛条件包括以下至少一种:重复次数为第一预设阈值、能量函数的值小于第二预设阈值等。In the process of minimizing the value of the energy function, determine whether the convergence condition is met. If so, end the minimization of the energy function and output the optimal solution. If not, repeat steps 502 to 506 until the convergence condition is met. The convergence condition includes at least one of the following: the number of repetitions is a first preset threshold, the value of the energy function is less than a second preset threshold, etc.
可以理解的是,对于主视角下物体的参数信息计算结束后。可以重新选择一个视角作为主视角重复执行上述过程。最终获取多个视角下物体的参数信息。进而根据融合拼接等处理实现物体材质贴图的生成。It is understandable that after the calculation of the parameter information of the object under the main viewing angle is completed, a new viewing angle can be selected as the main viewing angle to repeat the above process, and finally the parameter information of the object under multiple viewing angles is obtained. Then, the object material map is generated according to the fusion splicing and other processing.
本申请实施例中,通过物体表面在至少三个视角下针对于材质编码图案反射得到的至少三个图像组,基于该至少三个图像组与物体表面的初始深度生成参数信息,参数信息包括材质贴图参数和/或几何结构参数。一方面,在无需额外增加光源的前提下,通过改变结构光的编码策略,将投影设备变为一个光源,可以支持PBR材质贴图输出。另一方面,材质贴图包括漫反射贴图、镜面反射贴图、粗糙度贴图和法向贴图,支持PBR渲染。另一方面,上述材质建模和求解算法可用于手机端材质测量,为现有基于手机端的三维重建算法提供材质建模方案,支持手机端的材质输出功能。In an embodiment of the present application, at least three image groups are obtained by reflecting the material coding pattern on the surface of an object at least three viewing angles, and parameter information is generated based on the initial depth of the at least three image groups and the surface of the object, and the parameter information includes material mapping parameters and/or geometric structure parameters. On the one hand, without adding additional light sources, by changing the coding strategy of the structured light, the projection device is changed into a light source, which can support PBR material mapping output. On the other hand, the material map includes diffuse reflection map, specular reflection map, roughness map and normal map, which supports PBR rendering. On the other hand, the above-mentioned material modeling and solution algorithm can be used for mobile phone material measurement, providing a material modeling solution for the existing mobile phone-based three-dimensional reconstruction algorithm, and supporting the material output function of the mobile phone.
为了更加直观看出,本申请实施例提供的图像处理方法的有益效果,下面以重建花瓶为示例,对使用现有技术与本申请提供的图像处理方法对花瓶的重建结果进行示例性描述。In order to more intuitively show the beneficial effects of the image processing method provided in the embodiment of the present application, the reconstruction of a vase is taken as an example below to exemplarily describe the reconstruction results of the vase using the prior art and the image processing method provided in the present application.
其中,物体为如图6中(a)所示的花瓶的实物图,图6中(b)为该物体的几何结构图。图7中(a)为现有技术生成的纹理贴图,图7中(b)为现有技术中纹理贴图的重建结果。图8中(a)为通过本申请实施例方法所获取的材质贴图,图8中(b)为本申请实施例方法所获取的材质贴图的重建结果。通过比较发现,现有基于纹理的重建结果无法正确分离漫反射和高光分量,导致基于纹理贴图的重建结果中存在高光噪声,且不支持PBR渲染。本申请实施例提供的图像处理方法可有效地生成PBR材质贴图,获取高真实感的重建结果,减少高光噪声。Among them, the object is a physical picture of a vase as shown in Figure 6 (a), and Figure 6 (b) is a geometric structure diagram of the object. Figure 7 (a) is a texture map generated by the prior art, and Figure 7 (b) is the reconstruction result of the texture map in the prior art. Figure 8 (a) is a material map obtained by the method of the embodiment of the present application, and Figure 8 (b) is the reconstruction result of the material map obtained by the method of the embodiment of the present application. Through comparison, it is found that the existing texture-based reconstruction results cannot correctly separate the diffuse reflection and highlight components, resulting in highlight noise in the reconstruction results based on texture maps, and does not support PBR rendering. The image processing method provided in the embodiment of the present application can effectively generate PBR material maps, obtain highly realistic reconstruction results, and reduce highlight noise.
另外,本申请实施例还提供了一种系统硬件。该系统硬件如图9所示,该系统硬件包括:转台单元、控制单元、打光单元、传感器单元、存储单元和计算单元。在采集过程中,首先由控制单元发出触发信号使投影仪投射特定编码图案,通过投影仪触发相机拍照获取相应图像,并上传到存储单元。一次扫描完成后,由控制单元控制转台转动特定角度,重复上述图像采集过程至预设次数;完整扫描完成后,由计算单元完成物体参数信息(即包括几何结构和svBRDF)的计算。In addition, the embodiment of the present application also provides a system hardware. The system hardware is shown in Figure 9, and the system hardware includes: a turntable unit, a control unit, a lighting unit, a sensor unit, a storage unit and a computing unit. During the acquisition process, the control unit first sends a trigger signal to enable the projector to project a specific coded pattern, and the projector triggers the camera to take pictures to obtain the corresponding image, and upload it to the storage unit. After one scan is completed, the control unit controls the turntable to rotate to a specific angle, and repeats the above image acquisition process to a preset number of times; after the complete scan is completed, the computing unit completes the calculation of the object parameter information (i.e., including the geometric structure and svBRDF).
其中,转台单元可以包括转台与电源。控制单元可以包括中央处理器(central processing unit,CPU)与缓存。灯光单元包括电源与投影仪。传感器单元包括相机与传输线。存储单元包括缓存与外部存储。计算单元包括CPU、图形处理器(graphics processing unit,GPU)、缓存以及传输线。The turntable unit may include a turntable and a power supply. The control unit may include a central processing unit (CPU) and a cache. The lighting unit includes a power supply and a projector. The sensor unit includes a camera and a transmission line. The storage unit includes a cache and an external storage. The computing unit includes a CPU, a graphics processing unit (GPU), a cache and a transmission line.
上面对本申请实施例中的图像处理方法进行了描述,下面对本申请实施例中的图像处理设备进行描述,请参阅图10,本申请实施例中图像处理设备的一个实施例包括:The image processing method in the embodiment of the present application is described above. The image processing device in the embodiment of the present application is described below. Please refer to FIG. 10. An embodiment of the image processing device in the embodiment of the present application includes:
获取单元1001,用于获取至少三个图像组,至少三个图像组为物体表面在至少三个视角下针对于材质编码图案的反射图像;An acquisition unit 1001 is used to acquire at least three image groups, where the at least three image groups are reflection images of the object surface at at least three viewing angles with respect to the material coding pattern;
获取单元1001,还用于获取至少三个图像组中任意一个图像组对应物体表面的初始深度;The acquisition unit 1001 is further used to acquire an initial depth of the object surface corresponding to any one of the at least three image groups;
生成单元1002,用于基于至少三个图像组与初始深度生成物体的参数信息,参数信息包括材质贴图参 数和/或几何结构参数。A generating unit 1002 is used to generate parameter information of an object based on at least three image groups and an initial depth, wherein the parameter information includes material map parameters. number and/or geometric parameters.
可选地,该图像处理设备应用于结构光系统,结构光系统包括相机、投影设备、旋转设备以及与旋转设备连接的物体,旋转设备用于多次转动以使得物体位于至少三个视角;Optionally, the image processing device is applied to a structured light system, the structured light system comprising a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device being used to rotate multiple times so that the object is located at at least three viewing angles;
可选地,获取单元1001,具体用于在至少三个视角的每个视角下触发投影设备向物体投射材质编码图案;获取单元1001,具体用于在每个视角下触发相机采集物体针对于材质编码图案反射的图像组,以获取至少三个图像组。Optionally, the acquisition unit 1001 is specifically used to trigger the projection device to project a material coding pattern onto the object at each of at least three viewing angles; the acquisition unit 1001 is specifically used to trigger the camera to capture an image group reflected by the object for the material coding pattern at each viewing angle to obtain at least three image groups.
可选地,材质编码图案包括全黑图案与全白图案。Optionally, the material coding pattern includes an all-black pattern and an all-white pattern.
可选地,生成单元1002,具体用于获取目标图像组中物体表面的空间点云在两个图像组中对应空间点云的遮挡信息,任意一个图像组为目标图像组,两个图像组为至少三个图像组中除了目标图像组以外的两个图像组;生成单元1002,具体用于剔除两个图像组中遮挡信息对应的像素值,以获取可视化矩阵;生成单元1002,具体用于基于位姿标定信息与初始化深度获取物体表面各点在至少三个视角下的观测矩阵,观测矩阵包括:入射光方向、反射光方向、光源强度至少三个视角下的像素观测值,位姿标定信息包括:投影设备与相机的内参、投影设备与相机之间的外参,投影设备用于投射材质编码图案,相机用于采集至少三个图像组;生成单元1002,具体用于基于可视化矩阵与观测矩阵确定参数信息。Optionally, the generation unit 1002 is specifically used to obtain the occlusion information of the spatial point cloud on the surface of the object in the target image group corresponding to the spatial point cloud in the two image groups, any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group in at least three image groups; the generation unit 1002 is specifically used to eliminate the pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix; the generation unit 1002 is specifically used to obtain the observation matrix of each point on the surface of the object under at least three viewing angles based on the pose calibration information and the initialization depth, the observation matrix including: the pixel observation values under at least three viewing angles of the incident light direction, the reflected light direction, and the light source intensity, the pose calibration information including: the intrinsic parameters of the projection device and the camera, the extrinsic parameters between the projection device and the camera, the projection device is used to project the material coding pattern, and the camera is used to collect at least three image groups; the generation unit 1002 is specifically used to determine the parameter information based on the visualization matrix and the observation matrix.
可选地,生成单元1002,具体用于基于可视化矩阵与观测矩阵构建能量函数,能量函数用于表示物体表面各点的估计值与观测值之间的差异,估计值与可视化矩阵相关,观测值与观测矩阵相关;Optionally, the generating unit 1002 is specifically used to construct an energy function based on the visualization matrix and the observation matrix, the energy function is used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value is related to the visualization matrix, and the observed value is related to the observation matrix;
可选地,生成单元1002,具体用于最小化能量函数的值以获取参数信息。Optionally, the generating unit 1002 is specifically configured to minimize the value of the energy function to obtain parameter information.
本实施例中,图像处理设备中各单元所执行的操作与前述图1至图5所示实施例中描述的类似,此处不再赘述。In this embodiment, the operations performed by each unit in the image processing device are similar to those described in the embodiments shown in the above-mentioned Figures 1 to 5, and will not be repeated here.
本实施例中,一方面,在无需额外增加光源的前提下,通过改变结构光的编码策略,将投影设备变为一个光源,可以支持PBR材质贴图输出。另一方面,材质贴图包括漫反射贴图、镜面反射贴图、粗糙度贴图和法向贴图,支持PBR渲染。另一方面,上述材质建模和求解算法可用于手机端材质测量,为现有基于手机端的三维重建算法提供材质建模方案,支持手机端的材质输出功能。In this embodiment, on the one hand, without adding additional light sources, by changing the coding strategy of structured light, the projection device is turned into a light source, which can support PBR material map output. On the other hand, the material map includes diffuse reflection map, specular reflection map, roughness map and normal map, which supports PBR rendering. On the other hand, the above-mentioned material modeling and solution algorithm can be used for mobile phone material measurement, providing a material modeling solution for the existing mobile phone-based 3D reconstruction algorithm, and supporting the material output function of the mobile phone.
参阅图11,本申请提供的另一种图像处理设备的结构示意图。该图像处理设备可以包括处理器1101、存储器1102和通信端口1103。该处理器1101、存储器1102和通信端口1103通过线路互联。其中,存储器1102中存储有程序指令和数据。Referring to FIG. 11 , a schematic diagram of the structure of another image processing device provided by the present application. The image processing device may include a processor 1101, a memory 1102, and a communication port 1103. The processor 1101, the memory 1102, and the communication port 1103 are interconnected via a line. The memory 1102 stores program instructions and data.
存储器1102中存储了前述图1至图5所示对应的实施方式中,由图像处理设备执行的步骤对应的程序指令以及数据。The memory 1102 stores program instructions and data corresponding to the steps executed by the image processing device in the corresponding implementation modes shown in the aforementioned FIGS. 1 to 5 .
处理器1101,用于执行前述图1至图5所示实施例中任一实施例所示的由图像处理设备执行的步骤。The processor 1101 is used to execute the steps performed by the image processing device shown in any of the embodiments shown in Figures 1 to 5 above.
通信端口1103可以用于进行数据的接收和发送,用于执行前述图1至图5所示实施例中任一实施例中与获取、发送、接收相关的步骤。The communication port 1103 can be used to receive and send data, and to execute the steps related to acquisition, sending, and receiving in any of the embodiments shown in FIG. 1 to FIG. 5 .
一种实现方式中,图像处理设备可以包括相对于图11更多或更少的部件,本申请对此仅仅是示例性说明,并不作限定。In one implementation, the image processing device may include more or fewer components than those in FIG. 11 , and this application is merely an illustrative description and is not intended to be limiting.
本申请实施例还提供一种存储一个或多个计算机执行指令的计算机可读存储介质,当计算机执行指令被处理器执行时,该处理器执行如前述实施例中图像处理设备可能的实现方式所述的方法。An embodiment of the present application further provides a computer-readable storage medium storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the method described in the possible implementation manner of the image processing device in the aforementioned embodiment.
本申请实施例还提供一种存储一个或多个计算机的计算机程序产品(或称计算机程序),当计算机程序产品被该处理器执行时,该处理器执行上述图像处理设备可能实现方式的方法。An embodiment of the present application also provides a computer program product (or computer program) storing one or more computers. When the computer program product is executed by the processor, the processor executes the method of the possible implementation mode of the above-mentioned image processing device.
本申请实施例还提供了一种芯片系统,该芯片系统包括至少一个处理器,用于支持终端设备实现上述图像处理设备可能的实现方式中所涉及的功能。可选的,所述芯片系统还包括接口电路,所述接口电路为所述至少一个处理器提供程序指令和/或数据。在一种可能的设计中,该芯片系统还可以包括存储器,存储器,用于保存该图像处理设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。The embodiment of the present application also provides a chip system, which includes at least one processor for supporting a terminal device to implement the functions involved in the possible implementation of the above-mentioned image processing device. Optionally, the chip system also includes an interface circuit, which provides program instructions and/or data for the at least one processor. In one possible design, the chip system may also include a memory, which is used to store the necessary program instructions and data for the image processing device. The chip system may be composed of chips, or may include chips and other discrete devices.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。 Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。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.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,read-only memory)、随机存取存储器(RAM,random access memory)、磁碟或者光盘等各种可以存储程序代码的介质。 If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims (17)

  1. 一种图像处理方法,其特征在于,所述方法包括:An image processing method, characterized in that the method comprises:
    获取至少三个图像组,所述至少三个图像组为物体表面在至少三个视角下针对于材质编码图案的反射图像;所述至少三个图像组与所述至少三个视角一一对应;Acquire at least three image groups, wherein the at least three image groups are reflection images of the object surface with respect to the material coding pattern at at least three viewing angles; the at least three image groups correspond one-to-one to the at least three viewing angles;
    获取所述至少三个图像组中任意一个图像组对应物体表面的初始深度;Acquire an initial depth of the object surface corresponding to any one of the at least three image groups;
    基于所述至少三个图像组与所述初始深度生成所述物体的参数信息,所述参数信息包括材质贴图参数和/或几何结构参数。Parameter information of the object is generated based on the at least three image groups and the initial depth, where the parameter information includes material mapping parameters and/or geometric structure parameters.
  2. 根据权利要求1所述的方法,其特征在于,所述方法应用于结构光系统,所述结构光系统包括相机、投影设备、旋转设备以及与所述旋转设备连接的物体,所述旋转设备用于多次转动以使得所述物体位于所述至少三个视角;The method according to claim 1, characterized in that the method is applied to a structured light system, the structured light system comprising a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device being used to rotate multiple times so that the object is located at the at least three viewing angles;
    所述获取至少三个图像组,包括:The acquiring of at least three image groups comprises:
    在所述至少三个视角的每个视角下触发所述投影设备向所述物体投射材质编码图案;triggering the projection device to project a material coding pattern onto the object at each of the at least three viewing angles;
    在所述每个视角下触发所述相机采集所述物体针对于所述材质编码图案反射的图像组,以获取所述至少三个图像组;triggering the camera to collect an image group reflected by the object with respect to the material coding pattern at each viewing angle to obtain the at least three image groups;
    所述初始深度由所述投影设备向所述物体投射结构光编码图案的方式得到。The initial depth is obtained by projecting a structured light coding pattern onto the object by the projection device.
  3. 根据权利要求1或2所述的方法,其特征在于,所述材质编码图案包括全黑图案与全白图案,所述至少三个图像组中的每个图像组包括两张反射图像。The method according to claim 1 or 2 is characterized in that the material coding pattern includes a full black pattern and a full white pattern, and each of the at least three image groups includes two reflection images.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述基于所述至少三个图像与所述初始深度生成所述物体的参数信息,包括:The method according to any one of claims 1 to 3, characterized in that the generating the parameter information of the object based on the at least three images and the initial depth comprises:
    获取目标图像组中所述物体表面的空间点云在两个图像组中对应空间点云的遮挡信息,所述任意一个图像组为所述目标图像组,所述两个图像组为所述至少三个图像组中除了所述目标图像组以外的两个图像组;Obtaining occlusion information of the spatial point cloud of the surface of the object in the target image group and corresponding spatial point clouds in two image groups, wherein any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group among the at least three image groups;
    剔除所述两个图像组中所述遮挡信息对应的像素值,以获取可视化矩阵;Eliminating pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix;
    基于位姿标定信息与所述初始化深度获取所述物体表面各点在所述至少三个视角下的观测矩阵,所述观测矩阵包括:入射光方向、反射光方向、光源强度所述至少三个视角下的像素观测值,所述位姿标定信息包括:投影设备与相机的内参、所述投影设备与所述相机之间的外参,所述投影设备用于投射所述材质编码图案,所述相机用于采集所述至少三个图像组;Based on the pose calibration information and the initialization depth, an observation matrix of each point on the surface of the object under the at least three viewing angles is obtained, wherein the observation matrix includes: the incident light direction, the reflected light direction, and the pixel observation values of the light source intensity under the at least three viewing angles; the pose calibration information includes: the intrinsic parameters of the projection device and the camera, and the extrinsic parameters between the projection device and the camera; the projection device is used to project the material coding pattern, and the camera is used to collect the at least three image groups;
    基于所述可视化矩阵与所述观测矩阵确定所述参数信息。The parameter information is determined based on the visualization matrix and the observation matrix.
  5. 根据权利要求4所述的方法,其特征在于,所述基于所述可视化矩阵与所述观测矩阵确定所述参数信息,包括:The method according to claim 4, characterized in that the determining the parameter information based on the visualization matrix and the observation matrix comprises:
    基于所述可视化矩阵与所述观测矩阵构建能量函数,所述能量函数用于表示所述物体表面各点的估计值与观测值之间的差异,所述估计值与所述可视化矩阵相关,所述观测值与所述观测矩阵相关;constructing an energy function based on the visualization matrix and the observation matrix, the energy function being used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value being related to the visualization matrix, and the observed value being related to the observation matrix;
    最小化所述能量函数的值以获取所述参数信息。The value of the energy function is minimized to obtain the parameter information.
  6. 根据权利要求5所述的方法,其特征在于,所述参数信息包括:所述材质贴图参数和/或所述几何结构参数,所述几何结构参数包括优化后的深度或所述初始化深度;所述能量函数如公式一所示:
    公式一:
    The method according to claim 5, characterized in that the parameter information includes: the material mapping parameters and/or the geometric structure parameters, the geometric structure parameters include the optimized depth or the initialized depth; the energy function is as shown in Formula 1:
    Formula 1:
    其中,所述材质贴图参数包括为漫反射变量;为镜面反射变量;为粗糙度;z*为所述几何结构参数;为所述物体表面任意一点在不同视角下的所述估计值,所述估计值的计算方式如公式二所示,Ii为所述相机获取到的所述任意一点在任意一视角下的观测值;i为所述不同视角的数量; E为正则项;
    公式二:
    The material mapping parameters include is the diffuse reflection variable; is the specular reflection variable; is the roughness; z * is the geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles, and the calculation method of the estimated value is shown in Formula 2, where I i is the observation value of any point at any viewing angle obtained by the camera; i is the number of different viewing angles; E is the regularization term;
    Formula 2:
    其中,Ei为所述任意一点在任一视角下的光源强度,d为所述任意一点到所述投影仪之间的距离,f()为反射特性函数,所述反射特性函数如公式三所示所示,n为所述任意一点的表面法向量,li为所述任意一点在所述任意一视角下的入射光方向,vi为所述任意一点在所述任意一视角下的反射光方向;
    公式三:
    Wherein, E i is the light source intensity of any point at any viewing angle, d is the distance between any point and the projector, f() is the reflection characteristic function, and the reflection characteristic function is shown in Formula 3, n is the surface normal vector of any point, l i is the incident light direction of any point at any viewing angle, and vi is the reflected light direction of any point at any viewing angle;
    Formula 3:
    其中,为初始漫反射变量;为初始镜面反射变量;rs为初始粗糙度;D()表示微平面分布函数,G()表示几何衰减系数。in, is the initial diffuse reflectance variable; is the initial specular reflection variable; rs is the initial roughness; D() represents the microfacet distribution function, and G() represents the geometric attenuation coefficient.
  7. 一种图像处理设备,其特征在于,所述图像处理设备包括:An image processing device, characterized in that the image processing device comprises:
    获取单元,用于获取至少三个图像组,所述至少三个图像组为物体表面在至少三个视角下针对于材质编码图案的反射图像;所述至少三个图像组与所述至少三个视角一一对应;An acquisition unit, configured to acquire at least three image groups, wherein the at least three image groups are reflection images of the object surface with respect to the material coding pattern at at least three viewing angles; the at least three image groups correspond one-to-one to the at least three viewing angles;
    所述获取单元,还用于获取所述至少三个图像组中任意一个图像组对应物体表面的初始深度;The acquisition unit is further used to acquire an initial depth of the object surface corresponding to any one of the at least three image groups;
    生成单元,用于基于所述至少三个图像组与所述初始深度生成所述物体的参数信息,所述参数信息包括材质贴图参数和/或几何结构参数。A generating unit is used to generate parameter information of the object based on the at least three image groups and the initial depth, wherein the parameter information includes material mapping parameters and/or geometric structure parameters.
  8. 根据权利要求7所述的图像处理设备,其特征在于,所述图像处理设备应用于结构光系统,所述结构光系统包括相机、投影设备、旋转设备以及与所述旋转设备连接的物体,所述旋转设备用于多次转动以使得所述物体位于所述至少三个视角;The image processing device according to claim 7, characterized in that the image processing device is applied to a structured light system, the structured light system comprises a camera, a projection device, a rotating device, and an object connected to the rotating device, the rotating device is used to rotate multiple times so that the object is located in the at least three viewing angles;
    所述获取单元,具体用于在所述至少三个视角的每个视角下触发所述投影设备向所述物体投射材质编码图案;The acquisition unit is specifically configured to trigger the projection device to project a material coding pattern onto the object at each of the at least three viewing angles;
    所述获取单元,具体用于在所述每个视角下触发所述相机采集所述物体针对于所述材质编码图案反射的图像组,以获取所述至少三个图像组;The acquisition unit is specifically configured to trigger the camera to collect an image group reflected by the object with respect to the material coding pattern at each viewing angle, so as to acquire the at least three image groups;
    所述初始深度由所述投影设备向所述物体投射结构光编码图案的方式得到。The initial depth is obtained by projecting a structured light coding pattern onto the object by the projection device.
  9. 根据权利要求7或8所述的图像处理设备,其特征在于,所述材质编码图案包括全黑图案与全白图案,所述至少三个图像组中的每个图像组包括两张反射图像。The image processing device according to claim 7 or 8 is characterized in that the material coding pattern includes a full black pattern and a full white pattern, and each of the at least three image groups includes two reflection images.
  10. 根据权利要求7至9中任一项所述的图像处理设备,其特征在于,所述生成单元,具体用于获取目标图像组中所述物体表面的空间点云在两个图像组中对应空间点云的遮挡信息,所述任意一个图像组为所述目标图像组,所述两个图像组为所述至少三个图像组中除了所述目标图像组以外的两个图像组;The image processing device according to any one of claims 7 to 9, characterized in that the generating unit is specifically used to obtain occlusion information of the spatial point cloud of the surface of the object in the target image group and the corresponding spatial point cloud in two image groups, wherein any one of the image groups is the target image group, and the two image groups are two image groups other than the target image group among the at least three image groups;
    所述生成单元,具体用于剔除所述两个图像组中所述遮挡信息对应的像素值,以获取可视化矩阵;The generating unit is specifically used to remove the pixel values corresponding to the occlusion information in the two image groups to obtain a visualization matrix;
    所述生成单元,具体用于基于位姿标定信息与所述初始化深度获取所述物体表面各点在所述至少三个视角下的观测矩阵,所述观测矩阵包括:入射光方向、反射光方向、光源强度所述至少三个视角下的像素观测值,所述位姿标定信息包括:投影设备与相机的内参、所述投影设备与所述相机之间的外参,所述投影设备用于投射所述材质编码图案,所述相机用于采集所述至少三个图像组;The generation unit is specifically used to obtain the observation matrix of each point on the surface of the object under the at least three viewing angles based on the posture calibration information and the initialization depth, the observation matrix includes: the incident light direction, the reflected light direction, the pixel observation value of the light source intensity under the at least three viewing angles, the posture calibration information includes: the intrinsic parameters of the projection device and the camera, the extrinsic parameters between the projection device and the camera, the projection device is used to project the material coding pattern, and the camera is used to collect the at least three image groups;
    所述生成单元,具体用于基于所述可视化矩阵与所述观测矩阵确定所述参数信息。The generating unit is specifically configured to determine the parameter information based on the visualization matrix and the observation matrix.
  11. 根据权利要求10所述的图像处理设备,其特征在于,所述生成单元,具体用于基于所述可视化矩阵与所述观测矩阵构建能量函数,所述能量函数用于表示所述物体表面各点的估计值与观测值之间的差异,所述估计值与所述可视化矩阵相关,所述观测值与所述观测矩阵相关;The image processing device according to claim 10, characterized in that the generating unit is specifically used to construct an energy function based on the visualization matrix and the observation matrix, the energy function is used to represent the difference between the estimated value and the observed value of each point on the surface of the object, the estimated value is related to the visualization matrix, and the observed value is related to the observation matrix;
    所述生成单元,具体用于最小化所述能量函数的值以获取所述参数信息。 The generating unit is specifically used to minimize the value of the energy function to obtain the parameter information.
  12. 根据权利要求11所述的图像处理设备,其特征在于,所述参数信息包括:所述材质贴图参数和/或所述几何结构参数,所述几何结构参数包括优化后的深度或所述初始化深度;所述能量函数如公式一所示:
    公式一:
    The image processing device according to claim 11, characterized in that the parameter information includes: the material mapping parameters and/or the geometric structure parameters, the geometric structure parameters include the optimized depth or the initialized depth; the energy function is as shown in Formula 1:
    Formula 1:
    其中,所述材质贴图参数包括为漫反射变量;为镜面反射变量;为粗糙度;z*为所述几何结构参数;为所述物体表面任意一点在不同视角下的所述估计值,所述估计值的计算方式如公式二所示,Ii为所述相机获取到的所述任意一点在任意一视角下的观测值;i为所述不同视角的数量;E为正则项;
    公式二:
    The material mapping parameters include is the diffuse reflection variable; is the specular reflection variable; is the roughness; z * is the geometric structure parameter; is the estimated value of any point on the surface of the object at different viewing angles, and the calculation method of the estimated value is shown in Formula 2, where I i is the observation value of any point at any viewing angle obtained by the camera; i is the number of different viewing angles; and E is a regularization term;
    Formula 2:
    其中,Ei为所述任意一点在任一视角下的光源强度,d为所述任意一点到所述投影仪之间的距离,f()为反射特性函数,所述反射特性函数如公式三所示所示,n为所述任意一点的表面法向量,li为所述任意一点在所述任意一视角下的入射光方向,vi为所述任意一点在所述任意一视角下的反射光方向;
    公式三:
    Wherein, E i is the light source intensity of any point at any viewing angle, d is the distance between any point and the projector, f() is the reflection characteristic function, and the reflection characteristic function is shown in Formula 3, n is the surface normal vector of any point, l i is the incident light direction of any point at any viewing angle, and vi is the reflected light direction of any point at any viewing angle;
    Formula 3:
    其中,为初始漫反射变量;为初始镜面反射变量;rs为初始粗糙度;D()表示微平面分布函数,G()表示几何衰减系数。in, is the initial diffuse reflectance variable; is the initial specular reflection variable; rs is the initial roughness; D() represents the microfacet distribution function, and G() represents the geometric attenuation coefficient.
  13. 一种结构光系统,其特征在于,所述结构光系统包括:相机、投影设备、旋转设备以及物体;A structured light system, characterized in that the structured light system comprises: a camera, a projection device, a rotating device and an object;
    所述相机,用于采集所述物体在不同视角下针对于材质编码图案的反射图像,所述材质编码图案用于获取所述物体的材质贴图参数;The camera is used to collect reflection images of the object at different viewing angles with respect to the material coding pattern, and the material coding pattern is used to obtain material mapping parameters of the object;
    所述投影设备,用于向所述物体的表面投射所述材质编码图案;The projection device is used to project the material coding pattern onto the surface of the object;
    所述旋转设备,用于旋转所述物体,以实现所述物体位于所述不同视角。The rotating device is used to rotate the object so that the object is located at the different viewing angles.
  14. 根据权利要求13所述的结构光系统,其特征在于,所述材质编码图案包括全黑图案与全白图案,所述不同视角中每个视角下的反射图像数量为两个。The structured light system according to claim 13, characterized in that the material coding pattern includes an all-black pattern and an all-white pattern, and the number of reflected images at each of the different viewing angles is two.
  15. 一种图像处理设备,其特征在于,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得所述图像处理设备执行如权利要求1至6中任一项所述的方法。An image processing device, characterized in that it comprises: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the image processing device executes the method as described in any one of claims 1 to 6.
  16. 一种计算机可读存储介质,其特征在于,所述介质存储有指令,当所述指令被计算机执行时,实现权利要求1至6中任一项所述的方法。A computer-readable storage medium, characterized in that the medium stores instructions, and when the instructions are executed by a computer, the method according to any one of claims 1 to 6 is implemented.
  17. 一种计算机程序产品,其特征在于,包括指令,当所述指令在计算机上运行时,使得计算机执行如权利要求1至6中任一项所述的方法。 A computer program product, characterized in that it comprises instructions, and when the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 6.
PCT/CN2023/103013 2022-10-31 2023-06-28 Image processing method, related device, and structured light system WO2024093282A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211349694.0A CN117994348A (en) 2022-10-31 2022-10-31 Image processing method, related equipment and structured light system
CN202211349694.0 2022-10-31

Publications (1)

Publication Number Publication Date
WO2024093282A1 true WO2024093282A1 (en) 2024-05-10

Family

ID=90893118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/103013 WO2024093282A1 (en) 2022-10-31 2023-06-28 Image processing method, related device, and structured light system

Country Status (2)

Country Link
CN (1) CN117994348A (en)
WO (1) WO2024093282A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100315490A1 (en) * 2009-06-15 2010-12-16 Electronics And Telecommunications Research Institute Apparatus and method for generating depth information
US20120237112A1 (en) * 2011-03-15 2012-09-20 Ashok Veeraraghavan Structured Light for 3D Shape Reconstruction Subject to Global Illumination
CN108985333A (en) * 2018-06-15 2018-12-11 浙江大学 A kind of material acquisition methods neural network based and system
CN110570503A (en) * 2019-09-03 2019-12-13 浙江大学 Method for acquiring normal vector, geometry and material of three-dimensional object based on neural network
US20200074698A1 (en) * 2018-08-30 2020-03-05 Cognex Corporation Methods and apparatus for generating a three-dimensional reconstruction of an object with reduced distortion
WO2022021680A1 (en) * 2020-07-28 2022-02-03 中国科学院深圳先进技术研究院 Method for reconstructing three-dimensional object by fusing structured light with photometry, and terminal device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100315490A1 (en) * 2009-06-15 2010-12-16 Electronics And Telecommunications Research Institute Apparatus and method for generating depth information
US20120237112A1 (en) * 2011-03-15 2012-09-20 Ashok Veeraraghavan Structured Light for 3D Shape Reconstruction Subject to Global Illumination
CN108985333A (en) * 2018-06-15 2018-12-11 浙江大学 A kind of material acquisition methods neural network based and system
US20200074698A1 (en) * 2018-08-30 2020-03-05 Cognex Corporation Methods and apparatus for generating a three-dimensional reconstruction of an object with reduced distortion
CN110570503A (en) * 2019-09-03 2019-12-13 浙江大学 Method for acquiring normal vector, geometry and material of three-dimensional object based on neural network
WO2022021680A1 (en) * 2020-07-28 2022-02-03 中国科学院深圳先进技术研究院 Method for reconstructing three-dimensional object by fusing structured light with photometry, and terminal device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张启灿 QICAN ZHANG: "Three-dimensional imaging technique based on Gray-coded structured illumination", INFRARED AND LASER ENGINEERING, CN, vol. 49, no. 3, 1 January 2020 (2020-01-01), CN , pages 303004 - 303004, XP093168868, ISSN: 1007-2276, DOI: 10.3788/IRLA202049.0303004 *

Also Published As

Publication number Publication date
CN117994348A (en) 2024-05-07

Similar Documents

Publication Publication Date Title
CA3074547C (en) On-set facial performance capture and transfer to a three-dimensional computer-generated model
US11115633B2 (en) Method and system for projector calibration
US8218003B2 (en) Optimization strategies for GPU view projection matrix implementation
CN108876926B (en) Navigation method and system in panoramic scene and AR/VR client equipment
US7901095B2 (en) Resolution scalable view projection
CN112116692B (en) Model rendering method, device and equipment
JP2011147125A (en) Method of calibrating projector system, program, computer system, and projector system
US7528831B2 (en) Generation of texture maps for use in 3D computer graphics
US9509905B2 (en) Extraction and representation of three-dimensional (3D) and bidirectional reflectance distribution function (BRDF) parameters from lighted image sequences
JP2003202216A (en) Method, device, system and program for three-dimensional image processing
Nomoto et al. Dynamic multi-projection mapping based on parallel intensity control
CN116664752B (en) Method, system and storage medium for realizing panoramic display based on patterned illumination
Law et al. Projector placement planning for high quality visualizations on real-world colored objects
WO2024093282A1 (en) Image processing method, related device, and structured light system
CN116485969A (en) Voxel object generation method, voxel object generation device and computer-readable storage medium
JP2001118074A (en) Method and device for producing three-dimensional image and program recording medium
US20230206567A1 (en) Geometry-aware augmented reality effects with real-time depth map
GB2584192A (en) On-set facial performance capture and transfer to a three-dimensional computer-generated model
Scopigno et al. Tutorial T1: 3D data acquisition
Bimber Multi-projector techniques for real-time visualizations in everyday environments
AU2020449562B2 (en) Geometry-aware augmented reality effects with a real-time depth map
US20230090732A1 (en) System and method for real-time ray tracing in a 3d environment
WO2023197689A1 (en) Data processing method, system, and device
Bimber Projector-based augmentation
WO2024072698A1 (en) Systems and methods for digitally representing a scene with multi-faceted primitives

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23884221

Country of ref document: EP

Kind code of ref document: A1