WO2018209886A1 - 改进的面向3d打印自定义模型立体二维码生成方法及系统 - Google Patents

改进的面向3d打印自定义模型立体二维码生成方法及系统 Download PDF

Info

Publication number
WO2018209886A1
WO2018209886A1 PCT/CN2017/106086 CN2017106086W WO2018209886A1 WO 2018209886 A1 WO2018209886 A1 WO 2018209886A1 CN 2017106086 W CN2017106086 W CN 2017106086W WO 2018209886 A1 WO2018209886 A1 WO 2018209886A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
dimensional code
stereoscopic
module
custom
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2017/106086
Other languages
English (en)
French (fr)
Inventor
吕琳
刘霖
彭昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong University
Original Assignee
Shandong University
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 Shandong University filed Critical Shandong University
Publication of WO2018209886A1 publication Critical patent/WO2018209886A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details
    • G06K19/06159Constructional details the marking being relief type, e.g. three-dimensional bar codes engraved in a support

Definitions

  • the present invention relates to the field of 3D printing, and in particular, to an improved method and system for generating a stereoscopic two-dimensional code for a 3D printed custom model.
  • Two-dimensional code also known as Quick Response Code
  • QR code uses a black and white square module to encode a large amount of information, and the device scan can quickly convey the information it contains.
  • QR code has become the most widely used automatic identification technology in the information age, and is widely used in product traceability, attraction tickets, Transportation management and conference services.
  • the existing two-dimensional code generation technology is mostly oriented to digital images.
  • 3D Printing also known as Additive Manufacturing (AM)
  • AM additive Manufacturing
  • Material manufacturing mode which constructs objects by layer-by-layer printing. Due to its innovation in manufacturing processes, it is considered to be “an important production tool for the third industrial revolution”.
  • mainstream consumer-grade 3D printers can only print materials of a single attribute, that is, only a single color can be provided. It does not satisfy the characteristics of high-contrast foreground and background colors that require high-resolution decoding.
  • the stereoscopic two-dimensional code that is expressed on any surface due to spatial distortion has a low recognition rate. Therefore, 3D using a single attribute molding material
  • the technology of printers to create stereoscopic two-dimensional codes on any three-dimensional model is not mature enough.
  • the application is suitable for printing a stereoscopic two-dimensional code by performing geometric and structural analysis on a custom three-dimensional model.
  • the target area performs a dent operation according to the result of the perspective projection transformation to generate a stereoscopic two-dimensional code made by a 3D printer of a single attribute molding material.
  • the target region used to generate the stereoscopic two-dimensional code is given by geometric and structural analysis, not completely specified by the user, and these target regions are often regions with relatively small curvature changes.
  • the stereoscopic two-dimensional code generated by the method is not easily decoded by the decoder due to insufficient color contrast between the black and white modules.
  • the present invention provides an improved 3D printing custom model stereoscopic two-dimensional code generation method, which firstly uses a perspective projection transformation to map a two-dimensional code to a target area of a custom 3D model. And performing a unified depth depression operation according to the transformation result, and then calculating the visibility of each point of the stereoscopic two-dimensional code, and according to the physics
  • the relationship between the visibility and the gray value obtained by the experiment simulates the real two-dimensional code image, and then adjusts the depth of each black module of the stereoscopic two-dimensional code according to the result of the simulation, so that the contrast between the foreground color and the background color of the two-dimensional code Enhancement, thereby increasing the decoding success rate, and finally generating a three-dimensional model including a stereoscopic two-dimensional code that can be manufactured by a 3D printer of a single attribute molding material.
  • An improved 3D printing custom model stereoscopic two-dimensional code generating method of the invention comprises:
  • the two-dimensional code is mapped to the target area of the custom 3D model by using a perspective projection transformation method
  • the physical experiment simulates the real two-dimensional code image, and calculates the overall contrast of the stereoscopic two-dimensional code and the contrast of each black module;
  • the generated 3D model containing the stereoscopic two-dimensional code is input to a 3D printer, and printed by a single material, and finally a 3D object with a stereoscopic two-dimensional code is output.
  • the method further includes:
  • the mesh of the target area of the custom 3D model is re-triangulated such that the two-dimensional code grid mapped to the target area of the 3D model is merged with the given 3D model mesh of the user.
  • the Lloyd relaxation-based resampling algorithm is used to obtain discrete sampling points on the surface of the custom 3D model, and the 3D Delaunay triangulation method is used to mesh the input custom 3D model.
  • the data of the custom 3D model after meshing is linearly transformed, and the three-dimensional coordinate components of each point on the triangular mesh of the 3D model are mapped to [0-1].
  • the specific process of mapping the two-dimensional code to the target area of the customized 3D model by using the perspective projection transformation method includes:
  • the minimum area of the target area is obtained
  • the triangular patches that intersect the target area and the ray are all deleted to obtain a three-dimensional model with holes, and then the boundary of the hole is obtained.
  • the part between the boundary of the hole and the boundary of the triangular mesh of the two-dimensional code is subjected to 2D Delaunay triangulation. Perform a re-triangulation.
  • the method further includes calculating the visibility of each point of the stereoscopic two-dimensional code, and the specific process is:
  • the 3D model is sliced to obtain a visible polygon at each layer contour of each point on the solid two-dimensional code along the perspective projection direction;
  • the ratio of the area of the integrating sphere visible at any point to the overall area of the integrating sphere gives the visibility of the current point.
  • the invention simulates a real two-dimensional code image according to the relationship between the visibility and the gray value obtained by the physical experiment, and then adjusts the depth of each black module of the stereoscopic two-dimensional code according to the result of the simulation, so that the two-dimensional code foreground color and The contrast of the background color is enhanced, thereby increasing the decoding success rate.
  • the invention also provides an improved 3D printing custom model stereoscopic two-dimensional code generation system.
  • An improved 3D printing customized model stereoscopic two-dimensional code generating system of the present invention comprises:
  • a meshing and normalization processing module for meshing and normalizing a custom 3D model
  • mapping module configured to map a two-dimensional code to a target area of a custom 3D model by using a perspective projection transformation method
  • a recessed module for performing a recess operation according to the mapping result, and generating a stereoscopic two-dimensional code having the same recess depth on the surface of the custom 3D model;
  • An optimization module configured to optimize a depth of the stereoscopic two-dimensional black module according to the simulation result, and generate a stereoscopic two-dimensional code on the surface of the custom 3D model;
  • a printing module for inputting the generated 3D model containing the stereoscopic two-dimensional code to the 3D printer, printing with a single material, and finally outputting the 3D object with the stereoscopic two-dimensional code.
  • system further includes:
  • a re-triangulation module for re-triangulating the mesh of the target area of the custom 3D model before performing the sag operation according to the mapping result, so that the two-dimensional code grid and the user mapped to the target area of the 3D model
  • the fixed 3D model meshes are merged together.
  • the meshing and normalization processing module includes:
  • a meshing module for obtaining discrete sampling points on a surface of a custom 3D model using a Lloyd relaxation-based resampling algorithm, and meshing the input custom 3D model by a 3D Delaunay triangulation method;
  • a linear transformation module for linearly transforming data of a customized three-dimensional model after meshing using a dispersion normalization method, and mapping three-dimensional coordinate components of each point on the triangular mesh of the 3D model to [0-1] between.
  • mapping module includes:
  • a minimum area calculation module of the target area which is used to obtain a minimum area of the target area according to the printing accuracy of the 3D printer;
  • a viewpoint and a view plane position determining module configured to determine a relationship of the perspective projection transformation, thereby obtaining a position of the viewpoint and the view plane;
  • a two-dimensional code triangular mesh marking module for placing a two-dimensional code on a viewing plane, and meshing each square module thereon into two triangles, emitting a series of rays from the viewpoint, and the rays pass through two
  • the vertices of the dimension grid are projected to the three-dimensional model to generate a two-dimensional code triangle mesh in the target region of the surface of the 3D model, and the two-dimensional code triangle mesh corresponding to the surface of the 3D model of the two-dimensional code black module is marked as black. Representing these triangular meshes requires a sag operation.
  • the system further includes: a visibility calculation module for assuming that only ambient light is equivalent to placing the stereoscopic two-dimensional code in the integrating sphere; and the 3D model is sliced to obtain each point on the stereoscopic two-dimensional code.
  • the visible polygon at each layer contour is intersected on each layer along the perspective projection direction; the area of the spherical polygon visible at each point on the stereoscopic QR code is obtained according to the Girard theory; the sphere sphere and the integrating sphere visible at any point The ratio of the overall area gives the visibility of the current point.
  • simulation module includes:
  • a model surface hole acquisition module is configured to divide a binary image of a preset pixel value into a plurality of regions, and map the binary image to a surface of the model through a perspective projection transformation, and then recess the corresponding depth to obtain an equal number of the divided regions.
  • the size is not Same hole
  • a visibility and gray value relationship calculation module is used to obtain the visibility of the center point of each hole and obtain the average gray value of the corresponding position from the physical model photo as the gray value of the center point, by comparing the visibility with The gray value fitting curve obtains the relationship between them;
  • a gray value calculation module for mapping the visibility of each point of the stereoscopic two-dimensional code to the gray value at the point of the stereoscopic two-dimensional code by the relationship between the visibility and the gray value, and finally obtaining the simulation
  • the true two-dimensional code image is the gray value of each pixel.
  • the present invention can specify an arbitrary target area by the user, and can still form sufficient contrast in the target area with a relatively large curvature change, and improve the decoding success rate of the stereoscopic two-dimensional code generated on any three-dimensional model, and finally generate.
  • the stereoscopic two-dimensional code is obviously superior to the two-dimensional code printed by the existing 3D technology.
  • the present invention firstly uses a perspective projection transformation to map a two-dimensional code to a target area of a custom 3D model, and performs a uniform depth depression operation according to the transformation result, and then calculates the visibility of each point of the stereoscopic two-dimensional code, and according to the physics.
  • the relationship between the visibility and the gray value obtained by the experiment simulates the real two-dimensional code image, and then adjusts the depth of each black module of the stereoscopic two-dimensional code according to the result of the simulation, so that the contrast between the foreground color and the background color of the two-dimensional code Enhancement, thereby increasing the decoding success rate, and finally generating a three-dimensional model including a stereoscopic two-dimensional code that can be manufactured by a 3D printer of a single attribute molding material.
  • the stereoscopic two-dimensional code generated by the present invention can be optimized in the depth of the recess of each black module, which greatly reduces the support structure required in the 3D printing process.
  • the present invention generates a stereoscopic two-dimensional code by using a different recess depth in a target area of an arbitrary three-dimensional model specified by the user, so that the two-dimensional code can be easily manufactured by a 3D printer of a single attribute molding material, and the attraction thereof is generated. Can bring some commercial value.
  • FIG. 1 is a flow chart of a method for generating a stereoscopic two-dimensional code for a 3D printed custom model of the present invention
  • 2 is a result diagram of mapping a common two-dimensional code to a target region of a three-dimensional model bunny by perspective projection transformation
  • 3 is a result diagram of re-triangulating the target area mesh such that the two-dimensional code grid mapped to the target area of the three-dimensional model and the user-given three-dimensional model mesh are merged;
  • FIG. 4 is a schematic diagram of a stereoscopic two-dimensional code for generating a uniform depth of a depression in a target region by perspective projection transformation
  • FIG. 5 is a schematic diagram of solving a visible polygon on each layer after a three-dimensional model slice including a stereoscopic two-dimensional code
  • Figure 6 (a) is a visible spherical polygon of each slice layer latitude and longitude coordinates of a point p' on the stereoscopic two-dimensional code
  • Figure 6 (b) is the final visible spherical polygon of the point obtained by intersecting the visible spherical polygons at the latitude and longitude coordinates of the respective slice layers at the point p';
  • Figure 7 is a diagram showing the effect of a physical experiment model obtained by a printer using a white PLA material
  • Figure 8 is a graph of visibility and gray value scatter plots and fitting curve results
  • FIG. 9 is a schematic structural diagram of an improved stereoscopic two-dimensional code generating system for a 3D printing custom model according to the present invention.
  • FIG. 10 is a schematic structural diagram of a meshing and normalization processing module
  • mapping module 11 is a schematic structural diagram of a mapping module
  • Figure 12 is a schematic structural view of an analog module.
  • the triangular dough piece is a basic unit of a triangular mesh obtained by meshing processing by triangulation, and is formed by sequentially connecting three non-collinear vertices in the space, which can be understood as a triangle, an inner region of the triangle. It is a triangular patch.
  • FIG. 1 is a flow chart of a method for generating a stereoscopic two-dimensional code for a 3D printed custom model of the present invention.
  • the improved 3D printing customized model stereoscopic two-dimensional code generating method of the present invention includes at least:
  • Step (1) Grid and normalize the custom 3D model.
  • Step (1-1) using the Lloyd relaxation-based resampling algorithm to obtain discrete sampling points on the surface of the custom 3D model, and meshing the input custom 3D model by the 3D Delaunay triangulation method;
  • Step (2) The two-dimensional code is mapped to the target area of the custom 3D model by using a perspective projection transformation method.
  • the specific process of mapping a two-dimensional code to a target area of a custom 3D model by using a perspective projection transformation method includes:
  • V is the version number of the input two-dimensional code
  • the two-dimensional code has 40 versions.
  • Version 1 is a matrix composed of 21*21 black or white square modules. After each increment of the version number, each of the two-dimensional codes Add 4 square modules to each column. The user specifies a region larger than A min on the surface of the custom 3D model as the target region.
  • the step (2-2) specifically includes the following steps:
  • the specific method of the step (2-2-2) is: experiments show that when the scanning distance and the common two-dimensional code size ratio is 10:1, most decoders can successfully decode, due to the use of a single material 3D printing of two
  • the dimension code is affected by the illumination, foreground background color contrast, etc.
  • the initial value of the ratio R can be set to 8:1, and the user can adjust accordingly according to the actual situation to calculate the distance between the target area and the view plane:
  • the specific method of the step (2-2-3) is: setting the size of the view plane to the size of the decoder identification frame, and the initial value is 4 cm*4 cm, and the user can adjust accordingly according to the actual situation, and the view plane is perpendicular to the target.
  • the normal direction of the area and the midpoint of the view plane are in the normal direction of the target area.
  • Step (2-3) placing the two-dimensional code on the viewing plane, and meshing each square module on it into two triangles, emitting a series of rays from the viewpoint, and the rays passing through the two-dimensional code grid
  • the vertex is projected onto the three-dimensional model to generate a two-dimensional code triangle mesh of the surface of the three-dimensional model in the target area, and the two-dimensional code triangle mesh corresponding to the surface of the three-dimensional model of the two-dimensional code black module is marked as black, representing the triangular mesh
  • FIG. 2 is a result diagram of mapping a common two-dimensional code to a target region of a three-dimensional model bunny by perspective projection transformation. As shown in FIG. 4, the vertices of the two-dimensional code triangle mesh of the surface of the three-dimensional model can be obtained by intersecting the radii of the two-dimensional code with the vertices of the triangle mesh of the target area. Solve The process is as follows:
  • c is the viewpoint position, which is the starting point coordinate of the ray
  • s is the coordinate of the vertices of the square module on the two-dimensional code image
  • t is the parameter in the ray equation
  • V 0 , V 1 , v 2 is the three vertices of the triangle of the target area
  • u and v are the texture coordinate values of the intersection.
  • Step (3) performing a recess operation according to the mapping result, and generating a stereoscopic two-dimensional code having the same recess depth on the surface of the custom 3D model.
  • the method before performing the recessing operation according to the mapping result, the method further includes:
  • the mesh of the target area of the custom 3D model is re-triangulated such that the two-dimensional code grid mapped to the target area of the 3D model is merged with the given 3D model mesh of the user.
  • the specific process of re-triangulating the mesh of the target area of the custom 3D model is:
  • the triangular patches that intersect the target area and the ray are all deleted to obtain a three-dimensional model with holes, and then the boundary of the hole is obtained.
  • the part between the boundary of the hole and the boundary of the triangular mesh of the two-dimensional code is subjected to 2D Delaunay triangulation. Perform a re-triangulation.
  • Figure 3 is a result of re-triangulating the target area mesh so that the two-dimensional code mesh mapped to the target area of the three-dimensional model and the user-given three-dimensional model mesh are merged, wherein the triangular mesh of the red area is The part between the target area and the ray intersecting the triangle is deleted, and the part between the boundary of the hole and the boundary of the triangle of the two-dimensional code is re-triangulated by the 2D Delaunay triangulation method.
  • Step (4) The physical experiment simulates the real two-dimensional code image, and calculates the overall contrast of the stereoscopic two-dimensional code and the contrast of each black module.
  • the method before the physical experiment simulates the real two-dimensional code image, the method further includes calculating the visibility of each point of the stereoscopic two-dimensional code, and the specific process is:
  • the integrating sphere is one inside
  • the wall is coated with a white sphere of diffuse reflective material.
  • the inner wall of the ball is coated with an ideal diffuse reflection material, that is, a material with a diffuse reflection coefficient close to 1.
  • the light entering the integrating sphere through the window hole in the wall of the ball is coated through the inner wall.
  • the layer is reflected multiple times and a uniform illumination is formed on the inner wall.
  • Polygon P' As shown in FIG. 5, the blue circle is the intersection q of each point on the stereoscopic two-dimensional code along the perspective projection direction, and the color polygon contour is the contour of the layer after the slice processing, and the black polygon is the layer.
  • Visible polygon P' The visible polygon P' satisfies each point r inside it, and the edge qr does not intersect any contour.
  • the visible polygon P' is projected onto the spherical surface to obtain a three-dimensional rectangular coordinate of each vertex on the visible spherical polygon.
  • the three-dimensional rectangular coordinates of each vertex of the spherical polygon are converted into latitude and longitude coordinates, and the intersection of these spherical polygons is calculated to obtain the visible spherical polygon P of the final point.
  • the visible spherical polygon of each slice layer in the latitude and longitude coordinates of the point p′ on the stereoscopic two-dimensional code; as shown in FIG. 6( b ) is the latitude and longitude coordinates of each slice layer at the point p′ It can be seen that the spherical visible polygon P is the final visible spherical polygon P obtained by the spherical polygon.
  • R is the radius of the integrating sphere
  • ⁇ 1, ⁇ 2, ... , ⁇ n is a spherical polygon value A 1 A 2 ... A n corresponding to the interior angle.
  • Step (4-2-a): Design a binary image of size 200 ⁇ 200 pixels and divide it into 8 ⁇ 8 regions, each region containing 25 ⁇ 25 pixels, each column from left to right. Place a black pixel block of size (2i+1) ⁇ (2i+1)i 1, 2...,8, and then create a cube of 8cm ⁇ 8cm ⁇ 2cm, and set each line from top to bottom. Regional depth The binary map is mapped to the surface of the model through the perspective projection transformation, and then the corresponding depth is recessed to obtain 64 holes of different sizes.
  • Figure 7 is a rendering of a physical experiment model obtained by a printer using white PLA material;
  • Figure 8 is a plot of visibility and gray value scatter plots and fitting curve results.
  • the invention simulates a real two-dimensional code image according to the relationship between the visibility and the gray value obtained by the physical experiment, and then adjusts the depth of each black module of the stereoscopic two-dimensional code according to the result of the simulation, so that the two-dimensional code foreground color and The contrast of the background color is enhanced, thereby increasing the decoding success rate.
  • j is a pixel of the black module B i or the white module W i
  • w j is the weight value at the pixel j obtained by the Gaussian kernel
  • g j is the gray value at the pixel j.
  • G W is the average gray value of all white modules:
  • G B is the average gray value of all black modules:
  • n are the number of all white and black modules in the stereoscopic two-dimensional code, respectively.
  • D is the set of all white modules in the neighborhood where the black module B i 8 is connected
  • k is the number of elements in the set D.
  • Step (5) Optimize the depth of the stereoscopic two-dimensional black module according to the simulation result, and generate a stereoscopic two-dimensional code on the surface of the custom 3D model.
  • setting the contrast threshold to 0.3 reduces the depth of the black module in the stereoscopic two-dimensional code until the contrast of all the black modules is just 0.3.
  • Step (6) input the generated 3D model containing the stereoscopic two-dimensional code to the 3D printer, and print with a single material, and finally output the 3D object with the stereoscopic two-dimensional code.
  • the generated model containing the stereoscopic two-dimensional code is exported to the stl format, and input into a 3D printer for print production.
  • the invention can specify an arbitrary target area by the user, and can still form sufficient contrast in the target area with relatively large curvature change, and improve the decoding success rate of the stereoscopic two-dimensional code generated on any three-dimensional model, and finally generate the stereoscopic two.
  • the dimensional code is significantly better than the two-dimensional code printed by the existing 3D technology.
  • the invention firstly uses a perspective projection transformation to map a two-dimensional code to a target area of a custom 3D model, and performs a uniform depth depression operation according to the transformation result, and then calculates the visibility of each point of the stereoscopic two-dimensional code, and obtains according to a physical experiment.
  • the relationship between the visibility and the gray value simulates the real two-dimensional code image, and then adjusts the depth of each black module of the stereoscopic two-dimensional code according to the result of the simulation, so that the contrast between the foreground color and the background color of the two-dimensional code is enhanced, thereby The decoding success rate is improved, and finally a three-dimensional model including a stereoscopic two-dimensional code which can be manufactured by a 3D printer of a single attribute molding material is generated.
  • the stereoscopic two-dimensional code generated by the invention can achieve optimal depth in each black module, which greatly reduces the support structure required in the 3D printing process.
  • the invention generates a stereoscopic two-dimensional code by using different recess depths in a target area of any three-dimensional model specified by the user, so that the two-dimensional code can be easily manufactured by a 3D printer of a single attribute molding material, and the attractiveness generated can bring Certain business value.
  • FIG. 9 is a schematic structural view of an improved stereoscopic two-dimensional code generating system for a 3D printing custom model of the present invention.
  • an improved 3D printing customized model stereoscopic two-dimensional code generating system of the present invention includes at least:
  • a meshing and normalization processing module for meshing and normalizing a custom 3D model.
  • the meshing and normalization processing module as shown in FIG. 10, further includes:
  • Meshing module for finding discrete sampling points on the surface of a custom 3D model using Lloyd relaxation-based resampling algorithm, and implementing a custom 3D model network for input by 3D Delaunay triangulation method Grid
  • (1-2) a linear transformation module for linearly transforming data of a customized three-dimensional model after meshing using a dispersion normalization method, and mapping three-dimensional coordinate components of each point on the triangular mesh of the 3D model to Between [0-1].
  • a mapping module for mapping a two-dimensional code to a target area of a custom 3D model using a perspective projection transformation method.
  • the mapping module of the present invention includes:
  • a two-dimensional code triangular mesh marking module for placing a two-dimensional code on a viewing plane, and meshing each square module thereon into two triangles, emitting a series of rays from the viewpoint The ray is projected through the vertices of the two-dimensional code grid to the three-dimensional model, thereby generating a two-dimensional code triangle mesh in the target region of the surface of the 3D model, and the two-dimensional code triangulation corresponding to the surface of the 3D model of the two-dimensional code black module The cells are marked in black, which means that these triangular meshes need to be recessed.
  • a recessed module for performing a recess operation according to the mapping result, and generating a stereoscopic two-dimensional code having the same recessed depth on the surface of the custom 3D model.
  • the simulation module includes:
  • Model surface hole acquisition module which is used to divide a binary map of a preset pixel value into a plurality of regions, and map the binary map to a surface of the model through a perspective projection transformation, and then recess the corresponding depth to obtain a hole of a different size than the number of divided areas;
  • (4-2) a visibility and gray value relationship calculation module for obtaining the visibility of the center point of each hole and obtaining the average gray value of the corresponding position from the physical model photograph as the gray value of the center point, Obtaining the relationship between them by fitting the curve to the visibility and gray value;
  • a gray value calculation module for mapping the visibility of each point of the stereoscopic two-dimensional code by the relationship between the visibility and the gray value to the gray value at the point of the stereoscopic two-dimensional code, and finally The gray value of each pixel of the simulated real two-dimensional code image can be obtained.
  • an optimization module for optimizing the depth of the stereoscopic two-dimensional black module according to the simulation result, and generating a stereoscopic two-dimensional code on the surface of the custom 3D model
  • a printing module for inputting the generated 3D model containing the stereoscopic two-dimensional code to the 3D printer, printing with a single material, and finally outputting the 3D object with the stereoscopic two-dimensional code.
  • system further includes:
  • a re-triangulation module for re-triangulating the mesh of the target area of the custom 3D model before performing the sag operation according to the mapping result, so that the two-dimensional code grid and the user mapped to the target area of the 3D model
  • the fixed 3D model meshes are merged together.
  • the system further includes: a visibility calculation module for assuming that only ambient light is equivalent to placing the stereoscopic two-dimensional code in the integrating sphere; and the 3D model is sliced to obtain a stereoscopic two-dimensional code.
  • a visibility calculation module for assuming that only ambient light is equivalent to placing the stereoscopic two-dimensional code in the integrating sphere; and the 3D model is sliced to obtain a stereoscopic two-dimensional code.
  • Each point intersects the visible polygon of each layer contour on each layer along the perspective projection direction; according to the inference of Girard theory, the area of the spherical polygon visible at each point on the stereoscopic two-dimensional code; the area of the integrating sphere visible at any point and The ratio of the overall area of the integrating sphere gives the visibility of the current point.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

