CN105303616B - Embossment modeling method based on single photo - Google Patents

Embossment modeling method based on single photo Download PDF

Info

Publication number
CN105303616B
CN105303616B CN201510832618.9A CN201510832618A CN105303616B CN 105303616 B CN105303616 B CN 105303616B CN 201510832618 A CN201510832618 A CN 201510832618A CN 105303616 B CN105303616 B CN 105303616B
Authority
CN
China
Prior art keywords
grayscale image
embossment
pixel
border
single photo
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.)
Active
Application number
CN201510832618.9A
Other languages
Chinese (zh)
Other versions
CN105303616A (en
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.)
QINGDAO UNIQUE PRODUCTS DEVELOP CO Ltd
Original Assignee
QINGDAO UNIQUE PRODUCTS DEVELOP CO Ltd
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 QINGDAO UNIQUE PRODUCTS DEVELOP CO Ltd filed Critical QINGDAO UNIQUE PRODUCTS DEVELOP CO Ltd
Priority to CN201510832618.9A priority Critical patent/CN105303616B/en
Publication of CN105303616A publication Critical patent/CN105303616A/en
Application granted granted Critical
Publication of CN105303616B publication Critical patent/CN105303616B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The present invention proposes a kind of embossment modeling method based on single photo, comprising: converts grayscale image for individual photochrome;Determine the profile and border of grayscale image;The height of embossment surface layer pixel is determined according to the gray value of grayscale image, constructs embossment upper surface, and construct the side surface of embossment;Based on profile and border, bottom surface is added to bottom thickness, the demand of shape according to technique;Reconstruct the tri patch on each surface;Generate STL format model file.By being pre-processed to obtain corresponding grayscale image to individual photochrome, embossment model is constructed according to the gray value of grayscale image, generate the STL format model file that can be directly used for 3D printing, it solves traditional multiple photos based on 3-D scanning or based on different angle and carries out the low technical problem of popularity present in three-dimensional reconstruction, more life-like threedimensional model can be provided.

Description

