CN106340062B - A kind of generation method and device of three-D grain model file - Google Patents

A kind of generation method and device of three-D grain model file Download PDF

Info

Publication number
CN106340062B
CN106340062B CN201510400686.8A CN201510400686A CN106340062B CN 106340062 B CN106340062 B CN 106340062B CN 201510400686 A CN201510400686 A CN 201510400686A CN 106340062 B CN106340062 B CN 106340062B
Authority
CN
China
Prior art keywords
model
data block
photo
vertex
geometry
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
CN201510400686.8A
Other languages
Chinese (zh)
Other versions
CN106340062A (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.)
Changsha Venus Gram Information Technology Co Ltd
Original Assignee
Changsha Venus Gram Information Technology 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 Changsha Venus Gram Information Technology Co Ltd filed Critical Changsha Venus Gram Information Technology Co Ltd
Priority to CN201510400686.8A priority Critical patent/CN106340062B/en
Publication of CN106340062A publication Critical patent/CN106340062A/en
Application granted granted Critical
Publication of CN106340062B publication Critical patent/CN106340062B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses the generation method and device of a kind of three-D grain model file, the method includes the steps: the vertex data of the geometry grid model is detected and obtained, geometric point model data block is generated;According to the geometry grid model and photo, texture coordinate by vertex is calculated to the geometry grid model, generates texture coordinate model data block;It detects and obtains the vertex of the photo, height, width information, and extract the pixel data of the photo line by line, generate picture data block;According to above-mentioned data block, vertex index, the print reference, texture coordinate index of the geometry grid model are established, generates geometry grid model data block;The present invention is by generating individual data block for the geometry grid model and photo of existing object, it is integrated into same file, overcome in the prior art file be loaded into when, because photo lack or damage due to caused by completely can not show texture model the problem of.

Description