本发明公开了一种改进的面向3D打印自定义模型立体二维码生成方法及系统,其中该方法包括对自定义3D模型进行网格化和归一化处理;采用透视投影变换方法将二维码映射到自定义3D模型的目标区域;根据映射结果进行凹陷操作,在自定义3D模型表面生成具有相同凹陷深度的立体二维码;物理实验模拟真实的二维码图像,计算出立体二维码的整体对比度和每个黑色模块的对比度;根据模拟结果优化立体二维码黑色模块的深度,在自定义3D模型表面生成立体二维码;将生成的含有立体二维码的3D模型输入至3D打印机,并利用单一材料进行打印,最后输出带有立体二维码的3D实物。

Description

改进的面向3D打印自定义模型立体二维码生成方法及系统 技术领域
本发明涉及3D打印领域,尤其涉及一种改进的面向3D打印自定义模型立体二维码生成方法及系统。
背景技术
二维码(Two-dimensional Code),又称快速响应码(Quick Response Code),是在条形码技术基础上扩展出的一种具有可读性的条码。二维码利用黑白正方形模块对大量信息进行编码,通过设备扫描可快速传达出其所包含的信息。二维码以其便捷的获取信息、网站跳转、推送广告、防伪促销以及手机支付等强大功能的优势,已经成为信息时代应用最为广泛的自动识别技术,被广泛应用于产品溯源、景点门票、运输管理以及会议服务等各个领域。而已有的二维码生成技术,大多面向的是数字图像。
3D打印(3D Printing),又称增材制造(Additive Manufacturing,AM),是一种快速成形技术,它以数字化模型为基础,运用塑料、陶瓷、金属等可粘合材料,摆脱传统的减式材料制造模式,通过逐层打印的方式构造物体。由于其在制造工艺方面的创新,被认为是“第三次工业革命的重要生产工具”。随着3D打印技术的迅速发展,目前已经出现使用两种颜色的材料打印在平面上的立体二维码,但主流的消费级3D打印机只能打印单一属性的材料,即只能提供单一颜色,不满足二维码解码需要高对比度的前景色和背景色两种颜色的特性,另外,由于空间畸变在任意曲面上表达的立体二维码识别率较低,因此,使用单一属性成型材料的3D打印机在任意三维模型上制造立体二维码的技术还不够成熟。
目前虽然有面向3D打印的自定义模型立体二维码生成方法,比如:申请号为CN201710031940.0的专利,该申请通过对自定义三维模型进行几何与结构分析,在适合打印立体二维码的目标区域根据透视投影变换的结果进行凹陷操作生成可用单一属性成型材料的3D打印机制造的立体二维码。但是,该方法用于生成立体二维码的目标区域通过几何与结构分析给出,并非完全由用户指定,而且这些目标区域往往是曲率变化比较小的区域。而在曲率变化比较大的目标区域,该方法生成的立体二维码由于黑色和白色模块之间的颜色对比度不足不容易被解码器成功解码。
发明内容
为了解决现有技术的不足,本发明提供了一种改进的面向3D打印自定义模型立体二维码生成方法,该方法首先采用透视投影变换将二维码映射到自定义3D模型的目标区域,并根据变换结果进行统一深度的凹陷操作,然后计算立体二维码每一点的可见性,并根据物理 实验获得的可见性和灰度值之间的关系模拟出真实的二维码图像,随后根据模拟的结果调整立体二维码每个黑色模块的深度,使得二维码前景色和背景色的对比度增强,从而提高解码成功率,最后生成可通过单一属性成型材料的3D打印机制造的包含立体二维码的三维模型。
本发明的一种改进的面向3D打印自定义模型立体二维码生成方法,包括:
对自定义3D模型进行网格化和归一化处理;
采用透视投影变换方法将二维码映射到自定义3D模型的目标区域;
根据映射结果进行凹陷操作,在自定义3D模型表面生成具有相同凹陷深度的立体二维码;
物理实验模拟真实的二维码图像,计算出立体二维码的整体对比度和每个黑色模块的对比度;
根据模拟结果优化立体二维码黑色模块的深度,在自定义3D模型表面生成立体二维码;
将生成的含有立体二维码的3D模型输入至3D打印机,并利用单一材料进行打印,最后输出带有立体二维码的3D实物。
进一步的,在根据映射结果进行凹陷操作之前,还包括:
对自定义3D模型的目标区域的网格进行重新三角化,使得映射到3D模型的目标区域的二维码网格和用户给定的3D模型网格融合在一起。
进一步的,对自定义3D模型进行网格化和归一化处理的具体过程包括:
使用基于Lloyd松弛的重采样算法在自定义3D模型表面求得离散采样点,通过3D Delaunay三角剖分方法实现对输入的自定义3D模型的网格化;
使用离差标准化方法,对网格化后自定义三维模型的数据进行线性变换,将3D模型三角网格上每个点的三维坐标分量均映射到[0-1]之间。
其中,使用基于Lloyd松弛的重采样算法在自定义3D模型表面,能够求得具有各向同性、过渡光滑且视觉效果较好的离散采样点,这样能够提高最后打印的立体二维码的精度。
进一步的,采用透视投影变换方法将二维码映射到自定义3D模型的目标区域的具体过程包括:
根据3D打印机的打印精度,得到目标区域的最小面积;
确定透视投影变换的关系,进而获得视点和视平面所在位置;
将二维码放置在视平面上,并把其上的每个正方形模块网格化为两个三角形,从视点发出一系列射线,射线穿过二维码网格的顶点投射到三维模型,从而在3D模型表面的目标区域生成二维码三角网格,将对应于二维码黑色模块的3D模型表面的二维码三角网格标记为 黑色,代表这些三角网格需要进行凹陷操作。
进一步的,对自定义3D模型的目标区域的网格进行重新三角化的具体过程为:
将目标区域与射线相交的三角面片全部删除获得一个带洞的三维模型,然后获得洞的边界,将洞的边界与二维码三角网格的边界之间的部分采用2D Delaunay三角剖分方法进行重新三角化。
进一步的,物理实验模拟真实的二维码图像之前,还包括计算立体二维码的每一点的可见性,其具体过程为:
假设只有环境光,相当于将立体二维码放置在积分球内;
将3D模型进行切片处理,求得立体二维码上每一点沿着透视投影方向在每一层上交点在每一层轮廓的可见多边形;
根据Girard理论的推论求得立体二维码上每一点可见球面多边形的面积;
任一点可见的积分球面积与积分球整体面积之比,得到当前点的可见性。
进一步的,物理实验模拟真实的二维码图像的具体过程为:
将一个预设像素值的二值图划分成若干个区域,将该二值图通过透视投影变换映射到模型表面,再凹陷相应的深度得到与划分区域数量相等的大小不同的洞;
求得每个洞中心点的可见性并从物理模型照片中获得相应位置的平均灰度值作为中心点的灰度值,通过对可见性与灰度值拟合曲线获得它们之间的关系;
将立体二维码每一点的可见性通过可见性和灰度值之间的关系映射为立体二维码该点处的灰度值,最终即可获得模拟出的真实二维码图像每个像素的灰度值。
本发明根据物理实验获得的可见性和灰度值之间的关系模拟出真实的二维码图像,随后根据模拟的结果调整立体二维码每个黑色模块的深度,使得二维码前景色和背景色的对比度增强,从而提高了解码成功率。
本发明还提供了一种改进的面向3D打印自定义模型立体二维码生成系统。
本发明的一种改进的面向3D打印自定义模型立体二维码生成系统,包括:
网格化和归一化处理模块,其用于对自定义3D模型进行网格化和归一化处理;
映射模块,其用于采用透视投影变换方法将二维码映射到自定义3D模型的目标区域;
凹陷模块,其用于根据映射结果进行凹陷操作,在自定义3D模型表面生成具有相同凹陷深度的立体二维码;
模拟模块,其用于物理实验模拟真实的二维码图像,计算出立体二维码的整体对比度和每个黑色模块的对比度;
优化模块,其用于根据模拟结果优化立体二维码黑色模块的深度,在自定义3D模型表面生成立体二维码;
打印模块,其用于将生成的含有立体二维码的3D模型输入至3D打印机,并利用单一材料进行打印,最后输出带有立体二维码的3D实物。
进一步的,该系统还包括:
重新三角化模块,其用于在根据映射结果进行凹陷操作之前,对自定义3D模型的目标区域的网格进行重新三角化,使得映射到3D模型的目标区域的二维码网格和用户给定的3D模型网格融合在一起。
进一步的,所述网格化和归一化处理模块包括:
网格化模块,其用于使用基于Lloyd松弛的重采样算法在自定义3D模型表面求得离散采样点,通过3D Delaunay三角剖分方法实现对输入的自定义3D模型的网格化;
线性变换模块,其用于使用离差标准化方法,对网格化后自定义三维模型的数据进行线性变换,将3D模型三角网格上每个点的三维坐标分量均映射到[0-1]之间。
进一步的,所述映射模块包括:
目标区域的最小面积计算模块,其用于根据3D打印机的打印精度,得到目标区域的最小面积;
视点和视平面位置确定模块,其用于确定透视投影变换的关系,进而获得视点和视平面所在位置;
二维码三角网格标记模块,其用于将二维码放置在视平面上,并把其上的每个正方形模块网格化为两个三角形,从视点发出一系列射线,射线穿过二维码网格的顶点投射到三维模型,从而在3D模型表面的目标区域生成二维码三角网格,将对应于二维码黑色模块的3D模型表面的二维码三角网格标记为黑色,代表这些三角网格需要进行凹陷操作。
进一步的,该系统还包括:可见性计算模块,其用于假设只有环境光,相当于将立体二维码放置在积分球内;将3D模型进行切片处理,求得立体二维码上每一点沿着透视投影方向在每一层上交点在每一层轮廓的可见多边形;根据Girard理论的推论求得立体二维码上每一点可见球面多边形的面积;任一点可见的积分球面积与积分球整体面积之比,得到当前点的可见性。
进一步的,所述模拟模块包括:
模型表面洞获取模块,其用于将一个预设像素值的二值图划分成若干个区域,将该二值图通过透视投影变换映射到模型表面,再凹陷相应的深度得到与划分区域数量相等的大小不 同的洞;
可见性与灰度值关系计算模块,其用于求得每个洞中心点的可见性并从物理模型照片中获得相应位置的平均灰度值作为中心点的灰度值,通过对可见性与灰度值拟合曲线获得它们之间的关系;
灰度值计算模块,其用于将立体二维码每一点的可见性通过可见性和灰度值之间的关系映射为立体二维码该点处的灰度值,最终即可获得模拟出的真实二维码图像每个像素的灰度值。
与现有技术相比,本发明的有益效果是:
(1)本发明可以由用户指定任意的目标区域,并且在曲率变化比较大的目标区域仍然可以形成足够的对比度,提高了在任意三维模型上生成的立体二维码的解码成功率,最终生成的立体二维码明显优于现有3D技术打印出的二维码。
(2)本发明首先采用透视投影变换将二维码映射到自定义3D模型的目标区域,并根据变换结果进行统一深度的凹陷操作,然后计算立体二维码每一点的可见性,并根据物理实验获得的可见性和灰度值之间的关系模拟出真实的二维码图像,随后根据模拟的结果调整立体二维码每个黑色模块的深度,使得二维码前景色和背景色的对比度增强,从而提高解码成功率,最后生成可通过单一属性成型材料的3D打印机制造的包含立体二维码的三维模型。
(3)本发明生成的立体二维码在每个黑色模块的凹陷深度均可达到最优,大大减少了3D打印过程中所需的支撑结构。
(4)本发明通过采用不同凹陷深度在用户指定的任意三维模型的目标区域生成立体二维码,使得二维码可很容易地通过单一属性成型材料的3D打印机制造出来,其产生的吸引力可以带来一定的商业价值。
附图说明
构成本申请的一部分的说明书附图用来提供对本申请的进一步理解,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。
图1为本发明的改进的面向3D打印自定义模型立体二维码生成方法流程图;
图2为采用透视投影变换将普通二维码映射到三维模型bunny某一目标区域的结果图;
图3为对目标区域网格进行重新三角化使得映射到三维模型目标区域的二维码网格和用户给定的三维模型网格融合后的结果图;
图4为通过透视投影变换在目标区域生成凹陷统一深度的立体二维码示意图;
图5为包含立体二维码的三维模型切片后每一层上可见性多边形求解示意图;
图6(a)为立体二维码上点p′各个切片层经纬度坐标下的可见球面多边形;
图6(b)为对点p′处各个切片层经纬度坐标下的可见球面多边形求交获得的该点最终的可见球面多边形;
图7为采用白色PLA材料的打印机获得的物理实验模型效果图;
图8为可见性与灰度值散点图及拟合曲线结果图;
图9为本发明的改进的面向3D打印自定义模型立体二维码生成系统的结构示意图;
图10为网格化和归一化处理模块的结构示意图;
图11为映射模块的结构示意图;
图12为模拟模块的结构示意图。
具体实施方式
应该指出,以下详细说明都是例示性的,旨在对本申请提供进一步的说明。除非另有指明,本文使用的所有技术和科学术语具有与本申请所属技术领域的普通技术人员通常理解的相同含义。
需要注意的是,这里所使用的术语仅是为了描述具体实施方式,而非意图限制根据本申请的示例性实施方式。如在这里所使用的,除非上下文另外明确指出,否则单数形式也意图包括复数形式,此外,还应当理解的是,当在本说明书中使用术语“包含”和/或“包括”时,其指明存在特征、步骤、操作、器件、组件和/或它们的组合。
本发明中三角面片是通过三角剖分进行网格化处理之后得到的三角网格的基本单位,由空间中三个不共线的顶点顺次连接而成,可以理解为三角形,三角形内部区域为三角面片。
图1为本发明的改进的面向3D打印自定义模型立体二维码生成方法流程图。
如图1所示,本发明的改进的面向3D打印自定义模型立体二维码生成方法,至少包括:
步骤(1):对自定义3D模型进行网格化和归一化处理。
具体地,对自定义3D模型进行网格化和归一化处理的具体过程包括:
步骤(1-1):使用基于Lloyd松弛的重采样算法在自定义3D模型表面求得离散采样点,通过3D Delaunay三角剖分方法实现对输入的自定义3D模型的网格化;
步骤(1-2):使用离差标准化方法,对网格化后自定义三维模型的数据进行线性变换,将3D模型三角网格上每个点的三维坐标分量均映射到[0-1]之间。
其中,使用基于Lloyd松弛的重采样算法在自定义3D模型表面,能够求得具有各向同性、过渡光滑且视觉效果较好的离散采样点,这样能够提高最后打印的立体二维码的精度。
步骤(2):采用透视投影变换方法将二维码映射到自定义3D模型的目标区域。
具体地,采用透视投影变换方法将二维码映射到自定义3D模型的目标区域的具体过程包括:
步骤(2-1):根据3D打印机的打印精度P,设置P的初始值,得到目标区域的最小面积Amin
Amin=[(V-1)*4+21]*P
其中V是输入的二维码的版本号,二维码共有40个版本,版本1是由21*21个黑色或白色的正方形模块构成的矩阵,之后版本号每增加1,二维码的每行每列均增加4个正方形模块。由用户在自定义3D模型表面指定一块面积大于Amin的区域作为目标区域。
步骤(2-2):确定透视投影变换的关系,获得视点和视平面所在位置。
所述步骤(2-2)中,具体包括以下步骤:
(2-2-1):计算目标区域的面积Darea
(2-2-2):确定目标区域与和视平面之间的距离;
(2-2-3):确定视平面的位置;
(2-2-4):确定透视投影变换,将普通二维码映射到目标区域,具体为:
(2-2-4-a):根据视平面和目标区域的位置关系,确定视点所在的位置,建立透视投影变换;
(2-2-4-b):将普通二维码放置于视平面上,根据确定的透视投影变换关系,将普通二维码映射到目标区域。
所述步骤(2-2-2)的具体方法为:实验表明,当扫描距离和普通二维码大小比例为10:1时,大多数解码器可以成功解码,由于使用单一材料3D打印的二维码受光照、前景背景色对比度等的影响,可以设置比例R的初始值为8:1,用户可根据实际情况进行相应调整,从而计算出目标区域和视平面之间的距离:
Dis=Darea/R
所述步骤(2-2-3)的具体方法为:设置视平面的大小为解码器识别框的大小,初始值为4cm*4cm,用户可根据实际情况进行相应的调整,视平面垂直于目标区域的法线方向且视平面的中点位于目标区域的法线方向上。
步骤(2-3):将二维码放置在视平面上,并把其上的每个正方形模块网格化为两个三角形,从视点发出一系列射线,射线穿过二维码网格的顶点投射到三维模型,从而在目标区域生成三维模型表面的二维码三角网格,将对应于二维码黑色模块的三维模型表面的二维码三角网格标记为黑色,代表这些三角网格需要进行凹陷操作。图2即为采用透视投影变换将普通二维码映射到三维模型bunny某一目标区域的结果图。如图4所示,三维模型表面的二维码三角网格的顶点可以通过射线穿过二维码顶点与目标区域三角网格的面片求交获得。求解 过程如下:
s+td=(1-u-v)V0+uV1+uV2  (1)
其中,c是视点位置,即为射线的起点坐标,s为二维码图像上正方形模块顶点的坐标,t为射线方程中的参数,d=s-c是射线的方向,V0,V1,v2为目标区域三角面片的三个顶点,u,v为交点的纹理坐标值。令E1=V1-V0,E2=V2-V0,T=s-V0,求解(1)式即为求解线性方程组(2)
Figure PCTCN2017106086-appb-000001
根据Gramer法则可解得:
Figure PCTCN2017106086-appb-000002
其中P=d×E2,Q=T×E2。再将纹理坐标值(u,v)转化为直角坐标系坐标即可得到最终三维模型表面的二维码三角网格的顶点坐标p。
步骤(3):根据映射结果进行凹陷操作,在自定义3D模型表面生成具有相同凹陷深度的立体二维码。
具体实施中,在根据映射结果进行凹陷操作之前,还包括:
对自定义3D模型的目标区域的网格进行重新三角化,使得映射到3D模型的目标区域的二维码网格和用户给定的3D模型网格融合在一起。
具体地,对自定义3D模型的目标区域的网格进行重新三角化的具体过程为:
将目标区域与射线相交的三角面片全部删除获得一个带洞的三维模型,然后获得洞的边界,将洞的边界与二维码三角网格的边界之间的部分采用2D Delaunay三角剖分方法进行重新三角化。图3即为对目标区域网格进行重新三角化使得映射到三维模型目标区域的二维码网格和用户给定的三维模型网格融合后的结果图,其中红色区域的三角网格为将目标区域与射线相交的三角面片全部删除后洞边界与二维码三角网格的边界之间的部分采用2D Delaunay三角剖分方法进行重新三角化的结果。
步骤(4):物理实验模拟真实的二维码图像,计算出立体二维码的整体对比度和每个黑色模块的对比度。
具体实施中,物理实验模拟真实的二维码图像之前,还包括计算立体二维码的每一点的可见性,其具体过程为:
步骤(4-1-a):假设只有环境光,相当于将立体二维码放置在积分球内。积分球即一个内 壁涂油白色漫反射材料的空腔球体,球内壁上涂以理想的漫反射材料,也就是漫反射系数接近于1的材料,这样通过球壁上的窗孔进入积分球的光经过内壁涂层多次反射,在内壁上会形成均匀照度。
步骤(4-1-b):三维模型进行切片处理,获得每一层的轮廓,求得立体二维码上每一点沿着透视投影方向在每一层上交点q在每一层轮廓的可见多边形P′。如图5所示,蓝色的圆圈即为立体二维码上每一点沿着透视投影方向在一层上的交点q,彩色多边形轮廓即为切片处理后该层的轮廓,黑色多边形为该层的可见多边形P′。可见多边形P′满足在其内部的每个点r,都有边qr不与任何轮廓相交。将该可见多边形P′投射到球面上求得可见球面多边形上每个顶点的三维直角坐标。将球面多边形每个顶点三维直角坐标转换为经纬度坐标,计算这些球面多边形的交集得到最终该点的可见球面多边形P。如图6(a)所示,立体二维码上点p′各个切片层经纬度坐标下的可见球面多边形;如图6(b)所示,为对点p′处各个切片层经纬度坐标下的可见球面多边形求交获得的该点最终的可见球面多边形P。
步骤(4-1-c):根据Girard理论的推论求得立体二维码上每一点可见球面多边形P的面积Ap′
Ap′=R2*E
其中R为积分球的半径
Figure PCTCN2017106086-appb-000003
其中,α1,α2,...,αn为球面多边形A1A2...An对应的内角角度值。
步骤(4-1-d):计算立体二维码每一点处的可见性Vp′,即在该点可见的积分球面积Ap′与积分球整体面积AS之比。
Figure PCTCN2017106086-appb-000004
其中AS=4*π*R2
具体地,物理实验模拟真实的二维码图像的具体过程为:
步骤(4-2-a):设计一个大小为200×200像素的二值图,将其分为8×8的区域,每个区域包含25×25个像素,从左往右每列的每个区域放置大小为(2i+1)×(2i+1)i=1,2…,8的黑色像素块,然后建立一个8cm×8cm×2cm的立方体,从上到下设置每行的每个区域深度均为
Figure PCTCN2017106086-appb-000005
将二值图通过透视投影变换映射到模型表面,再凹陷相应的深度得到64个大小不同的洞。
步骤(4-2-b):求得每个洞中心点的可见性vh并从采用白色PLA材料的打印机获得的物理模型照片中获得相应位置的平均灰度值gh作为中心点的灰度值,通过对可见性与灰度值拟合曲线获得它们之间的关系。图7即为采用白色PLA材料的打印机获得的物理实验模型效果图;图8为可见性与灰度值散点图及拟合曲线结果图。
步骤(4-2-c):将立体二维码每一点的可见性Vp′通过可见性和灰度值之间的关系映射为立体二维码该点处的灰度值gp′,最终即可获得模拟出的真实二维码图像每个像素的灰度值gj
本发明根据物理实验获得的可见性和灰度值之间的关系模拟出真实的二维码图像,随后根据模拟的结果调整立体二维码每个黑色模块的深度,使得二维码前景色和背景色的对比度增强,从而提高了解码成功率。
其中,计算立体二维码的整体对比度和每个黑色模块的对比度的具体过程为:
步骤(4-3-a):计算每个黑色模块的灰度
Figure PCTCN2017106086-appb-000006
和每个白色模块的灰度
Figure PCTCN2017106086-appb-000007
Figure PCTCN2017106086-appb-000008
Figure PCTCN2017106086-appb-000009
其中j为黑色模块Bi或白色模块Wi的一个像素,wj为通过高斯核求得的像素j处的权重值,gj为像素j处的灰度值。
步骤(4-3-b):计算立体二维码整体对比度为:
C=GW-GB C∈[0,1]
其中GW为所有白色模块的平均灰度值:
Figure PCTCN2017106086-appb-000010
GB为所有黑色模块的平均灰度值:
Figure PCTCN2017106086-appb-000011
m,n分别为立体二维码中所有白色和黑色模块的个数。
步骤(4-3-c):计算立体二维码每个黑色模块的对比度为:
Figure PCTCN2017106086-appb-000012
其中D是黑色模块Bi8连通的邻域内的所有白色模块的集合,k为集合D中元素的个数。
步骤(5):根据模拟结果优化立体二维码黑色模块的深度,在自定义3D模型表面生成立体二维码。
具体地,设置对比度阈值为0.3,减小立体二维码中黑色模块的凹陷深度,直到所有的黑色模块的对比度刚好为0.3时为止。
步骤(6):将生成的含有立体二维码的3D模型输入至3D打印机,并利用单一材料进行打印,最后输出带有立体二维码的3D实物。
具体地,将生成的含有立体二维码的模型导出为stl格式,并输入至3D打印机中,进行打印制作。
本发明可以由用户指定任意的目标区域,并且在曲率变化比较大的目标区域仍然可以形成足够的对比度,提高了在任意三维模型上生成的立体二维码的解码成功率,最终生成的立体二维码明显优于现有3D技术打印出的二维码。
本发明首先采用透视投影变换将二维码映射到自定义3D模型的目标区域,并根据变换结果进行统一深度的凹陷操作,然后计算立体二维码每一点的可见性,并根据物理实验获得的可见性和灰度值之间的关系模拟出真实的二维码图像,随后根据模拟的结果调整立体二维码每个黑色模块的深度,使得二维码前景色和背景色的对比度增强,从而提高解码成功率,最后生成可通过单一属性成型材料的3D打印机制造的包含立体二维码的三维模型。
本发明生成的立体二维码在每个黑色模块的凹陷深度均可达到最优,大大减少了3D打印过程中所需的支撑结构。
本发明通过采用不同凹陷深度在用户指定的任意三维模型的目标区域生成立体二维码,使得二维码可很容易地通过单一属性成型材料的3D打印机制造出来,其产生的吸引力可以带来一定的商业价值。
图9是本发明的一种改进的面向3D打印自定义模型立体二维码生成系统的结构示意图。
如图9所示,本发明的一种改进的面向3D打印自定义模型立体二维码生成系统,至少包括:
(1)网格化和归一化处理模块,其用于对自定义3D模型进行网格化和归一化处理。
具体地,所述网格化和归一化处理模块,如图10所示,还包括:
(1-1)网格化模块,其用于使用基于Lloyd松弛的重采样算法在自定义3D模型表面求得离散采样点,通过3D Delaunay三角剖分方法实现对输入的自定义3D模型的网格化;
(1-2)线性变换模块,其用于使用离差标准化方法,对网格化后自定义三维模型的数据进行线性变换,将3D模型三角网格上每个点的三维坐标分量均映射到[0-1]之间。
(2)映射模块,其用于采用透视投影变换方法将二维码映射到自定义3D模型的目标区域。
具体地,如图11所示,本发明的映射模块包括:
(2-1)目标区域的最小面积计算模块,其用于根据3D打印机的打印精度,得到目标区域的最小面积;
(2-2)视点和视平面位置确定模块,其用于确定透视投影变换的关系,进而获得视点和视平面所在位置;
(2-3)二维码三角网格标记模块,其用于将二维码放置在视平面上,并把其上的每个正方形模块网格化为两个三角形,从视点发出一系列射线,射线穿过二维码网格的顶点投射到三维模型,从而在3D模型表面的目标区域生成二维码三角网格,将对应于二维码黑色模块的3D模型表面的二维码三角网格标记为黑色,代表这些三角网格需要进行凹陷操作。
(3)凹陷模块,其用于根据映射结果进行凹陷操作,在自定义3D模型表面生成具有相同凹陷深度的立体二维码。
(4)模拟模块,其用于物理实验模拟真实的二维码图像,计算出立体二维码的整体对比度和每个黑色模块的对比度。
具体地,如图12所示,模拟模块包括:
(4-1)模型表面洞获取模块,其用于将一个预设像素值的二值图划分成若干个区域,将该二值图通过透视投影变换映射到模型表面,再凹陷相应的深度得到与划分区域数量相等的大小不同的洞;
(4-2)可见性与灰度值关系计算模块,其用于求得每个洞中心点的可见性并从物理模型照片中获得相应位置的平均灰度值作为中心点的灰度值,通过对可见性与灰度值拟合曲线获得它们之间的关系;
(4-3)灰度值计算模块,其用于将立体二维码每一点的可见性通过可见性和灰度值之间的关系映射为立体二维码该点处的灰度值,最终即可获得模拟出的真实二维码图像每个像素的灰度值。
(5)优化模块,其用于根据模拟结果优化立体二维码黑色模块的深度,在自定义3D模型表面生成立体二维码;
(6)打印模块,其用于将生成的含有立体二维码的3D模型输入至3D打印机,并利用单一材料进行打印,最后输出带有立体二维码的3D实物。
另一实施例,该系统还包括:
重新三角化模块,其用于在根据映射结果进行凹陷操作之前,对自定义3D模型的目标区域的网格进行重新三角化,使得映射到3D模型的目标区域的二维码网格和用户给定的3D模型网格融合在一起。
另一实施例,该系统还包括:可见性计算模块,其用于假设只有环境光,相当于将立体二维码放置在积分球内;将3D模型进行切片处理,求得立体二维码上每一点沿着透视投影方向在每一层上交点在每一层轮廓的可见多边形;根据Girard理论的推论求得立体二维码上每一点可见球面多边形的面积;任一点可见的积分球面积与积分球整体面积之比,得到当前点的可见性。
上述虽然结合附图对本发明的具体实施方式进行了描述,但并非对本发明保护范围的限制,所属领域技术人员应该明白,在本发明的技术方案的基础上,本领域技术人员不需要付出创造性劳动即可做出的各种修改或变形仍在本发明的保护范围以内。