Embossment modeling method based on single photo
Technical field
The invention belongs to computer application technologies, specifically, being related to a kind of embossment modeling based on single photo Method.
Background technique
Three-dimension modeling currently used for 3D printing there are mainly two types of approach: first is that by being obtained to three-dimensional scanning device The data taken carry out three-dimensional reconstruction, but scanning device price is high, and popularity is low;Second is that by profession Three-dimensional Design Software into Row three dimensional design, such mode require operator to have professional knowledge abundant, skillfully use modeling software, and operate Complexity, the period is longer, therefore popularity is also relatively low.
Popularizing for digital camera is perfect with photographing function of mobile phone, so that the acquisition of digitized image is very easy, is based on This, the technology for carrying out three-dimensional reconstruction based on photo in recent years is developed.Its method is several photographs by using different angle Piece carries out three-dimensional reconstruction, but the technology needs to obtain the multiple photos of multiple angle shots, but common use by professional means Family is difficult to obtain image by the means of profession, and popularity is not also high.
Summary of the invention
The embossment modeling method based on single photo that the present invention provides a kind of, by being located in advance to individual photochrome Reason obtains corresponding grayscale image, constructs embossment model according to the gray value of grayscale image, solve it is traditional based on 3-D scanning or Multiple photos based on different angle carry out the low technical problem of popularity present in three-dimensional reconstruction.
In order to solve the above technical problems, the present invention is achieved by the following scheme:
It is proposed a kind of embossment modeling method based on single photo, comprising: convert grayscale image for individual photochrome;Really Determine the profile and border of grayscale image;The height of embossment surface layer pixel is determined according to the gray value of grayscale image, constructs embossment upper surface, and Construct the side surface of embossment;Based on profile and border, bottom surface is added to bottom thickness, the demand of shape according to technique;Reconstruct is each The tri patch on a surface;Generate STL format model file.
Further, before the height that the gray value according to grayscale image determines embossment surface layer pixel, the method is also wrapped It includes: grayscale image is filtered.
Further, grayscale image is converted by individual photochrome, specifically: it is based on gray=(R*299+G*587+B* 114) gray value of each pixel/1000, is obtained using weighted average method;Wherein, R, G, B are the face of photochrome pixel Color value.
It is further, described that grayscale image is filtered, specifically: it is directed to current pixel selected pixels template;Meter Calculate the gray average of all pixels in template pixel;The gray average assigns the current pixel;Wherein, the template pixel is Multiple pixels of the current pixel neighbour form.
Further, the profile and border of the determining grayscale image, specifically: setting one square element, the pros The side length of shape element be adjacent pixel center away from;Use the pixel of grayscale image after the square element traversal filtering;Record In ergodic process, it is described square element it is every positioning one time when its four vertex gray value;Given threshold, it is traversed with determination The state of four vertex correspondences of square element described in journey;Based on the state of four vertex correspondences in ergodic process, filter is determined The profile and border of grayscale image after wave.
Further, the tri patch on each surface of reconstruct, to complete model surface three based on region growing algorithm Angle gridding, specifically includes: the highest Z coordinate in query point cloud;With two abutment points of selection near highest Z coordinate point Construct seed triangle;The normal vector for finding out the seed triangle, as entire relief surface triangle, the reference of dough sheet normal direction Vector;Initial edge queue is established using three sides of the seed triangle;Go out team's a line from the queue of side, searches for abutment points And construct new triangle;By the increased queue when being added as newly-built active edges of new triangle, circulation is sky until active edges.
Compared with prior art, the advantages and positive effects of the present invention are:
In embossment modeling method proposed by the present invention based on single photo, individual photochrome is converted to gray scale first Figure, is filtered grayscale image, and smooth noise reduces the influence of noise on image;It is traversed using square element All pixels point in grayscale image, determines the boundary contour of image, and the height of embossment upper surface pixel is determined according to gray value;It adopts With region growing algorithm implementation model surface triangle gridding, the stl file that can be directly used for 3D printing is generated, algorithm, which is realized, to be held Easily and effect is good, and only single photo is needed to can be realized, and the multiple photos for obtaining multi-angle without professional method carry out Three-dimensional reconstruction is suitble to popularize, and solves traditional multiple photos based on 3-D scanning or based on different angle and carries out three Tie up the low technical problem of popularity present in reconstruction technique.
After the detailed description of embodiment of the present invention is read in conjunction with the figure, the other features and advantages of the invention will become more Add clear.
Detailed description of the invention
Fig. 1 is the flow chart for the embossment modeling method based on single photo that the embodiment of the present invention proposes;
Fig. 2 is the schematic diagram for the square element that the embodiment of the present invention proposes;
Fig. 3 is that the profile and border that the embodiment of the present invention proposes establishes schematic diagram.
Specific embodiment
A specific embodiment of the invention is described in more detail with reference to the accompanying drawing.
As shown in Figure 1, the embossment modeling method proposed by the present invention based on single photo, includes the following steps:
Step S11: grayscale image is converted by individual photochrome.
The gray value of each pixel in individual photochrome is obtained using weighted average value-based algorithm, be specifically based on gray= (R*299+G*587+B*114)/1000 it obtains, wherein R, G, B are the color value of photochrome pixel.
Step S12: grayscale image is filtered.This is preferred steps.
Specifically, for current pixel point (x, y) to be processed, selecting a template pixel, the picture in single photo Plain template is made of several pixels of current pixel neighbour;Then calculate template pixel in all pixels gray average, then The gray average assigns current pixel point (x, y), as the gray value g(x, y of image after processing at that point), i.e. g(x, y)= 1/m ∑ f(x, y), m is in the template comprising the total number of pixels including current pixel.
Step S13: the profile and border of grayscale image is determined.
Specifically, as shown in Fig. 2, setting one square element, the side length of the square element are in adjacent pixel The heart is away from four vertex are respectively labeled as a, b, c, d.Then a vertex a of square element is set as basic point.Wherein, pixel Center away from the medium spacing for two adjacent pixels, determined by the resolution ratio of photo, then away from small, resolution ratio is low then at center for high resolution Center is away from big;Picture resolution determines that then the center of pixel is away from determination.
Use the pixel of grayscale image after the traversal filtering of square element.Wherein, sequentially four basic points of square element It is corresponding in turn to the pixel of grayscale image.Then it records in ergodic process, the ash on its four vertex at the every positioning of square element one time Angle value.A threshold value is set, to determine the state of four vertex correspondences of square element in ergodic process, specifically, vertex When the gray value of corresponding pixel is greater than threshold value, the state for identifying the vertex is " 1 ", is otherwise identified as " 0 ".As it can be seen that for one For a square element, 16 kinds of states are corresponded to, as shown in following table one:
Table one
State value (16 system) a b c d
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
A 1 0 1 0
B 1 0 1 1
C 1 1 0 0
D 1 1 0 1
E 1 1 1 0
F 1 1 1 1
Finally, the state based on four vertex correspondences in ergodic process, determines the profile and border of grayscale image after filtering.Such as figure Shown in 3, for the schematic diagram for the grayscale image that single photo is converted to, wherein band dash area is to influence entity, rest part is ash Angle value is less than the blank space of threshold value.
The state of S1 corresponds to 0000, and square element is in solid exterior;
The state of S2 corresponds to 0001, and square element is in entity edge, and vertex d is on outer contour;
The state of S3 corresponds to 1111, and square element is in inside entity;
The state of S4 corresponds to 0100, and square element is in entity edge, and vertex b is on outer contour;
The state of S5 corresponds to 1000, and square element is in entity edge, and vertex a is on outer contour.
As it can be seen that the status indicator on four vertex when according to each square element positioning, it can be determined that current square Element is in one of following three situation: 1, being located inside entity;2, it is located at solid exterior;3, it is located on outer contour.To The pixel on all outer contours can be found out, and then can determine the boundary contour of bottom surface.
Step S14: determining the height of embossment surface layer pixel according to the gray value of grayscale image, constructs embossment upper surface, and structure Build out the side surface of embossment.
In the step, using the gray value of pixel each in grayscale image by direct proportion as the height of embossment upper epidermis pixel, The upper surface of embossment is constructed, while constructing the side surface of embossment.Side surface be profile and border line along Z-direction to top surface with The curved surface that X/Y plane vertical line is constituted.
Step S15: being based on profile and border, adds bottom surface to bottom thickness, the demand of shape according to technique.
On the basis of the grayscale image profile and border that step S13 is determined, bottom thickness, the demand of shape are added according to technique Bottom surface.
Step S16: the tri patch on each surface is reconstructed.
It is specially based on region growing algorithm, the triangle gridding of model surface is completed using interpolation subdividing, comprising: in structure Two abutment points are selected to construct seed triangles at inquiry highest Z coordinate in the point cloud on each surface, and in its vicinity;Find out kind The normal vector of sub- triangle, the reference vector as entire relief surface tri patch normal direction;Utilize three of seed triangle While establishing initial edge queue;Go out team's a line from the queue of side, searches for its abutment points and construct new triangle;New triangle is increased The queue when being added as newly-built active edges added, cyclic search and establishes new triangle, until active edges terminate for sky.
Step S17: STL(Standard template library, Standard Template Library are generated) format model file.
The stl file that can be directly used for 3D printing is generated, requirement of the 3D printing to threedimensional model is met.
In the embossment modeling method based on single photo that aforementioned present invention proposes, individual photochrome is converted to gray scale Figure, is filtered grayscale image, and smooth noise reduces the influence of noise on image;It is traversed using square element All pixels point in grayscale image, determines the boundary contour of image;The height of embossment upper surface pixel is determined according to gray value;It adopts With region growing algorithm implementation model surface triangle gridding, the stl file that can be directly used for 3D printing is generated, algorithm, which is realized, to be held Easily and effect is good, and only single photo is needed to can be realized, and the multiple photos for obtaining multi-angle without professional method carry out Three-dimensional reconstruction is suitble to popularize, and solves traditional multiple photos based on 3-D scanning or based on different angle and carries out three Tie up the low technical problem of popularity present in reconstruction technique.
It should be noted that the above description is not a limitation of the present invention, the present invention is also not limited to the example above, The variations, modifications, additions or substitutions that those skilled in the art are made within the essential scope of the present invention, are also answered It belongs to the scope of protection of the present invention.