A kind of generation method and device of three-D grain model file
Technical field
The present invention relates to technical field of image processing, particularly relate to the generation method and dress of a kind of three-D grain model file It sets.
Background technique
In recent years, the universal of spatial digitizer to obtain body surface precision point cloud within a short period of time. Based on accurate point cloud model, the Grid square of expression object surface shape can be obtained using resurfacing techniques first, Then the colouring information that photo carries can be mapped on Grid square by automatic or manual means, generates lively distinctness Point cloud color model or more advanced texture model.
Point cloud color model only renders the color on vertex, and authenticity more depends on geometry grid model Precision.And the three-D grain model of higher level is mapped to true photo in geometry grid model, authenticity takes Certainly in the mapping accuracy of photo and model, three-D grain model can greatly improve the visual acuity of threedimensional model, and make up several The deficiency of what grid model precision, therefore played an important role in virtual reality applications.Three-dimensional modeling common at present is soft The model format that part is supported has 3ds, wrl, ply, obj etc..These model formats can support geometry grid model, it can note Record apex coordinate, Grid Index and vertex color etc..And for texture model, these formats need photographic intelligence being attached to model In file, and name of pictures is written in model file.If photo missing or damage, will be only able to display geometrical model.
Summary of the invention
In view of this, it is an object of the invention to propose the generation method and device of a kind of three-D grain model file, it is raw At three-D grain model file without having to worry about photo lack or damage problem.
Based on a kind of above-mentioned purpose generation method of three-D grain model file provided by the invention, it is applied to preset several What grid model and photo, comprising steps of
The vertex data of the geometry grid model is detected and obtained, geometric point model data block is generated;
According to the geometry grid model and photo, texture coordinate by vertex is calculated to the geometry grid model, it is raw At texture coordinate model data block;
It detects and obtains the vertex of the photo, height, width information, and extract the pixel data of the photo line by line, Generate picture data block;
According to the geometric point model data block, the vertex index of the geometry grid model is established;According to the photo Data block establishes the print reference of the geometry grid model;According to the texture coordinate model data block, the geometry is established The texture coordinate index of grid model;The vertex index, print reference, texture coordinate index are generated into geometry grid model number According to block.
Preferably, the step of calculating texture coordinate further comprises:
The geometry grid model and photo are subjected to alignment calibration, obtain the photo relative to the geometry grid mould The focal length of type, principal point, position, direction;
A straight line is connected between a vertex and camera photocentre for the geometry grid model;
Record the coordinate (i, j) of the straight line Yu photograph imaging plane intersection point;
Obtain texture coordinate (u, v) according to the following formula:
U=i/ (W-1)
V=(H-1-j)/(H-1)
Wherein, W is the width of the photograph, and H is the height of the photograph.
Preferably, further comprise being loaded into step:
It is loaded into the geometric point model data block and geometry grid model data block, according to the vertex data and vertex rope Draw, generates geometry grid model;
It is loaded into the picture data block, generates photo;
It is loaded into the texture coordinate model data block and geometry grid model data block, according to each top of geometry grid model The photo is mapped to the geometry lattice by point texture coordinate, the texture coordinate index, the print reference and the photo In pessimistic concurrency control, three-D grain model is generated.
Preferably, further comprise dynamic importing step:
Photo progress is compressed for n times, and carries out resampling, is counted again during resampling using following formula Calculate photograph pixel:
GI,J=(1-dx) * (1-dy) * Gi,j+dx*(1-dy)*Gi+1,j+dx*dy*Gi+1,j+1+(1-dx)*dy*Gi,j+1
Wherein Gi,jFor original pixels, GI,JFor compressed pixel, Gi+1,j, Gi+1,j+1, Gi,j+1For three adjacent pixels Coordinate, dx, dy are the fractional part of the determinant on compressed Determinant Mapping to original photo;
Photo after resampling is mapped in the geometry grid model, three-D grain model is generated.
Preferably, further comprise automatic measurement step:
Add up surface area of all grid areas on the three-D grain model as the three-D grain model, and shows Show;
By all grid on the three-D grain model, successively projection generates a polygon prism in the plane of Z=0, tires out Add the volume of all polygon prisms as the volume of the three-D grain model, and shows.
Preferably, further comprise interactive measuring process:
It obtains user and passes through measured zone determined by the selection operation inputted on the screen;
According to the transformational relation of screen and the texture model, the measured zone is worked back into the three-D grain model In, obtain measurement point or survey grid;
According to the measurement point or survey grid, calculates and generate measurement result and show.
Preferably, when the measured zone is one, by vertex nearest from the point in the three-D grain model As the measurement point, the measurement result is the coordinate of the measurement point.
Preferably, it when the measured zone is straight line, chooses in the three-D grain model from the straight line both ends Two nearest vertex of point calculate the distance between the measurement point as the measurement result as the measurement point.
Preferably, when the measured zone is a polygonal region, count that fall into this in the three-D grain model more Grid in the shape region of side is as the survey grid, and the area for all survey grids that add up is as the measurement result.
The present invention also provides a kind of generating means of three-D grain model file, comprising:
First generation module generates geometry point model for detecting and obtaining the vertex data of default geometry grid model Data block;
Second generation module is used for according to the geometry grid model and photo, to the geometry grid model by vertex Ground calculates texture coordinate, generates texture coordinate model data block;
Third generation module for detecting and obtaining vertex, the height, width information of default photo, and extracts institute line by line The pixel data of photo is stated, picture data block is generated;
4th generation module, for establishing the vertex of the geometry grid model according to the geometric point model data block Index;According to the picture data block, the print reference of the geometry grid model is established;According to the texture coordinate pattern number According to block, the texture coordinate index of the geometry grid model is established;By the vertex index, print reference, texture coordinate index Generate geometry grid model data block.
From the above it can be seen that the generation method of three-D grain model file provided by the invention, by will be existing Object geometry grid model and photo generate individual data block, be integrated into same file, overcome existing In technology file be loaded into when, because photo lack or damage due to caused by completely can not show texture model the problem of;Meanwhile it propping up Dynamic resolution compression is held, adapts to different configuration of browsing apparatus, rendering frame per second is high, non-delay, and is able to carry out automatic or mutual Dynamic texture model measurement, measurement result easily can show and export.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the generation method flow chart of the three-D grain model file of the embodiment of the present invention;
Fig. 2 is the mapping calculation schematic diagram of texture coordinate in the embodiment of the present invention;
Fig. 3 is the corresponding schematic diagram of different resolution photo and geometry grid model in the embodiment of the present invention;
Fig. 4 is the texture model display effect and rendering frame per second on computers of different resolution in the embodiment of the present invention Schematic diagram;
Fig. 5 (a) is the display renderings of the measurement of automatic surface product in the embodiment of the present invention;
Fig. 5 (b) is the display renderings of the measurement of automatic volume in the embodiment of the present invention;
Fig. 6 (a) is the display renderings that the interaction of midpoint coordinates of the embodiment of the present invention measures;
Fig. 6 (b) is the display renderings that linear distance interaction measures in the embodiment of the present invention;
Fig. 6 (c) is the display renderings of rectangular area area interaction measurement in the embodiment of the present invention;
Fig. 6 (d) is the display renderings of polygonal region area interaction measurement in the embodiment of the present invention;
Fig. 7 is the structural schematic diagram of the three-D grain model file generating means of the embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with specific embodiment, and reference Attached drawing, the present invention is described in more detail.
The embodiment of the invention provides a kind of generation methods of three-D grain model file, are applied to preset geometry grid Model and photo, the geometry grid model and photo are two individual files, and the method for the present embodiment is by by the geometry Grid model and picture data extract and generate different data blocks to be integrated as a file;With reference to Fig. 1, for the present invention The generation method flow chart of the three-D grain model file of embodiment.
The generation method of the three-D grain model file, comprising the following steps:
S101: detecting and obtains the vertex data of the geometry grid model, generates geometric point model data block.
In this step, the vertex data of geometry grid model is detected and obtains, vertex data generally comprises geometry grid mould Coordinate, normal direction and the colouring information on each vertex of type.Geometric point model data block format is as follows:
vvv x y z nx ny nz r g b
Output point marks first, then enters a new line in the relevant information of same a line output a single point coordinate if there is multiple points It is exported.Wherein, vvv indicates point label, for indicating the output that the row is the point for geometrical model.X, y, z indicate empty Between the three-dimensional coordinate put, unit determines generally millimeter or rice by threedimensional model scanning device, nx, ny, nz representation space point Normal direction, r, g, the color of b representation space point.
S102: according to the geometry grid model and photo, texture by vertex is calculated to the geometry grid model and is sat Mark generates texture coordinate model data block.
Texture coordinate model data block includes the texture coordinate (range is between 0~1) on vertex, and format is as follows:
vtt u v
Output texture coordinate label first, then exports the data of single texture coordinate in same a line, if there is multiple coordinates, Then line feed is exported.Wherein vvt indicates texture coordinate label, is the output for texture coordinate for indicating the row.U, v table Show the texture coordinate on vertex.It is the mapping calculation schematic diagram of texture coordinate with reference to Fig. 2.
Preferably, the step of calculating texture coordinate includes:
The geometry grid model and photo are subjected to alignment calibration, obtain the photo relative to the geometry grid mould The focal length of type, principal point, position, direction;
Specifically, focal length refers at a distance from moment camera photocentre is between photo imaging plane, wherein camera light The heart refers to the imaging center of camera, is a kind of intrinsic physical features of camera;Principal point refers to by camera photocentre perpendicular to photograph Piece imaging plane and the coordinate intersected;Position refers to position of the moment camera relative to geometry grid model;Refer to To referring to that moment camera is concerned about the directional information with the line of principal point relative to geometry grid model.
On a certain vertex in the geometry grid model and connected in line between camera photocentre;
Record the coordinate (i, j) of the straight line Yu photograph imaging plane intersection point;
Obtain texture coordinate (u, v) according to the following formula:
U=i/ (W-1)
V=(H-1-j)/(H-1)
Wherein, W is the width of the photograph, and H is the height of the photograph.
For each vertex of geometry grid model, texture coordinate is obtained by the above process.
S103: detecting and obtains the vertex of the photo, height, width information, and extracts the pixel of the photo line by line Data generate picture data block.
Picture data block has recorded photographic intelligence and Pixel Information.Its format is as follows:
imgno
Left Top Right Bottom Cx Cy
G0,0G0,1G0,2...G0,cx-3G0,cx-2G0,cx-1
G1,0G1,1G1,2...G1,cx-3G1,cx-2G1,cx-1
Gcy-1,0Gcy-1,1Gcy-1,2...Gcy-1,cx-3Gcy-1,cx-2Gcy-1,cx-1
Wherein, the number for exporting photo first, then exports the information header and pixel data of single photo.Wherein, imgno Indicate the number of photo.Being thrown with the information that the data in rectangle frame are every photos after line feed and pixel data: Left, Top, Right, Bottom, Cx, Cy respectively indicate the upper left corner X of photo, Y-coordinate, lower right corner X, Y-coordinate, width, height;G0,0G0, 1G0,2...G0,cx-3G0,cx-2G0,cx-1: indicate the pixel data of every a line.Multiple pictures by according to above-mentioned matrix form successively Arrangement.
S104: according to the geometric point model data block, the vertex index of the geometry grid model is established;According to described Picture data block establishes the print reference of the geometry grid model;According to the texture coordinate model data block, described in foundation The texture coordinate index of geometry grid model;The vertex index, print reference, texture coordinate index are generated into geometry grid mould Type data block.
Geometry grid model data block includes point index, texture coordinate index and print reference.Wherein, point index refers to lattice Which three points of three vertex of net in vertex data block, such as 123 indicate three vertex of grid from the 1st, the 2nd With the 3rd vertex data, these three points are linked to be triangle as a grid.Texture index refers to the line on three vertex of grid Any three points of the coordinate in texture coordinate data block are managed, such as 123 indicate the texture coordinate difference on three vertex of grid From the 1st, the 2nd and the 3rd texture coordinate data.Print reference refer to the texture coordinate on three vertex of grid which Photo, the texture coordinate on three vertex for respectively indicating grid such as 123 is respectively on the 1st, the 2nd and the 3rd photo.
The format of geometric point model data block are as follows:
fff v1_idx v2_idx v3_idx vt1_idx vt2_idx vt3_idx img_idx
Output geometry grid model label first then exports point index, the texture coordinate rope of single grid in same a line Draw with photo so.If there is multiple grid, line feed is exported.Wherein fff indicates geometry grid model label, for indicating The row is suitable for the output of geometry grid model data block.V1_idx, v2_idx, v3_idx indicate the index of point, in the range of 1 ~n, n are vertex number.Vt1_idx, vt2_idx, vt3_idx indicate the index of texture coordinate, are line in the range of 1~n, n Manage number of coordinates.Img_idx indicates the index of photo, is number of photos in the range of 1~m, m.
Preferably, choosing Delaunay triangulation network in the present invention to indicate grid model, it is to connect spatial point For triangle, so that the smallest maximum a kind of technology in angle in all triangles, triangle adjoins each other and does not overlap, one As in the case of, it is optimal topological relation model.
Through the above steps, the geometric point model data block, texture coordinate model data block, picture data block of generation and several What point model data block constitutes three-D grain model file, it is seen that the geometry grid model of original preset and the specific number of photo According to being recorded in above-mentioned each data block, an integrated single file is formed.
Further include being loaded into step for the three-D grain model file that method through this embodiment generates:
It is loaded into the geometric point model data block and geometry grid model data block, according to the vertex data and vertex rope Draw, generates geometry grid model;
It is loaded into the picture data block, generates photo;
It is loaded into the texture coordinate model data block and geometry grid model data block, according to each top of geometry grid model The photo is mapped to the geometry lattice by point texture coordinate, the texture coordinate index, the print reference and the photo In pessimistic concurrency control, three-D grain model is generated.
During loading, the data recorded first according to data block each in three-D grain model file, by geometry lattice Pessimistic concurrency control and photo reduction generate, then are carried out mapping processing, to ultimately generate texture model.
It further, in a preferred embodiment of the invention, further include dynamic importing step, i.e., due in three-D grain model Original photographic intelligence is had recorded in file, can dynamically be sampled when being loaded into generate the three-D grain of different resolution Model.Specifically, if sampling ratio is n, that is, indicating photo carrying out n times during three-D grain model file is loaded into Compression.Texture coordinate remains unchanged, and needs to carry out resampling to the pixel data of photo to adopt to guarantee the smallest loss late Photograph pixel is recalculated with the method for bilinear interpolation, calculation formula is as follows:
GI,J=(1-dx) * (1-dy) * Gi,j+dx*(1-dy)*Gi+1,j+dx*dy*Gi+1,j+1+(1-dx)*dy*Gi,j+1
Wherein Gi,jFor original pixels, GI,JFor compressed pixel, Gi+1,j, Gi+1,j+1, Gi,j+1For three adjacent pixels Coordinate, dx, dy are the fractional part of the determinant on compressed Determinant Mapping to original photo, even original photo uplink Column coordinate is (346.82,159.05), then dx, dy are respectively 0.82 and 0.05.
By the above process, the photo after resampling is mapped in the geometry grid model, generates three-D grain Model.With reference to Fig. 3 and Fig. 4, Fig. 3 is the corresponding schematic diagram of different resolution photo and geometry grid model, and Fig. 4 is different resolutions The texture model display effect of rate and rendering frame per second schematic diagram on computers.In Fig. 4, each three-dimensional grid from left to right Model, successively are as follows: 2 times of resolution ratio, frame per second=45 drop in original resolution, frame per second=20, drop 3 times of resolution ratio, frame per second=62, drop 4 4 times of resolution ratio, frame per second=104, drop in times resolution ratio, frame per second=80.
It in a preferred embodiment, further include automatic measurement on the three-D grain model based on method generation of the invention Step, i.e., it is automatic to calculate the common measurement data of some and shown to user for the three-D grain model of generation, including from The measurement of dynamic surface area and volume.
The measurement process of surface area are as follows:
Surface area of all grid areas as three-D grain model on cumulative three-D grain model, such as following formula:
Wherein, StotalIndicate that the surface area of three-D grain model, n are the total number of grid.
The measurement process of volume are as follows:
By all grid on the three-D grain model, successively projection generates a polygon prism in the plane of Z=0, tires out Add the volume of all polygon prisms as the volume of the three-D grain model, such as following formula:
Wherein, VtotalIndicate the volume of three-D grain model, V is the volume of single prism, is needed point positive and negative.It distinguishes positive and negative Principle are as follows: be positive if the normal direction of grid is identical as Z=0 plane, be otherwise negative.
After the automatic surface area for calculating generation three-D grain model and volume, is shown by dialog box to user, specifically shown Example is with reference to Fig. 5 (a) and Fig. 5 (b).
It in a preferred embodiment, further include interactive measurement on the three-D grain model based on method generation of the invention Step, i.e., by obtaining user in the selection operation inputted on the screen, to determine a measured zone;Further according to screen and institute The transformational relation for stating texture model works back to the measured zone in the three-D grain model, the transformational relation it is specific Content are as follows: the two-dimensional plane coordinate for choosing screen is transformed into three-dimensional according to the proportionate relationship that Three-dimensional Display engine provides first In texture model coordinate system, then two-dimensional plane coordinate is zoomed in and out according to the focus information that Three-dimensional Display engine provides, most Afterwards by point nearest apart from two-dimensional plane coordinate in three-D grain model as the measured zone chosen.
By converting above, measurement point or survey grid are obtained;The measurement point or survey grid is measured zone warp Cross the one or more summits or grid on the obtained three-D grain model of above-mentioned correspondence.Specifically include: point measurement, straight line away from From measurement, region area measurement.
Point coordinate interaction measures:
Point coordinate interaction, which measures, to be referred to and chooses to obtain two-dimensional points on screen with mouse, according to screen and three-D grain The transformational relation of model works back to a two-dimensional points on screen in three-D grain model, finds one nearest from selected point The point that vertex in a three-D grain model is obtained as selection, and its three-dimensional coordinate (form XYZ) is output on screen, Display effect refers to Fig. 6 (a).
Linear distance interaction measures:
Direct election distance interaction measurement, which refers to, chooses to obtain a pair of of two-dimensional points on screen with mouse, according to screen and three-dimensional pattern This pair of two-dimensional points is worked back in three-D grain model, finds a pair three nearest from selected point by the transformational relation for managing model Endpoint of the vertex in texture model as straight line is tieed up, calculates the linear distance of two o'clock according to the following formula, and is displayed on the screen, is shown Show effect with reference to Fig. 6 (b).
Wherein, (X1 Y1 Z1),(X2 Y2 Z2) be two endpoints of straight line three-dimensional coordinate.D is linear distance.
Region area measurement:
Region area interaction measurement refers to draws out a measured zone frame with mouse on the screen, which can Figure to be rule is also possible to irregular polygonal region such as rectangle, circle.According to screen and three-D grain model Transformational relation, the region of measured zone frame is worked back in three-D grain model, and count drop into the measured zone Grid, surface area of the area for all grid that add up as measured zone, and be displayed on the screen, display effect refers to Fig. 6 (c) With Fig. 6 (d), the respectively display of the display renderings of rectangular area area interaction measurement and the interaction measurement of polygonal region area Effect picture.
It is the present embodiment that the embodiment of the invention also provides a kind of three-D grain model file generating means with reference to Fig. 7 The structural schematic diagram of three-D grain model file generating means.
The three-D grain model file generating means include:
First generation module 701 generates geometric point mould for detecting and obtaining the vertex data of default geometry grid model Type data block;
Second generation module 702 is used for according to the geometry grid model and photo, to the geometry grid model by top Point ground calculates texture coordinate, generates texture coordinate model data block;
Third generation module 703 for detecting and obtaining vertex, the height, width information of default photo, and extracts line by line The pixel data of the photo generates picture data block;
4th generation module 704, for establishing the top of the geometry grid model according to the geometric point model data block Point index;According to the picture data block, the print reference of the geometry grid model is established;According to the texture coordinate model Data block establishes the texture coordinate index of the geometry grid model;By the vertex index, print reference, texture coordinate rope Cause into geometry grid model data block.
It should be understood by those ordinary skilled in the art that: the above is only a specific embodiment of the present invention, and It is not used in the limitation present invention, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done, It should be included within protection scope of the present invention.

