CN108898679A - A kind of method of component serial number automatic marking - Google Patents

A kind of method of component serial number automatic marking Download PDF

Info

Publication number
CN108898679A
CN108898679A CN201810358259.1A CN201810358259A CN108898679A CN 108898679 A CN108898679 A CN 108898679A CN 201810358259 A CN201810358259 A CN 201810358259A CN 108898679 A CN108898679 A CN 108898679A
Authority
CN
China
Prior art keywords
point
value
pixel
matrix
boundary
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.)
Granted
Application number
CN201810358259.1A
Other languages
Chinese (zh)
Other versions
CN108898679B (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.)
Ningbo Dahongying University
Original Assignee
Ningbo Dahongying 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 Ningbo Dahongying University filed Critical Ningbo Dahongying University
Priority to CN201810358259.1A priority Critical patent/CN108898679B/en
Publication of CN108898679A publication Critical patent/CN108898679A/en
Application granted granted Critical
Publication of CN108898679B publication Critical patent/CN108898679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/004Annotating, labelling

Landscapes

  • Engineering & Computer Science (AREA)
  • Architecture (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Image Analysis (AREA)

Abstract

The present invention relates to a kind of methods of component serial number automatic marking,This method carries out monochromatic rendering by the components to 3-dimensional digital product under the same Visual window,Then grayscale image is converted by monochromatic rendering result figure,Then the two-dimensional silhouette boundary for extracting components is scanned to grayscale image,And discretization is carried out to boundary,Triangle gridding is carried out to two-dimensional shapes further according to the boundary profile of discretization,Form the triangle meshes model with vertex and face side information,Accurate geodesic algorithm is reused to calculate using each vertex of triangle gridding as the geodetic field of source point,And pass through the mass center of geodesic distance field computation two-dimensional grid model,Target point to be marked is equidistantly generated by quadrilateral area in the periphery of components rendering figure,Again using center of mass point as source point,Mark point is that an Euclidean distance matrix is calculated in target point,Establish objective optimization function and be calculated source point to target point optimal line result,To guarantee the optimality and uniqueness of components mark.

Description

A kind of method of component serial number automatic marking
Technical field
The present invention relates to product mark field more particularly to a kind of methods of component serial number automatic marking.
Background technique
Carrying out orderly mark to industrial products components is an essential procedure, mesh in industrial products production process It is preceding to be widely used computer aided design and manufacture (CAD/CAM) technology in Mechanical Engineering Design and manufacturing field, although The CAD/CAM integrated software such as Pro/E, UG, Solidwork and Catia is generally used, but plant technology file is all to scheme Sample is expressed, and usually completes 3D moulding by above-mentioned CAD/CAM software, then change into engineering drawing, completes mark etc. in AUTOCAD platform Work, in the mark for completing installation diagram using AUTOCAD, it is necessary to write serial number to components, the softwares such as AUTOCAD itself do not have There is the order of Direct Mark component serial number, is generally completed a serial number mark, needs with setting-out (line) or lead (leader) picture index wire is removed in order, then again with TEXT (text) order write-in part sequence number.A mark is completed, is at least needed More than ten of operating procedure is wanted, not only speed is slow, low efficiency, when especially component number is more, repetitive operation large labor intensity, Part sequence number will input every time by hand, and the final position for marking text needs hand-guided, more casual, and figure is unsightly, difficult To meet national mechanical drawing standard, though there is the program of some serial number marks at present, intelligence degree is insufficient, needs manual intervention It is more, it to input compared with multi-parameter, it is some when the shape of Moulds Based on Three-Dimensional Models being projected out in two-dimensional engineering graphic is complex The components that the marking line that software automatically generates is directed toward can have error and attend marking line intersection.
Summary of the invention
In view of the above-mentioned state of the art, the technical problem to be solved by the present invention is to provide for the above-mentioned prior art It is a kind of directly to carry out automatic sequence number for the components of Moulds Based on Three-Dimensional Models and carry out regular mark from the mass center of components Note, and can be avoided zero mark note line and intersect, and mark a kind of fireballing method of component serial number automatic marking.
The present invention solves technical solution used by above-mentioned technical problem:A kind of side of component serial number automatic marking Method in turn includes the following steps:
It is W with width in Windowing application program that step (1), which will need the 3-dimensional digital product model being labeled, height It spends the resolution ratio for H and fixes a three-dimensional view angle in rectangular coordinate system O-XYZ and all components of product are successively carried out Monochrome rendering.
After one components of 3-dimensional digital product are carried out monochromatic rendering by step (2), from the background to current rendering window As a result the parametric image I of a width RGBA is saved asrgb, resolution ratio is W × H, and IrgbIt is converted into grayscale image Igray
Step (3) is according to obtained grayscale image Igray, the value of any point pixel non-1 is 0, if it is boundary Then the pixel value of the point is 1, and at least there is 0 pixel in its neighborhood in point.Use 2 × 2 neighborhood territory pixel regions Grayscale image is scanned, then four pixel values obtain and have 0,1,2,3,4 five kind of situation, when pixel and be 0 when, illustrate four pixels Point is completely black point, when pixel and when being 4, illustrate four pixels for full white point, this is not borderline region.It when pixel and is 1 or 2 Or when 3, illustrate that existing 0 pixel also has 1 pixel, boundary pixel region point set as to be treated in 4 points.Therefore logical 2 × 2 neighborhood territory pixels are crossed to grayscale image IgrayIt is progressively scanned, and brushes and select pixel and the pixel region equal to 1 or 2 or 3, made It is described with the adjacent edge 4-, marks 1 pixel in all pixel regions for meeting condition, to obtain all pictures Plain boundary point set Boundary.
Step (4) assigns one two according to the location of pixels of all boundary point set Boundary for each boundary point BP Spatial value (x, y), x, y are boundary point BP in grayscale image IgrayIn pixel abscissa and ordinate position, and according to Boundary profile carries out trigonometric ratio to two-dimensional shapes.
The triangle meshes model with vertex V and face side E information is formed after the trigonometric ratio of step (5) two-dimensional shapes boundary, It is calculated using accurate geodesic algorithm using each vertex of triangle gridding as the geodetic arenas of source point, and is left the theatre meter by geodesic distance Calculate the mass center of two-dimentional triangle meshes model.Wherein, the centroid calculation following steps (5-1) of two-dimensional shapes arrive step (5-4).
Step (5-1), which calculates, leaves the theatre inside triangle meshes by the geodesic distance of source point to other each points of a vertex Dfiled, and pass through formulaCalculate average value of the point to other geodesic distances, ρ in formula (x) it is the density gone out in vertex x, usually takes ρ (x)=1, dg(x, y) is the inner distance of point y to point x.
Step (5-2) passes through formulaCalculate the mass center inside triangle grid model Point, c are the centroid position of two-dimensional shapes.
Step (5-3) establishes energy functionGradient descent method can be used to be solved, ladder Spend functionIt is permanent just and bounded, the convergence of the energy function can obtain by E (y) To guarantee.
The geometry mass center of step (5-4) computational geometry body needs to minimize formulaThe energy Flow function, and its gradient functionMiddle gradient vectorWith clear Geometric meaning, can track to obtain by the shortest path from x to y, direction be the shortest path end direction, length 1, In the concrete realization, it should be noted that following problems, (1) when y runs out of boundary, by the way that the new and old position line of y is asked with surface The mode of friendship retracts y, and the minimum of the moment of inertia E (y) of (2) based on inner distance is not necessarily unique, therefore we are random It chooses 10 different initial values and E (y) is separately optimized, and take optimal y as geometry mass center.
Step (6) is calculated using all N number of components that the method for step (1)-step (5) is three-dimensional numerical value product Corresponding two dimension center of mass point position collection { c1, c2L cn}。
It is W that step (7), which is established with width, is highly the quadrilateral area of H, is existed using length spaceLen as spacing distance Uniform sampling generates M point on the quadrilateral area of W × H, wherein M >=N, presses to M and is ranked up and as production counterclockwise The target point of product mark.
The centroid position of step (8) components in order to obtain is directed only to a target point and each center of mass point and mesh Not intersecting continuously for punctuate, establishes objective optimization functionWherein dijFor i-th (1≤i≤M) a center of mass point To the Euclidean distance of jth (1≤j≤N) label target point, the restrictive condition of objective optimization function is And Xij∈ { 1,0 }, solving optimization objective function following steps (8-1) and step (8-2).
Step (8-1) calculates the Euclidean distance that N number of centroid position point marks point of destination to M, forms an Euclidean distance Matrix disMatrix.
Step (8-2) transformed distances matrix disMatrix, arranges each row respectively and 0 element occurs.Distance matrix The every row element of disMatrix all subtracts the row least member;The every column element of distance matrix disMatrix all subtracts the column smallest element Element.
Step (8-3) establishes one and marks matrix signMatrix as distance matrix disMatrix line number and columns, And the value for marking all elements in matrix signMatrix is initialized as 1, line identifier vector lineVector (N number of number altogether Value), column mark vector rowVector (total M numerical value), the initial value of two mark vector elements is 0.
Step (8-4) is searched for since distance matrix disMatrix the first row, if only one neutral element of the row, record The position (i, j) of neutral element, the corresponding value in position (i, j) is denoted as 0 on label matrix signMatrix, in distance matrix The i-th row is traversed in disMatrix and jth column element value is the position (m, n) where 0, in the label position matrix signMatrix (m, n) corresponding value is denoted as 2.If label all rows of matrix signMatrix have 0 element, step (9) are jumped to.
Since step (8-5) search for marking matrix signMatrix the first row, if it is 0 that the row, which does not have the value of element, Line number i is recorded, and i-th of element of mark vector lineVector is assigned a value of 1 (i.e. lineVector (i)=1).
Step (8-6) traverses other rows in label matrix signMatrix again, if it is 2 that the row, which does not have the value of element, record Line number i, and find out value in the row and be 0 row number j, and i-th of element of mark vector rowVector is assigned a value of 1 (i.e. RowVector (i)=1).
Step (8-7) finds out position i and the mark vector rowVector intermediate value that mark vector lineVector intermediate value is 1 For 1 position j, on all i-th rows and not the smallest value u of element in jth column in distance matrix disMatrixij
Step (8-8) subtracts u in the value of all i rows in distance matrix disMatrixij(the wherein element that element value is 0 No longer subtract each other), u is added in the value of all j rowsij
The step of step (8-9) repeats the above steps (8-4) to step (8-9).
Step (9) carries out traversal to find out value being " 0 " to each row of the optimal distance matrix disMatrix solved Element, and be recorded as sequence to collection (i, j), and by X on final rendering figureij=1 i-th (1≤i≤M) a center of mass point arrives Jth (1≤j≤N) label target point carries out line for marking.
Compared with the prior art, the advantages of the present invention are as follows:Firstly, by three-dimensional components to be marked same in the present invention It is rendered under one visual angle window, and obtains the two-dimensional shapes monochrome rendering figure of three-dimensional components, convert ash for rendering figure Degree figure and the boundary profile for obtaining two-dimensional shapes carry out triangle gridding to two-dimensional shapes by the boundary profile got, then The mass center that geodetic line method is calculated inside two-dimensional shapes is further used, to simplify two-dimentional irregular shape matter The calculating step of the heart, while in turn avoiding centroid position and possibly being present at outside shape and mark is caused the problem of error occur, It is secondary, optimization method is marked by establishing components, and set the constraint condition of mark, forms the final mark knot of each components Fruit not only ensure that each mark starting point was to point out inside components, but also can be avoided marking line and form friendship between each other Fork, ensure that the mark of components can be marked according to the preset rule of user, improves the mark speed of components.
Detailed description of the invention
Fig. 1 is flow diagram of the invention.
Specific embodiment
Below in conjunction with attached drawing, a specific embodiment of the invention is described in further detail, so that technical solution of the present invention is more It should be readily appreciated that and grasp.
As shown in Figure 1, a kind of method of component serial number automatic marking, in turn includes the following steps:
It is W with width in Windowing application program that step (1), which will need the 3-dimensional digital product model being labeled, height It spends the resolution ratio for H and fixes a three-dimensional view angle in rectangular coordinate system O-XYZ and all components of product are successively carried out Monochrome rendering
3-dimensional digital product model is established using common modeling tool (such as 3dMax, Solidwork), according to corresponding text Each components of model are carried out classification reading and management by the reading of part storage format implementation model file.Using common Figure API (such as OpenGL, DirectX) establishes three-dimensional graphics renderer program windows, and background color is set as white.
After one components of 3-dimensional digital product are carried out monochromatic rendering by step (2), from the background to current rendering window As a result the parametric image I of a width RGBA is saved asrgb, resolution ratio is W × H, and IrgbIt is converted into grayscale image Igray
The resolution ratio of rendering program is set as W × H, fixes rendering program model matrix, visual matrix, successively to three dimensions Each components of word product model render components with the same color in program windows, and save corresponding Rendering result forms the cromogram comprising RGB, will be colored by formula Gray=(R*299+G*587+B*114+500)/1000 Figure is converted into grayscale image Igray
Step (3) is according to obtained grayscale image Igray, the value of any point pixel non-1 is 0, if it is boundary Then the pixel value of the point is 1, and at least there is 0 pixel in its neighborhood in point.Use 2 × 2 neighborhood territory pixel regions Grayscale image is scanned, then four pixel values obtain and have 0,1,2,3,4 five kind of situation, when pixel and be 0 when, illustrate four pixels Point is completely black point, when pixel and when being 4, illustrate four pixels for full white point, this is not borderline region.It when pixel and is 1 or 2 Or when 3, illustrate that existing 0 pixel also has 1 pixel, boundary pixel region point set as to be treated in 4 points.Therefore logical 2 × 2 neighborhood territory pixels are crossed to grayscale image IgrayIt is progressively scanned, and brushes and select pixel and the pixel region equal to 1 or 2 or 3, made It is described with the adjacent edge 4-, marks 1 pixel in all pixel regions for meeting condition, to obtain all pictures Plain boundary point set Boundary.
Step (4) assigns one two according to the location of pixels of all boundary point set Boundary for each boundary point BP Spatial value (x, y), x, y are boundary point BP in grayscale image IgrayIn pixel abscissa and ordinate position, and according to Boundary profile carries out trigonometric ratio to two-dimensional shapes.
The triangle meshes model with vertex V and face side E information is formed after the trigonometric ratio of step (5) two-dimensional shapes boundary, It is calculated using accurate geodesic algorithm using each vertex of triangle gridding as the geodetic arenas of source point, and is left the theatre meter by geodesic distance Calculate the mass center of two-dimentional triangle meshes model.Wherein, the centroid calculation following steps (5-1) of two-dimensional shapes arrive step (5-4).
Step (5-1), which calculates, leaves the theatre inside triangle meshes by the geodesic distance of source point to other each points of a vertex Dfiled, and pass through formulaCalculate average value of the point to other geodesic distances, ρ in formula (x) it is the density gone out in vertex x, usually takes ρ (x)=1, dg(x, y) is the inner distance of point y to point x.
Step (5-2) passes through formulaCalculate the mass center inside triangle grid model Point, c are the centroid position of two-dimensional shapes.
Step (5-3) establishes energy functionGradient descent method can be used to be solved, ladder Spend functionIt is permanent just and bounded, the convergence of the energy function can obtain by E (y) To guarantee.
The geometry mass center of step (5-4) computational geometry body needs to minimize formulaThe energy Flow function, and its gradient functionMiddle gradient vectorWith clear Geometric meaning, can track to obtain by the shortest path from x to y, direction be the shortest path end direction, length 1. In the concrete realization, it should be noted that following problems, (1) when y runs out of boundary, by the way that the new and old position line of y is asked with surface The mode of friendship retracts y, and the minimum of the moment of inertia E (y) of (2) based on inner distance is not necessarily unique, therefore we are random It chooses 10 different initial values and E (y) is separately optimized, and take optimal y as geometry mass center.
Step (6) is calculated using all N number of components that the method for step (1)-step (5) is three-dimensional numerical value product Corresponding two dimension center of mass point position collection { c1, c2L cn}。
It is W that step (7), which is established with width, is highly the quadrilateral area of H, is existed using length spaceLen as spacing distance Uniform sampling generates M point on the quadrilateral area of W × H, and wherein M >=N. presses M and is ranked up and as production counterclockwise The target point of product mark.
The centroid position of step (8) components in order to obtain is directed only to a target point and each center of mass point and mesh Not intersecting continuously for punctuate, establishes objective optimization functionWherein dijFor i-th (1≤i≤M) a mass center Point arrives the Euclidean distance of jth (1≤j≤N) label target point, and the restrictive condition of objective optimization function isAnd Xij∈ { 1,0 }.Solving optimization objective function following steps (8-1) and step (8-2):
Step (8-1) calculates the Euclidean distance that N number of centroid position point marks point of destination to M, forms an Euclidean distance Matrix disMatrix.
Step (8-2) transformed distances matrix disMatrix, arranges each row respectively and 0 element occurs.Distance matrix The every row element of disMatrix all subtracts the row least member;The every column element of distance matrix disMatrix all subtracts the column smallest element Element.
Step (8-3) establishes one and marks matrix signMatrix as distance matrix disMatrix line number and columns, And the value for marking all elements in matrix signMatrix is initialized as 1, line identifier vector lineVector (N number of number altogether Value), column mark vector rowVector (total M numerical value), the initial value of two mark vector elements is 0.
Step (8-4) is searched for since distance matrix disMatrix the first row, if only one neutral element of the row, record The position (i, j) of neutral element, the corresponding value in position (i, j) is denoted as 0 on label matrix signMatrix, in distance matrix The i-th row is traversed in disMatrix and jth column element value is the position (m, n) where 0, in the label position matrix signMatrix (m, n) corresponding value is denoted as 2.If label all rows of matrix signMatrix have 0 element, step (9) are jumped to.
Since step (8-5) search for marking matrix signMatrix the first row, if it is 0 that the row, which does not have the value of element, Line number i is recorded, and i-th of element of mark vector lineVector is assigned a value of 1 (i.e. lineVector (i)=1).
Step (8-6) traverses other rows in label matrix signMatrix again, if it is 2 that the row, which does not have the value of element, record Line number i, and find out value in the row and be 0 row number j, and i-th of element of mark vector rowVector is assigned a value of 1 (i.e. RowVector (i)=1).
Step (8-7) finds out position i and the mark vector rowVector intermediate value that mark vector lineVector intermediate value is 1 For 1 position j, on all i-th rows and not the smallest value u of element in jth column in distance matrix disMatrixij
Step (8-8) subtracts u in the value of all i rows in distance matrix disMatrixij(the wherein element that element value is 0 No longer subtract each other), u is added in the value of all j rowsij
The step of step (8-9) repeats the above steps (8-4) to step (8-9).
Step (9) carries out traversal to find out value being " 0 " to each row of the optimal distance matrix disMatrix solved Element, and be recorded as sequence to collection (i, j), and by X on final rendering figureij=1 i-th (1≤i≤M) a center of mass point arrives Jth (1≤j≤N) label target point carries out line for marking.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although Present invention has been described in detail with reference to the aforementioned embodiments, it will be understood by those of skill in the art that it still can be right Technical solution documented by foregoing embodiments is modified, or is replaced on an equal basis to part of technical characteristic;And this It modifies or replaces, the spirit and model of technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution It encloses.

Claims (1)

1. a kind of method of component serial number automatic marking carries out automatic connecting mark for the components to 3-dimensional digital product Note, which is characterized in that in turn include the following steps:
Step (1) will need the 3-dimensional digital product model being labeled to be W with width in Windowing application program, be highly The resolution ratio of H and a three-dimensional view angle is fixed in rectangular coordinate system O-XYZ monochrome is successively carried out to all components of product Rendering.
After one components of 3-dimensional digital product are carried out monochromatic rendering by step (2), from the background to the result of current rendering window Save as the parametric image I of a width RGBArgb, resolution ratio is W × H, and IrgbIt is converted into grayscale image Igray
Step (3) is according to obtained grayscale image Igray, the value of any point pixel non-1 is 0, if it is boundary point, that The pixel value of the point is 1, and at least there is 0 pixel in its neighborhood.Using 2 × 2 neighborhood territory pixel regions to ash Degree figure is scanned, then four pixel values obtain and have 0,1,2,3,4 five kind of situation, when pixel and be 0 when, illustrate that four pixels are It is completely black, when pixel and when being 4, illustrate four pixels for full white point, this is not borderline region.It when pixel and is 1 or 2 or 3 When, illustrate that existing 0 pixel also has 1 pixel, boundary pixel region point set as to be treated in 4 points.Therefore pass through 2 × 2 neighborhood territory pixels are to grayscale image IgrayIt is progressively scanned, and brushes and select pixel and the pixel region equal to 1 or 2 or 3, used The adjacent edge 4- is described, and marks 1 pixel in all pixel regions for meeting condition, to obtain all pixels Boundary point set Boundary.
Step (4) assigns two spaces according to the location of pixels of all boundary point set Boundary for each boundary point BP Coordinate value (x, y), x, y are boundary point BP in grayscale image IgrayIn pixel abscissa and ordinate position, and according to boundary Profile carries out trigonometric ratio to two-dimensional shapes.
The triangle meshes model with vertex V and face side E information is formed after the trigonometric ratio of step (5) two-dimensional shapes boundary, is used Accurate geodesic algorithm is calculated using each vertex of triangle gridding as the geodetic arenas of source point, and passes through geodesic distance field computation two Tie up the mass center of triangle meshes model.Wherein, the centroid calculation following steps (5-1) of two-dimensional shapes arrive step (5-4).
Step (5-1) is calculated and is left the theatre D inside triangle meshes using a vertex as the geodesic distance of source point to other each pointsfiled, And pass through formulaCalculate the point to other geodesic distances average value, in formula ρ (x) be The density that vertex x goes out, usually takes ρ (x)=1, dg(x, y) is the inner distance of point y to point x.
Step (5-2) passes through formulaThe center of mass point inside triangle grid model is calculated, c is For the centroid position of two-dimensional shapes.
Step (5-3) establishes energy functionGradient descent method can be used to be solved, gradient letter NumberIt is permanent just and bounded, the constringency performance of the energy function access guarantor by E (y) Card.
The geometry mass center of step (5-4) computational geometry body needs to minimize formulaThe energy letter Number, and its gradient functionMiddle gradient vectorWith specific several What meaning, can track to obtain by the shortest path from x to y, and direction is the end direction of the shortest path, and length 1 is having During body is realized, it should be noted that following problems, (1) when y runs out of boundary, by the way that the new and old position line of y and surface are asked friendship Mode retracts y, and the minimum of the moment of inertia E (y) of (2) based on inner distance is not necessarily unique, therefore we randomly select E (y) is separately optimized in 10 different initial values, and takes optimal y as geometry mass center.
Correspondence is calculated using all N number of components that the method for step (1)-step (5) is three-dimensional numerical value product in step (6) Two-dimentional center of mass point position collection { c1, c2L cn}。
It is W that step (7), which is established with width, is highly the quadrilateral area of H, using length spaceLen as spacing distance in W × H Quadrilateral area on uniform sampling generate M point, wherein M >=N, press a to M is ranked up and as product mark counterclockwise The target point of note.
The centroid position of step (8) components in order to obtain is directed only to a target point and each center of mass point and target point Continuously do not intersect, establish objective optimization functionWherein dijIt is arrived for i-th (1≤i≤M) a center of mass point The Euclidean distance of jth (1≤j≤N) label target point, the restrictive condition of objective optimization function areAnd Xij∈ { 1,0 }, solving optimization objective function following steps (8-1) and step (8-2).
Step (8-1) calculates the Euclidean distance that N number of centroid position point marks point of destination to M, forms an Euclidean distance matrix disMatrix。
Step (8-2) transformed distances matrix disMatrix, arranges each row respectively and 0 element occurs.Distance matrix disMatrix is every Row element all subtracts the row least member;The every column element of distance matrix disMatrix all subtracts the column least member.
Step (8-3) establishes one and marks matrix signMatrix as distance matrix disMatrix line number and columns, and will The value of all elements is initialized as 1 in label matrix signMatrix, and line identifier vector lineVector (N number of numerical value altogether) is arranged Mark vector rowVector (total M numerical value), the initial value of two mark vector elements are 0.
Step (8-4) is searched for since distance matrix disMatrix the first row, if only one neutral element of the row, records null element The position (i, j) of element, the corresponding value in position (i, j) is denoted as 0 on label matrix signMatrix, in distance matrix The i-th row is traversed in disMatrix and jth column element value is the position (m, n) where 0, in the label position matrix signMatrix (m, n) corresponding value is denoted as 2.If label all rows of matrix signMatrix have 0 element, step (9) are jumped to.
Since step (8-5) search for marking matrix signMatrix the first row, if it is 0 that the row, which does not have the value of element, records Line number i, and i-th of element of mark vector lineVector is assigned a value of 1 (i.e. lineVector (i)=1).
Step (8-6) traverses other rows in label matrix signMatrix again, if it is 2 that the row, which does not have the value of element, records line number I, and find out value in the row and be 0 row number j, and i-th of element of mark vector rowVector is assigned a value of 1 (i.e. RowVector (i)=1).
It is 1 that step (8-7), which finds out the position i that mark vector lineVector intermediate value is 1 and mark vector rowVector intermediate value, Position j, on all i-th rows and not the smallest value u of element in jth column in distance matrix disMatrixij
Step (8-8) subtracts u in the value of all i rows in distance matrix disMatrixij(element that wherein element value is 0 is no longer Subtract each other), u is added in the value of all j rowsij
The step of step (8-9) repeats the above steps (8-4) to step (8-9).
Step (9) carries out traversal to each row of the optimal distance matrix disMatrix solved and finds out the member that value is " 0 " Element, and sequence is recorded as to collection (i, j), and by X on final rendering figureij=1 i-th (1≤i≤M) a center of mass point is to jth (1 ≤ j≤N) label target point carries out line for marking.
CN201810358259.1A 2018-04-10 2018-04-10 Automatic labeling method for serial numbers of parts Active CN108898679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810358259.1A CN108898679B (en) 2018-04-10 2018-04-10 Automatic labeling method for serial numbers of parts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810358259.1A CN108898679B (en) 2018-04-10 2018-04-10 Automatic labeling method for serial numbers of parts

Publications (2)

Publication Number Publication Date
CN108898679A true CN108898679A (en) 2018-11-27
CN108898679B CN108898679B (en) 2023-07-21

Family

ID=64342236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810358259.1A Active CN108898679B (en) 2018-04-10 2018-04-10 Automatic labeling method for serial numbers of parts

Country Status (1)

Country Link
CN (1) CN108898679B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231500A (en) * 2019-06-28 2021-01-15 上海理工大学 Method for adjusting three-dimensional digital-analog engineering drawing serial number position
CN112509131A (en) * 2020-11-20 2021-03-16 上海莉莉丝网络科技有限公司 Rendering method, system and computer readable storage medium for map area boundary in game map
CN115879186A (en) * 2023-03-01 2023-03-31 北京天圣华信息技术有限责任公司 Method, device and equipment for determining placement position of part number and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110206273A1 (en) * 2010-02-25 2011-08-25 Christian Plagemann Intelligent Part Identification for Use with Scene Characterization or Motion Capture
CN102568038A (en) * 2011-12-28 2012-07-11 西北工业大学 Method for translating dimensions on two-dimensional engineering drawing to three-dimensional CAD (computer aided design) model
CN103400372A (en) * 2013-07-10 2013-11-20 中国科学技术大学 Three-dimensional topological information extraction method based on Reeb graph description
CN103971415A (en) * 2014-05-23 2014-08-06 南京大学 Online marking method for three-dimensional model component
CN106157375A (en) * 2016-07-06 2016-11-23 南京大学 A kind of threedimensional model component categories automatic marking method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110206273A1 (en) * 2010-02-25 2011-08-25 Christian Plagemann Intelligent Part Identification for Use with Scene Characterization or Motion Capture
CN102568038A (en) * 2011-12-28 2012-07-11 西北工业大学 Method for translating dimensions on two-dimensional engineering drawing to three-dimensional CAD (computer aided design) model
CN103400372A (en) * 2013-07-10 2013-11-20 中国科学技术大学 Three-dimensional topological information extraction method based on Reeb graph description
CN103971415A (en) * 2014-05-23 2014-08-06 南京大学 Online marking method for three-dimensional model component
CN106157375A (en) * 2016-07-06 2016-11-23 南京大学 A kind of threedimensional model component categories automatic marking method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CHEN KZ 等: ""Intelligent dimensioning for mechanical parts based on feature extraction"", 《COMPUTER-AIDED DESIGN》 *
周驰 等: ""利用线性规划解决模具零件自动标注的尺寸重叠问题"", 《锻压装备与制造技术》 *
王福胜: ""二维装配图零部件序号标注智能布局方法"", 《图学学报》 *
陈能仑 等: ""几何质心的定义和计算"", 《计算机辅助设计与图形学学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231500A (en) * 2019-06-28 2021-01-15 上海理工大学 Method for adjusting three-dimensional digital-analog engineering drawing serial number position
CN112509131A (en) * 2020-11-20 2021-03-16 上海莉莉丝网络科技有限公司 Rendering method, system and computer readable storage medium for map area boundary in game map
US11887255B2 (en) 2020-11-20 2024-01-30 Shanghai Lilith Network Technology Company Limited Method and system for rendering boundary of map area within game map, and computer-readable storage medium
CN115879186A (en) * 2023-03-01 2023-03-31 北京天圣华信息技术有限责任公司 Method, device and equipment for determining placement position of part number and storage medium

Also Published As

Publication number Publication date
CN108898679B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN109993827B (en) Elevation view identification method for converting building drawing into three-dimensional BIM model
CN100407798C (en) Three-dimensional geometric mode building system and method
CN109145352B (en) Data set for learning a function taking an image as input
CN106713923A (en) Compression of a three-dimensional modeled object
CN108171780A (en) A kind of method that indoor true three-dimension map is built based on laser radar
CN107833273B (en) Oblique photography three-dimensional model objectification application method based on three-dimensional simulation model
CN101599181B (en) Real-time rendering method of algebra B-spline surface
CN112633657B (en) Construction quality management method, device, equipment and storage medium
CN109887030A (en) Texture-free metal parts image position and posture detection method based on the sparse template of CAD
CN109118588B (en) Automatic color LOD model generation method based on block decomposition
CN108898679A (en) A kind of method of component serial number automatic marking
CN103838829A (en) Raster vectorization system based on hierarchical boundary-topology search model
CN105760570A (en) Viewpoint selection in the redering of a set of objects
CN109544687B (en) Directional layered household graph expansion method
CN114359226A (en) Three-dimensional model set visual area extraction method based on hierarchical superposition and region growth
CN115937461B (en) Multi-source fusion model construction and texture generation method, device, medium and equipment
US10650586B2 (en) Automated mesh generation
Hu et al. Geometric feature enhanced line segment extraction from large-scale point clouds with hierarchical topological optimization
CN115641322A (en) Robot grabbing method and system based on 6D pose estimation
CN108230442A (en) A kind of shield tunnel three-dimensional emulation method
Zhang et al. A geometry and texture coupled flexible generalization of urban building models
Ying et al. Synthetic image data generation using bim and computer graphics for building scene understanding
CN115953780B (en) Intelligent generation method and system for complex scene graph of multidimensional light field
CN112052489B (en) Method and system for generating house type graph
TW202135007A (en) Method for processing three-dimensional point cloud data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 315000 no.899 Xueyuan Road, Haishu District, Ningbo City, Zhejiang Province

Applicant after: Ningbo Institute of Finance and Economics

Address before: 315000 Lugang, Gaoqiao, Xijiao, Ningbo, Zhejiang Province

Applicant before: NINGBO DAHONGYING University

GR01 Patent grant
GR01 Patent grant