Claims (5)

1. the embossment modeling method based on single photo characterized by comprising
Grayscale image is converted by individual photochrome;
Determine the profile and border of grayscale image;
The height of embossment surface layer pixel is determined according to the gray value of grayscale image, constructs embossment upper surface, and construct the side of embossment Surface;
Based on profile and border, bottom surface is added to bottom thickness, the demand of shape according to technique;
Reconstruct the tri patch on each surface;
Generate STL format model file;
The profile and border of the determining grayscale image, specifically:
Set a square element, the square side length be adjacent pixel center away from;
Use the pixel of grayscale image after the square element traversal filtering;
Record ergodic process in, it is described square element it is every positioning one time when its four vertex gray value;Given threshold, with true Determine the state of four vertex correspondences of square element described in ergodic process;
Based on the state of four vertex correspondences in ergodic process, the profile and border of grayscale image after filtering is determined.
2. the embossment modeling method according to claim 1 based on single photo, which is characterized in that according to grayscale image Before gray value determines the height of embossment surface layer pixel, the method also includes:
Grayscale image is filtered.
3. the embossment modeling method according to claim 1 based on single photo, which is characterized in that by individual photochrome It is converted into grayscale image, specifically:
Based on gray=(R*299+G*587+B*114)/1000, the gray value of each pixel is obtained using weighted average method;
Wherein, R, G, B are the color value of photochrome pixel.
4. the embossment modeling method according to claim 2 based on single photo, which is characterized in that it is described to grayscale image into Row filtering processing, specifically:
For current pixel selected pixels template;
Calculate the gray average of all pixels in template pixel;
The gray average assigns the current pixel;
Wherein, the template pixel is that multiple pixels of the current pixel neighbour form.
5. the embossment modeling method according to claim 1 based on single photo, which is characterized in that each table of reconstruct The tri patch in face, specifically includes:
Highest Z coordinate in query point cloud;
Seed triangles are being constructed with two abutment points of selection near highest Z coordinate point;
The normal vector for finding out the seed triangle, the reference vector as entire relief surface tri patch normal direction;
Utilize three queues when establishing of the seed triangle;
Go out team's a line from the queue of side, search for abutment points and constructs new triangle;
By the increased queue when being added as newly-built active edges of new triangle, circulation is sky until active edges.
CN201510832618.9A 2015-11-26 2015-11-26 Embossment modeling method based on single photo Active CN105303616B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510832618.9A CN105303616B (en) 2015-11-26 2015-11-26 Embossment modeling method based on single photo

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510832618.9A CN105303616B (en) 2015-11-26 2015-11-26 Embossment modeling method based on single photo