Claims (8)

1. a kind of generation method of three-D grain model file, is applied to preset geometry grid model and photo, feature exist In, comprising steps of
The vertex data of the geometry grid model is detected and obtained, geometric point model data block is generated;
According to the geometry grid model and photo, texture coordinate by vertex is calculated to the geometry grid model, generates line Manage coordinate model data block;
It detects and obtains the vertex of the photo, height, width information, and extract the pixel data of the photo line by line, generate Picture data block;
According to the geometric point model data block, the vertex index of the geometry grid model is established;According to the picture data Block establishes the print reference of the geometry grid model;According to the texture coordinate model data block, the geometry grid is established The texture coordinate index of model;The vertex index, print reference, texture coordinate index are generated into geometry grid model data Block;
The method further includes being loaded into step:
It is loaded into the geometric point model data block and geometry grid model data block, according to the vertex data and vertex index, Generate geometry grid model;
It is loaded into the picture data block, generates photo;Photo progress is compressed for n times, and carries out resampling, resampling Photograph pixel is recalculated using following formula in the process:
GI,J=(1-dx) * (1-dy) * Gi,j+dx*(1-dy)*Gi+1,j+dx*dy*Gi+1,j+1+(1-dx)*dy*Gi,j+1
Wherein Gi,jFor original pixels, GI,JFor compressed pixel, Gi+1,j, Gi+1,j+1, Gi,j+1For three adjacent pixel coordinates, Dx, dy are the fractional part of the determinant on compressed Determinant Mapping to original photo;
It is loaded into the texture coordinate model data block and geometry grid model data block, according to each vertex line of geometry grid model Coordinate, the texture coordinate index, the print reference and the photo are managed, the photo after resampling is mapped to described several In what grid model, three-D grain model is generated.
2. the method according to claim 1, wherein the step of calculating texture coordinate further comprises:
The geometry grid model and photo are subjected to alignment calibration, obtain the photo relative to the geometry grid model Focal length, principal point, position, direction;
A straight line is connected between a vertex and camera photocentre for the geometry grid model;
Record the coordinate (i, j) of the straight line Yu photo imaging plane intersection point;
Obtain texture coordinate (u, v) according to the following formula:
U=i/ (W-1)
V=(H-1-j)/(H-1)
Wherein, W is the width of the photo, and H is the height of the photo.
3. the method according to claim 1, wherein further comprising automatic measurement step:
Add up surface area of all grid areas on the three-D grain model as the three-D grain model, and shows;
By all grid on the three-D grain model, successively projection generates a polygon prism in the plane of Z=0, and add up institute There is volume of the volume of polygon prism as the three-D grain model, and shows.
4. the method according to claim 1, wherein further comprising interactive measuring process:
It obtains user and passes through measured zone determined by the selection operation inputted on the screen;
According to the transformational relation of screen and the three-D grain model, the measured zone is worked back into the three-D grain model In, obtain measurement point or survey grid;
According to the measurement point or survey grid, calculates and generate measurement result and show.
5. according to the method described in claim 4, it is characterized in that, when the measured zone be one when, by the three-dimensional As the measurement point, the measurement result is the coordinate of the measurement point on the vertex nearest from the point in texture model.
6. according to the method described in claim 4, it is characterized in that, when the measured zone is straight line, described in selection Two vertex nearest from the straight line two-end-point are as the measurement point in three-D grain model, calculate between the measurement point away from From as the measurement result.
7. according to the method described in claim 4, it is characterized in that, being counted when the measured zone is a polygonal region The grid in the polygonal region is fallen into the three-D grain model as the survey grid, add up all measurement lattice The area of net is as the measurement result.
8. a kind of generating means of three-D grain model file characterized by comprising
First generation module generates geometric point model data for detecting and obtaining the vertex data of default geometry grid model Block;
Second generation module, for by vertex being counted to the geometry grid model according to the geometry grid model and photo Texture coordinate is calculated, texture coordinate model data block is generated;
Third generation module for detecting and obtaining vertex, the height, width information of default photo, and extracts the photograph line by line The pixel data of piece generates picture data block;
4th generation module, for establishing the vertex index of the geometry grid model according to the geometric point model data block; According to the picture data block, the print reference of the geometry grid model is established;According to the texture coordinate model data block, Establish the texture coordinate index of the geometry grid model;The vertex index, print reference, texture coordinate index are generated several What grid model data block;
Described device is also used to be loaded into the geometric point model data block and geometry grid model data block, according to the number of vertex According to and vertex index, generate geometry grid model;
It is loaded into the picture data block, generates photo;Photo progress is compressed for n times, and carries out resampling, resampling Photograph pixel is recalculated using following formula in the process:
GI,J=(1-dx) * (1-dy) * Gi,j+dx*(1-dy)*Gi+1,j+dx*dy*Gi+1,j+1+(1-dx)*dy*Gi,j+1
Wherein Gi,jFor original pixels, GI,JFor compressed pixel, Gi+1,j, Gi+1,j+1, Gi,j+1For three adjacent pixel coordinates, Dx, dy are the fractional part of the determinant on compressed Determinant Mapping to original photo;
It is loaded into the texture coordinate model data block and geometry grid model data block, according to each vertex line of geometry grid model Coordinate, the texture coordinate index, the print reference and the photo are managed, the photo after resampling is mapped to described several In what grid model, three-D grain model is generated.
CN201510400686.8A 2015-07-09 2015-07-09 A kind of generation method and device of three-D grain model file Active CN106340062B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510400686.8A CN106340062B (en) 2015-07-09 2015-07-09 A kind of generation method and device of three-D grain model file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510400686.8A CN106340062B (en) 2015-07-09 2015-07-09 A kind of generation method and device of three-D grain model file

