CN-122018830-A - Typesetting method, typesetting equipment, medium and program product for typesetting while beating and beating
Abstract
A typesetting method, typesetting equipment, medium and program product with beating and printing relate to the technical field of image processing and intelligent printing. On the basis of converting an original image into structured data and performing global mapping, typesetting equipment can detect whether an image-text module with close logic association is cracked by a folding line or blocked by a hole by dividing consumable materials into a main visual area, an auxiliary visual area and an avoidance area and constructing a semantic adhesion cluster by combining the spatial adjacency between objects. If collision occurs, the limitation of global scaling is broken, and the local scaling and offset coordinates are independently calculated for the sticky cluster to be adjusted. The deducing process of the multidimensional characteristic interaction effectively avoids the problems of visual blind areas and semantic rupture of the traditional two-dimensional typesetting under a complex three-dimensional pasting scene, and improves the integrity and the transmission accuracy of graphic information of special labels (such as flag shapes and winding labels) in practical physical application.
Inventors
- LI JIANGUO
- LIU ZIQI
Assignees
- 北京硕方信息技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260410
Claims (10)
- 1. A beat-to-beat typesetting method, characterized by being applied to typesetting equipment, the method comprising: Inputting an original shooting image into a preset image recognition model, and outputting a structured data list containing a plurality of preset object types, wherein objects in the structured data list contain corresponding source image data, corresponding type identifiers and mapping space coordinate parameters in the original shooting image; after determining a global scaling factor of the original shooting image in a preset two-dimensional target printing coordinate system according to a document boundary, mapping space coordinate parameters of each object in the structured data list to the two-dimensional target printing coordinate system by utilizing the global scaling factor to generate preliminary layout data, wherein the document boundary is determined based on object distribution characteristics in the structured data list; Determining a physical deformation boundary of a consumable to be printed under a target three-dimensional topological form based on the original shot image and a preset application scene configuration instruction, and dividing a consumable printable area of the consumable to be printed into a main visual area and an auxiliary visual area which are at non-coplanar visual angles and an avoidance area with structural blockage based on the physical deformation boundary; traversing the mapping space coordinate parameters of each object in the structured data list, calculating the space adjacency between two objects, and determining a plurality of objects with the space adjacency higher than a preset threshold as semantic adhesion clusters; Under the condition that a projection area with the target semantic adhesion cluster mapped by the global scaling factor spans the boundary between the main vision area and the auxiliary vision area or covers the avoidance area is determined, calculating the local scaling and offset coordinates of the target semantic adhesion cluster falling into the main vision area or the auxiliary vision area; and updating the preliminary layout data according to the local scaling and the offset coordinates to obtain final layout data.
- 2. The method according to claim 1, wherein the step of determining a physical deformation boundary of the consumable to be printed in the target three-dimensional topological form based on the original captured image and the preset application scene configuration instruction, and dividing the printable area of the consumable to be printed into a main view area and a secondary view area at non-coplanar visual angles based on the physical deformation boundary, and a dodging area with structural blockage specifically comprises: Determining a target three-dimensional topological form and an estimated section size of a target physical carrier corresponding to the document based on background environment image features outside the document boundary in the original photographed image; determining a virtual three-dimensional folding model matched with the target three-dimensional topological form from a preset consumable folding mapping library; Substituting the estimated section size and the two-dimensional geometric size of the consumable to be printed into the virtual three-dimensional folding model for simulation, determining the projection coordinates of the virtual three-dimensional folding model on a two-dimensional unfolding plane, and taking the projection coordinates as physical deformation boundaries of the consumable to be printed under a target topological form; And dividing a continuous area which is positioned on a starting plane and has a single orthogonal visual angle in a consumable printable area of the consumable to be printed into the main visual area, dividing the continuous area which is subjected to angle deflection due to crossing the physical deformation boundary into the auxiliary visual area, and dividing an assembly hole site area and a physical gap area reserved on the consumable to be printed into the avoidance area.
- 3. The method according to claim 2, wherein the step of determining the target three-dimensional topological morphology and the estimated cross-sectional size of the target physical carrier corresponding to the document based on the background environmental image features located outside the document boundary in the original captured image specifically comprises: Extracting background environment image features outside the document boundary in the original photographed image, and performing edge gradient detection on a gray matrix corresponding to the background environment image features to determine an environment edge binary image; performing Hough straight line transformation of preset angle resolution and preset distance resolution on the environment edge binary image, and determining a plurality of groups of parameterized straight lines with the peak value of the accumulator larger than a preset cut-off threshold value; determining parallel contour boundary line segments with parallelism errors lower than an allowable threshold and exceeding the document boundary from the plurality of groups of parameterized straight lines; according to the outline deformation distortion rate of the closed area surrounded by the parallel outline boundary line segments, mapping the closed area into a preset geometric primitive library for matching, and determining the three-dimensional topological form of the target; After the reference physical size carried in the preset application scene configuration instruction is obtained, calculating a mapping proportionality coefficient of the reference physical size and a first pixel span value based on the first pixel span value of the document boundary in the original photographed image, wherein the reference physical size is a known one-dimensional absolute length of the document in the real world; And determining the product of the mapping proportionality coefficient and the second pixel span value as the estimated section size based on the second pixel span value of the parallel outline boundary line segment pair in the original photographed image.
- 4. The method according to claim 3, wherein the step of mapping the closed region to a preset geometric primitive library for matching according to the deformation distortion rate of the contour of the closed region surrounded by the parallel contour boundary line segments, and determining the three-dimensional topological morphology of the target specifically includes: After orthogonal projection rays are made on the basis of the vertexes of the document boundaries to the parallel outline boundary line segments, under the condition that a topological closed area surrounded by the orthogonal projection rays and the parallel outline boundary line segments is determined to contain the document boundaries, the topological closed area is used as a two-dimensional orthographic projection area of the target physical carrier; Extracting a light and shadow gradient vector of a background pixel in the two-dimensional orthographic projection area, and combining the outline distortion rate of the topological closed area to form an area structure descriptor; and executing feature space matching on the region structure descriptor and a preset geometric primitive library, and determining a geometric solid with the highest confidence interval as the target three-dimensional topological form.
- 5. The method according to claim 1, wherein said step of calculating local scale and offset coordinates of said target semantic sticky clusters falling within said primary or secondary view region comprises: Extracting an initial cluster width, an initial cluster height and an initial center point coordinate from a global circumscribed rectangle of the target semantic sticky cluster in the preliminary layout data based on the global circumscribed rectangle; determining a target area larger than the global circumscribed rectangle, and determining the width, the height and the coordinates of a target center point of an effective area of the target area, wherein the target area is the unoccupied main visual area or the auxiliary visual area; under the constraint condition that the ratio of the initial cluster width to the initial cluster height is kept unchanged, calculating a first ratio of the effective area width to the initial cluster width and a second ratio of the effective area height to the initial cluster height; Determining the local scaling based on the smaller of the first ratio and the second ratio and a preset safety margin coefficient; and after the global circumscribed rectangle is scaled according to the local scaling ratio to obtain a target circumscribed rectangle, calculating a required transverse translation distance and a longitudinal translation distance when a central point of the target circumscribed rectangle is aligned to a target central point coordinate, and determining a two-dimensional vector containing the transverse translation distance and the longitudinal translation distance as the offset coordinate.
- 6. The method according to claim 1, wherein the step of traversing the mapped spatial coordinate parameters of each object in the structured data list, calculating a spatial adjacency between two objects, and determining a plurality of objects with spatial adjacencies higher than a preset threshold as semantic sticky clusters specifically comprises: Traversing the mapping space coordinate parameters of each object in the structured data list, and calculating the space physical distance between two objects; Based on the type identifiers of the two objects, determining corresponding semantic association coefficients from a preset type association matrix, wherein elements in the type association matrix define logic interdependence degrees among different preset object types; Weighting and calculating the space physical distance through the semantic association coefficient to obtain the space adjacency between the two objects; taking all objects in the structured data list as nodes, establishing an undirected edge between two nodes with the spatial adjacency higher than a preset threshold value, and constructing an object topological graph; And extracting each maximum connected subgraph in the object topological graph, and determining each maximum connected subgraph as the semantic sticky cluster.
- 7. The method according to claim 1, wherein the step of updating the preliminary layout data according to the local scale and the offset coordinates to obtain final layout data comprises: Based on the local scaling and the offset coordinates, performing spatial adjustment on objects contained in the target semantic adhesion clusters in the preliminary layout data, and generating updated cluster occupation outer frame areas; Traversing the discrete objects which do not belong to the target semantic adhesion clusters in the preliminary layout data, and carrying out Boolean intersection operation on the mapping space coordinate parameters of the discrete objects and the updated cluster occupation outer frame area to determine affected discrete objects with overlapped positions; The updated cluster occupation outer frame area and the avoidance area are used as joint barrier boundaries, and blank projection points with shortest mapping space coordinate parameters from the affected discrete objects are determined for the affected discrete objects; generating secondary offset coordinates for moving the affected discrete object to a corresponding blank projection point, and correcting the position of the affected discrete object in the preliminary layout data by utilizing the secondary offset coordinates; and recombining the data subjected to the target semantic adhesion cluster space adjustment and the data subjected to the position correction of all the discrete object data to obtain the final layout data.
- 8. A typesetting apparatus comprising one or more processors and memory coupled to the one or more processors, the memory to store computer program code comprising computer instructions that the one or more processors invoke to cause the typesetting apparatus to perform the method of any of claims 1-7.
- 9. A computer program product comprising instructions which, when run on a typesetting apparatus, cause the typesetting apparatus to perform the method of any of claims 1-7.
- 10. A computer readable storage medium comprising instructions which, when run on a typesetting apparatus, cause the typesetting apparatus to perform the method of any one of claims 1-7.
Description
Typesetting method, typesetting equipment, medium and program product for typesetting while beating and beating Technical Field The application relates to the technical field of image processing and intelligent printing, in particular to a typesetting method, typesetting equipment, medium and program product for typesetting while photographing. Background With the development of mobile internet and portable printing equipment, the mobile terminal beat-to-beat technology is widely applied to the fields of asset management, warehouse logistics, machine room cable identification and the like. Users often need to shoot old equipment nameplates, specifications or paper labels through application programs mounted on mobile terminals such as smart phones, and rapidly copy and print extracted image-text contents on new special blank label consumable materials. In the related art, various texts and graphic elements in a shooting picture are often extracted by utilizing an image recognition algorithm, a two-dimensional external rectangular frame which is independent of each other is generated, and then the absolute physical width and the absolute height of consumable materials in a printer which is connected currently are obtained. And calculating the global scaling ratio of the overall size of the source image and the planar size of the target consumable, taking all independent image-text elements as free layout blocks according to the scaling ratio and a two-dimensional geometric collision rule, sequentially scaling and tiling the free layout blocks, filling the free layout blocks into the two-dimensional printable plane of the target consumable, and generating final printing image data on the premise of ensuring that the image-text elements do not exceed the physical boundary of the consumable. However, in a complex application scenario such as power inspection or a communication room, a printed special label (such as a flag label, a wound label, or a folded label) is often not flatly attached, but is required to be attached to an area through a physical deformation step such as folding in half, winding in around, or the like. The geometric scaling and stream avoidance of the related technology may cause that in the typesetting and adapting process, the associated primitives (such as warning triangle icons and description characters at the bottom of the warning triangle icons) which are originally closely connected in the source image are unexpectedly distributed to two sides of the label pair folding line or the curved surface extension line, so that the information transmission accuracy rate is reduced. Disclosure of Invention The application provides a typesetting method, typesetting equipment, medium and program product for improving the information transmission accuracy of carrier graphic and text information of complex application scenes. In a first aspect, the application provides a typesetting method with shooting and printing, which is applied to typesetting equipment, and comprises the steps of inputting an original shooting image into a preset image recognition model, outputting a structured data list containing a plurality of preset object types, dividing an object in the structured data list into a main view area and a subsidiary view area which are positioned at a non-coplanar visual angle and have structural blocking according to a document boundary, mapping the mapping space coordinate parameters of each object in the structured data list to a two-dimensional target printing coordinate system by utilizing the global scaling factor after determining the global scaling factor of the original shooting image in a preset two-dimensional target printing coordinate system, generating preliminary layout data, determining the document boundary based on object distribution characteristics in the structured data list, determining the physical deformation boundary of consumable materials to be printed in a target three-dimensional topological form based on the original shooting image and a preset application scene configuration instruction, dividing the consumable material printable area of the consumable materials to be printed into a main view area and a subsidiary view area which are positioned at a non-coplanar visual angle and a semantic blocking area based on the physical deformation boundary, traversing the mapping space coordinate parameters of each object in the structured data list to the two-dimensional target printing coordinate system, calculating the mapping space coordinate parameters of each object in the structured data list to the two-dimensional target printing coordinate system, determining the semantic view area to be adjacent to the adjacent to each other through the two-dimensional cluster, determining the adjacent space between the two object adjacent clusters and the adjacent space cluster as the adjacent space cluster and the adjacent space domain, and updating the preliminary layout