Publications (2)

Publication Number Publication Date
CN105303616A CN105303616A (en) 2016-02-03
CN105303616B true CN105303616B (en) 2019-03-15

Family

ID=55200833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510832618.9A Active CN105303616B (en) 2015-11-26 2015-11-26 Embossment modeling method based on single photo

Country Status (1)

Country Link
CN (1) CN105303616B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976362B (en) * 2016-04-28 2018-09-18 厦门大学 A kind of image line drawing generation method suitable for 3D printing
CN105747859B (en) * 2016-04-29 2019-01-18 珠海市瑞明科技有限公司 A kind of coffee solid garland method
CN106504322A (en) * 2016-07-11 2017-03-15 合肥工业大学 A kind of embossment extracting method based on Height Estimation
CN107856466A (en) * 2017-11-10 2018-03-30 扬州市维拉园艺有限公司 A kind of design method, mould and the flowerpot of Bark mark Mould for flower pot
CN109949402A (en) * 2017-12-20 2019-06-28 艾迪普(北京)文化科技股份有限公司 Threedimensional model generation method based on image recognition
CN110751665B (en) * 2019-10-23 2021-06-01 齐鲁工业大学 Method and system for reconstructing 3D portrait model by portrait embossment
CN110853146B (en) * 2019-11-18 2023-08-01 广东三维家信息科技有限公司 Relief modeling method, system and relief processing equipment
CN111090905A (en) * 2019-12-23 2020-05-01 陕西理工大学 Mathematical modeling method using computer multidimensional space
CN111047701A (en) * 2019-12-25 2020-04-21 孟存轩 Method for engraving large-range three-dimensional terrain
CN111400788B (en) * 2020-03-16 2022-09-16 大连理工大学 Interactive 3D (three-dimensional) embossing method suitable for 3D printing
CN113379890B (en) * 2021-04-22 2022-04-19 浙江大学 Character bas-relief model generation method based on single photo

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101596827A (en) * 2009-06-10 2009-12-09 中国工程物理研究院机械制造工艺研究所 A kind of laser fast method for preparing of light-showing three-dimensional embossment
CN102999515A (en) * 2011-09-15 2013-03-27 北京进取者软件技术有限公司 Method for obtaining embossment model modeling surface patch
CN103201772A (en) * 2010-09-03 2013-07-10 马克·卡德尔 Physical three-dimensional model generation apparatus
CN104899359A (en) * 2015-05-14 2015-09-09 青岛尤尼科技有限公司 Section layering method based on STL model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101596827A (en) * 2009-06-10 2009-12-09 中国工程物理研究院机械制造工艺研究所 A kind of laser fast method for preparing of light-showing three-dimensional embossment
CN103201772A (en) * 2010-09-03 2013-07-10 马克·卡德尔 Physical three-dimensional model generation apparatus
CN102999515A (en) * 2011-09-15 2013-03-27 北京进取者软件技术有限公司 Method for obtaining embossment model modeling surface patch
CN104899359A (en) * 2015-05-14 2015-09-09 青岛尤尼科技有限公司 Section layering method based on STL model

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
一种基于边缘检测的局部阈值分割算法;张爱华 等;《小型微型计算机系统》;20030430;第24卷(第4期);第661-663页
基于UG的数控浮雕加工关键技术研究;王寅晨;《中国优秀硕士学位论文全文数据库 工程科技I辑》;20130215;第2013年卷(第2期);第3-4、14-17、40页
基于图像的浮雕曲面建模研究;张海艳 等;《青岛大学学报(自然科学版)》;20110831;第24卷(第3期);第48-52页
浮雕曲面建模的技术研究与实现;张海艳;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130115;第2013年卷(第1期);第I138-1475页