Claims (10)

  1. 一种改进的面向3D打印自定义模型立体二维码生成方法,其特征在于,包括:
    对自定义3D模型进行网格化和归一化处理;
    采用透视投影变换方法将二维码映射到自定义3D模型的目标区域;
    根据映射结果进行凹陷操作,在自定义3D模型表面生成具有相同凹陷深度的立体二维码;
    物理实验模拟真实的二维码图像,计算出立体二维码的整体对比度和每个黑色模块的对比度;
    根据模拟结果优化立体二维码黑色模块的深度,在自定义3D模型表面生成立体二维码;
    将生成的含有立体二维码的3D模型输入至3D打印机,并利用单一材料进行打印,最后输出带有立体二维码的3D实物。
  2. 如权利要求1所述的一种改进的面向3D打印自定义模型立体二维码生成方法,其特征在于,在根据映射结果进行凹陷操作之前,还包括:
    对自定义3D模型的目标区域的网格进行重新三角化,使得映射到3D模型的目标区域的二维码网格和用户给定的3D模型网格融合在一起。
  3. 如权利要求1所述的一种改进的面向3D打印自定义模型立体二维码生成方法,其特征在于,对自定义3D模型进行网格化和归一化处理的具体过程包括:
    使用基于Lloyd松弛的重采样算法在自定义3D模型表面求得离散采样点,通过3D Delaunay三角剖分方法实现对输入的自定义3D模型的网格化;
    使用离差标准化方法,对网格化后自定义三维模型的数据进行线性变换,将3D模型三角网格上每个点的三维坐标分量均映射到[0-1]之间。
  4. 如权利要求1所述的一种改进的面向3D打印自定义模型立体二维码生成方法,其特征在于,采用透视投影变换方法将二维码映射到自定义3D模型的目标区域的具体过程包括:
    根据3D打印机的打印精度,得到目标区域的最小面积;
    确定透视投影变换的关系,进而获得视点和视平面所在位置;
    将二维码放置在视平面上,并把其上的每个正方形模块网格化为两个三角形,从视点发出一系列射线,射线穿过二维码网格的顶点投射到三维模型,从而在3D模型表面的目标区域生成二维码三角网格,将对应于二维码黑色模块的3D模型表面的二维码三角网格标记为黑色,代表这些三角网格需要进行凹陷操作。
  5. 如权利要求2所述的一种改进的面向3D打印自定义模型立体二维码生成方法,其特征在于,对自定义3D模型的目标区域的网格进行重新三角化的具体过程为:
    将目标区域与射线相交的三角面片全部删除获得一个带洞的三维模型,然后获得洞的边界,将洞的边界与二维码三角网格的边界之间的部分采用2D Delaunay三角剖分方法进行重新三角化。
  6. 如权利要求1所述的一种改进的面向3D打印自定义模型立体二维码生成方法,其特征在于,物理实验模拟真实的二维码图像之前,还包括计算立体二维码的每一点的可见性,其具体过程为:
    假设只有环境光,相当于将立体二维码放置在积分球内;
    将3D模型进行切片处理,求得立体二维码上每一点沿着透视投影方向在每一层上交点在每一层轮廓的可见多边形;
    根据Girard理论的推论求得立体二维码上每一点可见球面多边形的面积;
    任一点可见的积分球面积与积分球整体面积之比,得到当前点的可见性。
  7. 如权利要求1所述的一种改进的面向3D打印自定义模型立体二维码生成方法,其特征在于,物理实验模拟真实的二维码图像的具体过程为:
    将一个预设像素值的二值图划分成若干个区域,将该二值图通过透视投影变换映射到模型表面,再凹陷相应的深度得到与划分区域数量相等的大小不同的洞;
    求得每个洞中心点的可见性并从物理模型照片中获得相应位置的平均灰度值作为中心点的灰度值,通过对可见性与灰度值拟合曲线获得它们之间的关系;
    将立体二维码每一点的可见性通过可见性和灰度值之间的关系映射为立体二维码该点处的灰度值,最终即可获得模拟出的真实二维码图像每个像素的灰度值。
  8. 一种改进的面向3D打印自定义模型立体二维码生成系统,其特征在于,包括:
    网格化和归一化处理模块,其用于对自定义3D模型进行网格化和归一化处理;
    映射模块,其用于采用透视投影变换方法将二维码映射到自定义3D模型的目标区域;
    凹陷模块,其用于根据映射结果进行凹陷操作,在自定义3D模型表面生成具有相同凹陷深度的立体二维码;
    模拟模块,其用于物理实验模拟真实的二维码图像,计算出立体二维码的整体对比度和每个黑色模块的对比度;
    优化模块,其用于根据模拟结果优化立体二维码黑色模块的深度,在自定义3D模型表面生成立体二维码;
    打印模块,其用于将生成的含有立体二维码的3D模型输入至3D打印机,并利用单一材料进行打印,最后输出带有立体二维码的3D实物。
  9. 如权利要求8所述的一种改进的面向3D打印自定义模型立体二维码生成系统,其特征在于,该系统还包括:
    重新三角化模块,其用于在根据映射结果进行凹陷操作之前,对自定义3D模型的目标区域的网格进行重新三角化,使得映射到3D模型的目标区域的二维码网格和用户给定的3D模型网格融合在一起。
  10. 如权利要求8所述的一种改进的面向3D打印自定义模型立体二维码生成系统,其特征在于,所述网格化和归一化处理模块包括:
    网格化模块,其用于使用基于Lloyd松弛的重采样算法在自定义3D模型表面求得离散采样点,通过3D Delaunay三角剖分方法实现对输入的自定义3D模型的网格化;
    线性变换模块,其用于使用离差标准化方法,对网格化后自定义三维模型的数据进行线性变换,将3D模型三角网格上每个点的三维坐标分量均映射到[0-1]之间;
    和/或,所述映射模块包括:
    目标区域的最小面积计算模块,其用于根据3D打印机的打印精度,得到目标区域的最小面积;
    视点和视平面位置确定模块,其用于确定透视投影变换的关系,进而获得视点和视平面所在位置;
    二维码三角网格标记模块,其用于将二维码放置在视平面上,并把其上的每个正方形模块网格化为两个三角形,从视点发出一系列射线,射线穿过二维码网格的顶点投射到三维模型,从而在3D模型表面的目标区域生成二维码三角网格,将对应于二维码黑色模块的3D模型表面的二维码三角网格标记为黑色,代表这些三角网格需要进行凹陷操作;
    和/或,该系统还包括:可见性计算模块,其用于假设只有环境光,相当于将立体二维码放置在积分球内;将3D模型进行切片处理,求得立体二维码上每一点沿着透视投影方向在每一层上交点在每一层轮廓的可见多边形;根据Girard理论的推论求得立体二维码上每一点可见球面多边形的面积;任一点可见的积分球面积与积分球整体面积之比,得到当前点的可见性;
    和/或,所述模拟模块包括:
    模型表面洞获取模块,其用于将一个预设像素值的二值图划分成若干个区域,将该二值图通过透视投影变换映射到模型表面,再凹陷相应的深度得到与划分区域数量相等的大小不同的洞;
    可见性与灰度值关系计算模块,其用于求得每个洞中心点的可见性并从物理模型照片中 获得相应位置的平均灰度值作为中心点的灰度值,通过对可见性与灰度值拟合曲线获得它们之间的关系;
    灰度值计算模块,其用于将立体二维码每一点的可见性通过可见性和灰度值之间的关系映射为立体二维码该点处的灰度值,最终即可获得模拟出的真实二维码图像每个像素的灰度值。
PCT/CN2017/106086 2017-05-16 2017-10-13 改进的面向3d打印自定义模型立体二维码生成方法及系统 Ceased WO2018209886A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710343611.XA CN107145928B (zh) 2017-05-16 2017-05-16 改进的面向3d打印自定义模型立体二维码生成方法及系统
CN201710343611.X 2017-05-16

Publications (1)

Publication Number Publication Date
WO2018209886A1 true WO2018209886A1 (zh) 2018-11-22

Family

ID=59778326

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106086 Ceased WO2018209886A1 (zh) 2017-05-16 2017-10-13 改进的面向3d打印自定义模型立体二维码生成方法及系统

Country Status (2)

Country Link
CN (1) CN107145928B (zh)
WO (1) WO2018209886A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3667623A1 (en) * 2018-12-12 2020-06-17 Twikit NV A system for optimizing a 3d mesh
WO2020131077A1 (en) 2018-12-20 2020-06-25 Hewlett-Packard Development Company, L.P. Read curved visual marks
US20220067225A1 (en) * 2019-04-30 2022-03-03 Hewlett-Packard Development Company, L.P. Dimensions in Additive Manufacturing

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107145928B (zh) * 2017-05-16 2020-05-22 山东大学 改进的面向3d打印自定义模型立体二维码生成方法及系统
CN108062579B (zh) * 2018-02-08 2024-07-05 科大讯飞股份有限公司 二维码模块及带有二维码的设备
CN109087385A (zh) * 2018-06-27 2018-12-25 山东大学 一种基于3d打印的岸滩生态环境模拟方法与系统
CN109447208A (zh) * 2018-08-31 2019-03-08 北京目瞳科技有限公司 一种3d码及3d码的识别方法
US10974458B2 (en) 2019-01-11 2021-04-13 Hewlett-Packard Development Company, L.P. Dimensional compensations for additive manufacturing
CN110008779B (zh) * 2019-03-05 2022-04-15 北京印刷学院 一种立体二维码处理方法及装置
CN112132970B (zh) * 2020-08-26 2023-08-08 山东大学 一种面向3d打印的自然纹理合成系统及方法
CN112233080B (zh) * 2020-10-13 2024-05-24 深圳市纵维立方科技有限公司 三维模型重建方法和装置、电子设备及存储介质
CN115952675B (zh) * 2022-12-30 2026-01-02 基准方中建筑设计股份有限公司 一种立面设计方法、装置及存储介质
CN116976380A (zh) * 2023-07-31 2023-10-31 北京风知力品牌管理顾问有限公司 基于3d物品定制化的条形码生成方法及相关装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866885A (zh) * 2015-06-04 2015-08-26 杭州甘侑科技有限公司 一种防伪性高的二维码个性化定制系统及其工艺品
CN105138726A (zh) * 2015-07-23 2015-12-09 上海正雅齿科科技有限公司 可编码工件的制造方法及其识别方法
US20170046548A1 (en) * 2015-08-13 2017-02-16 International Business Machines Corporation Printing and extraction of 2d barcode on 3d objects
CN107145928A (zh) * 2017-05-16 2017-09-08 山东大学 改进的面向3d打印自定义模型立体二维码生成方法及系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103354616A (zh) * 2013-07-05 2013-10-16 南京大学 在平面显示器上实现立体显示的方法和系统
CN204706050U (zh) * 2015-02-11 2015-10-14 高磊 一种带有突出字体的二维码名片
CN204856553U (zh) * 2015-07-23 2015-12-09 上海正雅齿科科技有限公司 用于工件的立体二维码
CN105183405B (zh) * 2015-10-12 2017-12-05 山东大学 一种自定义模型表面镂空的3d打印方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866885A (zh) * 2015-06-04 2015-08-26 杭州甘侑科技有限公司 一种防伪性高的二维码个性化定制系统及其工艺品
CN105138726A (zh) * 2015-07-23 2015-12-09 上海正雅齿科科技有限公司 可编码工件的制造方法及其识别方法
US20170046548A1 (en) * 2015-08-13 2017-02-16 International Business Machines Corporation Printing and extraction of 2d barcode on 3d objects
CN107145928A (zh) * 2017-05-16 2017-09-08 山东大学 改进的面向3d打印自定义模型立体二维码生成方法及系统

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3667623A1 (en) * 2018-12-12 2020-06-17 Twikit NV A system for optimizing a 3d mesh
WO2020120698A1 (en) 2018-12-12 2020-06-18 Twikit Nv A system for optimizing a 3d mesh
US11605200B2 (en) 2018-12-12 2023-03-14 Twikit Nv System for optimizing a 3D mesh
WO2020131077A1 (en) 2018-12-20 2020-06-25 Hewlett-Packard Development Company, L.P. Read curved visual marks
EP3899793A4 (en) * 2018-12-20 2022-08-10 Hewlett-Packard Development Company, L.P. READABLE CURVED VISUAL MARKS
US11790204B2 (en) 2018-12-20 2023-10-17 Hewlett-Packard Development Company, L.P. Read curved visual marks
US20220067225A1 (en) * 2019-04-30 2022-03-03 Hewlett-Packard Development Company, L.P. Dimensions in Additive Manufacturing
US12079546B2 (en) 2019-04-30 2024-09-03 Hewlett-Packard Development Company, L.P. Dimensions in additive manufacturing

Also Published As

Publication number Publication date
CN107145928B (zh) 2020-05-22
CN107145928A (zh) 2017-09-08

Similar Documents

Publication Publication Date Title
WO2018209886A1 (zh) 改进的面向3d打印自定义模型立体二维码生成方法及系统
CN101404091B (zh) 基于两步形状建模的三维人脸重建方法和系统
CN108537864B (zh) 利用具有网络渲染层的神经网络编辑数字图像
CN114902289A (zh) 使用源自立体图像对的点云对结构建模的系统和方法
CN109712223B (zh) 一种基于纹理合成的三维模型自动上色方法
CN109035388A (zh) 三维人脸模型重建方法及装置
CN108510573A (zh) 一种基于深度学习的多视点人脸三维模型重建的方法
US10837621B2 (en) Methods and systems for freeform irradiance tailoring for light fields
CN103761397A (zh) 用于面曝光增材成型的3d模型切片及投影面生成方法
CN105184857A (zh) 基于点结构光测距的单目视觉重建中尺度因子确定方法
US9202310B2 (en) Physical reproduction of reflectance fields
CN103093498A (zh) 一种基于平面三角网格模板的三维人脸自动标准化方法
CN116385619B (zh) 对象模型渲染方法、装置、计算机设备和存储介质
CN106874982A (zh) 面向3d打印的自定义模型立体二维码生成方法及系统
Wu et al. Survey on computational 3D visual optical art design
CN119494906B (zh) 积木模型的自动化渲染方法、装置、设备及存储介质
US11823328B2 (en) Three-dimensional (3D) model generation from computer-aided design (CAD) data
CN120823304A (zh) 三维模型的阴影生成方法、装置、设备、介质和程序产品
CN118587266A (zh) 一种基于林区图片生成含有林业基础数据的方法
US11562504B1 (en) System, apparatus and method for predicting lens attribute
CN117272491A (zh) 一种基于ai绘图模型的快速建模方法、设备及介质
Hu et al. Large-scale 3d semantic reconstruction for automated driving vehicles with adaptive truncated signed distance function
CN121414992B (zh) 基于零样本语义分割与物理属性估计的三维结构建模方法
CN121259011B (zh) 三维点云分割方法、装置、设备及存储介质
Abbas et al. Gaussian radial basis function for efficient computation of forest indirect illumination

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: 17909785

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17909785

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 20/10/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17909785

Country of ref document: EP

Kind code of ref document: A1