Publications (2)

Publication Number Publication Date
CN106340062A CN106340062A (en) 2017-01-18
CN106340062B true CN106340062B (en) 2019-05-17

Family

ID=57825861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510400686.8A Active CN106340062B (en) 2015-07-09 2015-07-09 A kind of generation method and device of three-D grain model file

Country Status (1)

Country Link
CN (1) CN106340062B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109712223B (en) * 2017-10-26 2020-11-03 北京大学 Three-dimensional model automatic coloring method based on texture synthesis
CN109189725B (en) * 2018-07-23 2020-09-18 广州都市圈网络科技有限公司 Regular building oriented OBJ file lossless compression method
CN110120088A (en) * 2019-03-29 2019-08-13 武汉方拓数字科技有限公司 A kind of synthetic method of textured structure three-dimensional model

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1514300A (en) * 2002-12-31 2004-07-21 �廪��ѧ Method of multi viewing angle x-ray stereo imaging and system
CN102637304A (en) * 2012-03-15 2012-08-15 中国科学院软件研究所 Method for synthesizing isotropic/anisotropic texture on geometric surface based on GPU (Graphics Processing Unit)
WO2015000108A1 (en) * 2013-07-01 2015-01-08 Mediatek Singapore Pte. Ltd. An improved texture merging candidate in 3dvc
CN104637089A (en) * 2015-02-15 2015-05-20 腾讯科技(深圳)有限公司 Three-dimensional model data processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9129432B2 (en) * 2010-01-28 2015-09-08 The Hong Kong University Of Science And Technology Image-based procedural remodeling of buildings

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1514300A (en) * 2002-12-31 2004-07-21 �廪��ѧ Method of multi viewing angle x-ray stereo imaging and system
CN102637304A (en) * 2012-03-15 2012-08-15 中国科学院软件研究所 Method for synthesizing isotropic/anisotropic texture on geometric surface based on GPU (Graphics Processing Unit)
WO2015000108A1 (en) * 2013-07-01 2015-01-08 Mediatek Singapore Pte. Ltd. An improved texture merging candidate in 3dvc
CN104637089A (en) * 2015-02-15 2015-05-20 腾讯科技(深圳)有限公司 Three-dimensional model data processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种粗精度三维模型的生成与快速显示方法;赵龙等;《计算机应用研究》;20110630;第28卷(第6期);第2382-2385页

Also Published As

Publication number Publication date
CN106340062A (en) 2017-01-18

Similar Documents

Publication Publication Date Title
KR102054250B1 (en) Method and apparatus for particle size determination
CN106683068B (en) Three-dimensional digital image acquisition method
US8487962B2 (en) Augmented reality system for a dental laboratory
US6621921B1 (en) Image processing apparatus
JP4025442B2 (en) 3D model conversion apparatus and method
CN106504188B (en) Generation method and device for the eye-observation image that stereoscopic vision is presented
US20150279087A1 (en) 3d data to 2d and isometric views for layout and creation of documents
JP6573419B1 (en) Positioning method, robot and computer storage medium
CN109035388A (en) Three-dimensional face model method for reconstructing and device
CN110390719A (en) Based on flight time point cloud reconstructing apparatus
CN103456038A (en) Method for rebuilding three-dimensional scene of downhole environment
JP4058293B2 (en) Generation method of high-precision city model using laser scanner data and aerial photograph image, generation system of high-precision city model, and program for generation of high-precision city model
CN107440811A (en) Tooth axle estimates program and contour data creating program and its apparatus and method
JP2000516360A (en) Three-dimensional object modeling apparatus and method
CN108805936A (en) Join scaling method, device and electronic equipment outside video camera
CN109544628A (en) A kind of the accurate reading identifying system and method for pointer instrument
CN102136140B (en) Rectangular pattern-based video image distance detecting method
CN107146287B (en) Two-dimensional projection image to threedimensional model mapping method
CN107895048A (en) It is a kind of that drawing method is quickly gone out based on outdoor scene three-dimensional
CN106340062B (en) A kind of generation method and device of three-D grain model file
CN103544492B (en) Target identification method and device based on depth image three-dimension curved surface geometric properties
CN106327576B (en) A kind of City scenarios method for reconstructing and system
JP2003115042A (en) Method for evaluating three-dimensional shape model and method and device for generating the model
JP7273284B2 (en) Data generation method, device and program
CN113505626A (en) Rapid three-dimensional fingerprint acquisition method and system

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