Also Published As

Publication number Publication date
CN105303616A (en) 2016-02-03

Similar Documents

Publication Publication Date Title
CN105303616B (en) Embossment modeling method based on single photo
CN110363858B (en) Three-dimensional face reconstruction method and system
CN109003325B (en) Three-dimensional reconstruction method, medium, device and computing equipment
CN103971408B (en) Three-dimensional facial model generating system and method
CN109035388B (en) Three-dimensional face model reconstruction method and device
CN103021017B (en) Three-dimensional scene rebuilding method based on GPU acceleration
US9317970B2 (en) Coupled reconstruction of hair and skin
WO2015188684A1 (en) Three-dimensional model reconstruction method and system
CN104574432B (en) Three-dimensional face reconstruction method and three-dimensional face reconstruction system for automatic multi-view-angle face auto-shooting image
CN105279789B (en) A kind of three-dimensional rebuilding method based on image sequence
CN106709947A (en) RGBD camera-based three-dimensional human body rapid modeling system
CN108734776A (en) A kind of three-dimensional facial reconstruction method and equipment based on speckle
CN108335352A (en) A kind of texture mapping method towards the extensive three-dimensional reconstruction scene of multiple view
CN109147025B (en) RGBD three-dimensional reconstruction-oriented texture generation method
CN106023147B (en) The method and device of DSM in a kind of rapidly extracting linear array remote sensing image based on GPU
CN101271591A (en) Interactive multi-vision point three-dimensional model reconstruction method
CN104077808A (en) Real-time three-dimensional face modeling method used for computer graph and image processing and based on depth information
CN106875437A (en) A kind of extraction method of key frame towards RGBD three-dimensional reconstructions
CN107990846B (en) Active and passive combination depth information acquisition method based on single-frame structured light
CN108961410A (en) A kind of three-dimensional wireframe modeling method and device based on image
CN108510529A (en) A kind of figure based on adaptive weight cuts solid matching method
CN103679808A (en) Method and system for rebuilding three-dimensional head model by two-dimensional nuclear magnetic images
CN108986218A (en) A kind of building point off density cloud fast reconstructing method based on PMVS
CN107610219A (en) The thick densification method of Pixel-level point cloud that geometry clue perceives in a kind of three-dimensional scenic reconstruct
CN112785692A (en) Single-view-angle multi-person human body reconstruction method based on depth UV prior

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant