CN116934628A - Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium - Google Patents

Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium Download PDF

Info

Publication number
CN116934628A
CN116934628A CN202310965421.7A CN202310965421A CN116934628A CN 116934628 A CN116934628 A CN 116934628A CN 202310965421 A CN202310965421 A CN 202310965421A CN 116934628 A CN116934628 A CN 116934628A
Authority
CN
China
Prior art keywords
fragment
tree
target
images
fragment image
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.)
Pending
Application number
CN202310965421.7A
Other languages
Chinese (zh)
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.)
Jinan University
Original Assignee
Jinan 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 Jinan University filed Critical Jinan University
Priority to CN202310965421.7A priority Critical patent/CN116934628A/en
Publication of CN116934628A publication Critical patent/CN116934628A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Multimedia (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Biomedical Technology (AREA)
  • Medical Informatics (AREA)
  • Genetics & Genomics (AREA)
  • Molecular Biology (AREA)
  • Physiology (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a residual piece restoration method and a storage medium based on a large-scale collaborative genetic algorithm, wherein the method comprises the following steps: identifying edge point sets corresponding to a plurality of fragment images, and determining the edge similarity of the fragment images based on the corresponding edge point sets; grouping a plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and performing Prufer coding based on target information of the first fragment image groups to generate a gene coding sequence; performing genetic evolution processing on a plurality of gene coding sequences based on a preset genetic algorithm to obtain first spanning trees corresponding to each first fragment image group, and combining the plurality of first spanning trees by using a preset large-scale cooperative algorithm to obtain a first global tree; and according to the first fitness of each second spanning tree of the first global tree, carrying out genetic evolution operation updating on the plurality of second spanning trees, generating a target global tree, and splicing fragment images based on a target splicing tree corresponding to the target global tree.

Description

Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium
Technical Field
The application relates to the technical field of computers, in particular to a residual piece restoration method based on a large-scale collaborative genetic algorithm and a storage medium.
Background
Computer-aided splicing is an emerging technology for integrating cultural relic restoration into computational intelligence, namely, by scanning fragment information (corresponding cultural relic fragments) by means of a computer and inputting the fragment information into the computer to form fragment modeling data, and then, a certain measurement mode is adopted to exhaust and splice corresponding fragments, so that the work of restoring the residual fragments is accelerated.
In the related art, the recovery of the residual piece is divided into two parts by using a computer, wherein one part is matched, the other part is solved, and the matching is usually spliced based on distance, content and characteristics; for solving, because the large-scale restoration problem is NP difficult (NP-hard problem), for solving the combined optimization problem, genetic algorithm, ant colony algorithm and tabu search algorithm are often adopted in the related art to solve, but when solving the complex combined optimization problem, the conventional optimization algorithm can only meet the requirement of local solution, has poor robustness, can not carry out deep search and realize global optimal solution, and has low efficiency of incomplete restoration and poor splicing effect.
Aiming at the problems that the scheme for restoring the incomplete fragments in the related technology cannot carry out deep search and solve the global optimal solution so that the incomplete fragments are low in restoration efficiency and poor in splicing effect, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the application provides a residue restoration method and a storage medium based on a large-scale collaborative genetic algorithm, which at least solve the problems that a residue restoration scheme in the related technology cannot perform deep search and solve a global optimal solution, so that the residue restoration efficiency is low and the splicing effect is poor.
In a first aspect, an embodiment of the present application provides a method for restoring a residual piece based on a large-scale collaborative genetic algorithm, including: identifying an edge point set corresponding to each fragment image in a plurality of fragment images to be restored, and determining the edge similarity corresponding to the fragment images based on the edge point sets corresponding to the fragment images; grouping a plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and performing Prufer coding based on target information of the first fragment image groups to generate a plurality of gene coding sequences, wherein the target information is used for representing the fragment images of the first fragment image groups; performing genetic evolution processing on the plurality of gene coding sequences based on a preset genetic algorithm to obtain a first spanning tree corresponding to each first fragment image group, and combining the plurality of first spanning trees by using a preset large-scale collaborative algorithm to obtain a first global tree, wherein the first global tree comprises a plurality of second spanning trees used for representing splicing relation information in a second fragment image group, and the genetic evolution operation at least comprises one of the following steps: random tournament selection, genetic crossover, and genetic mutation; determining a first fitness corresponding to each second spanning tree, updating the plurality of second spanning trees by genetic evolution operation according to the first fitness to generate a target global tree, and splicing the plurality of fragment images based on a target splicing tree obtained by decoding the target global tree, wherein the first fitness is used for representing the precision of fragment splicing in a corresponding fragment image group.
In a second aspect, an embodiment of the present application provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for restoration of fragments based on a large-scale collaborative genetic algorithm as described in the first aspect above.
Compared with the related art, the method and the storage medium for restoring the fragments based on the large-scale collaborative genetic algorithm provided by the embodiment of the application are characterized in that the edge point set corresponding to each fragment image is identified in a plurality of fragment images to be restored, and the edge similarity corresponding to the fragment images is determined based on the edge point sets corresponding to the fragment images; grouping a plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and performing Prufer coding based on target information of the first fragment image groups to generate a plurality of gene coding sequences; performing genetic evolution processing on a plurality of gene coding sequences based on a preset genetic algorithm to obtain first spanning trees corresponding to each first fragment image group, and combining the plurality of first spanning trees by utilizing a preset large-scale cooperative algorithm to obtain a first global tree, wherein the first global tree comprises a plurality of second spanning trees used for representing splicing relation information in a second fragment image group; determining a first fitness corresponding to each second spanning tree, performing genetic evolution operation update on a plurality of second spanning trees according to the first fitness to generate a target global tree, splicing a plurality of fragment images based on a target splicing tree obtained by decoding the target global tree, and solving the large-scale problem by utilizing fragment edge information to splice and performing incomplete restoration based on a large-scale collaborative genetic algorithm and utilizing grouping collaborative evolution to realize deep search on a solution space so as to quickly obtain a global optimal solution and further perform restoration and splicing on the incomplete, thereby solving the problems that the scheme for restoring the incomplete cannot perform deep search and solve the global optimal solution in the related art so as to lead the restoration efficiency of the incomplete to be low and the splicing effect to be poor.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a block diagram of a hardware architecture of a terminal of a method for restoration of fragments based on a large-scale collaborative genetic algorithm according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of restoration of debris based on a large scale collaborative genetic algorithm according to an embodiment of the present application;
FIG. 3 is a flow chart of a process optimization method according to a preferred embodiment of the present application;
fig. 4 is a block diagram of a construction of a fragment restoration apparatus based on a large-scale collaborative genetic algorithm according to an embodiment of the present application.
Detailed Description
The present application will be described and illustrated with reference to the accompanying drawings and examples in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by a person of ordinary skill in the art based on the embodiments provided by the present application without making any inventive effort, are intended to fall within the scope of the present application. Moreover, it should be appreciated that while such a development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as having the benefit of this disclosure.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly and implicitly understood by those of ordinary skill in the art that the described embodiments of the application can be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," and similar referents in the context of the application are not to be construed as limiting the quantity, but rather as singular or plural. The terms "comprising," "including," "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The term "multi-link" as used herein refers to a number of links greater than or equal to two. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., "a and/or B" may mean: a exists alone, A and B exist together, and B exists alone. The terms "first," "second," "third," and the like, as used herein, are merely distinguishing between similar objects and not representing a particular ordering of objects.
Before explaining the embodiments of the present application, the related art related to the embodiments of the present application is explained as follows:
in the matching of computer-aided mosaics, mainly matching mosaics based on distance, content and features are involved, wherein,
based on the matching of the distances, the dimension reduction is carried out according to the fragment edge vectors, various matched metric functions are provided, and if the distance between the two edge vectors is smaller, the joint degree is high.
Based on the content, the descriptor of the fragment texture or the neural network is adopted for recognition and splicing, and the requirements on the quality of the fragment texture are high.
Based on the characteristics, the characteristics of local color, gray scale, gradient and the like are synthesized to form a characteristic descriptor, and two fragments are subjected to traversal matching.
The least square method is a mathematical tool widely applied in the fields of data processing such as error estimation, uncertainty, system identification, prediction, forecast and the like; the method can simply and conveniently calculate unknown data by using a least square method by minimizing the square sum of errors to find the optimal function matching of the data, and the square sum of errors between the calculated data and actual data is minimized.
Genetic algorithm (Genetic Algorithm, GA) is a computational model of the biological evolution process simulating the natural selection and genetic mechanism of the darwinian biological evolution theory, and the solving process of the problem is converted into processes like crossing, mutation and the like of chromosome genes in the biological evolution in a mathematical manner.
Prufer coding is a way to convert a root-free tree into a sequence, the tree of n nodes (node number 1 … n) can uniquely correspond to an n-2 bit Prufer sequence, and the n-2 bit Prufer sequence can also uniquely correspond to a tree of n nodes (node number 1..n).
The Douglas-pramipexole algorithm (Douglas-Peucker algorithm, also known as the labelmerger-Douglas-pramipexole algorithm, the iterative adaptive point algorithm, the split and merge algorithm) is an algorithm that approximately represents a curve as a series of points and reduces the number of points.
The Kruskal algorithm is a method for solving the minimum/maximum spanning tree of the connected network, and the basic idea of solving the minimum spanning tree of the network by the Kruskal algorithm is as follows: assuming that the connected network g= (V, E), let the initial state of the minimum spanning tree be a non-connected graph t= (V, { }) with n vertices and no edges, summarizing that each vertex in the graph is self-connected to a connected component, selecting an edge with the smallest cost in E, if the vertex to which the edge is attached is respectively on different connected components in T, adding the edge into T; otherwise, the edge is discarded and the next least costly edge is selected. And so on until all vertices in T constitute a connected component.
The method embodiment provided in this embodiment may be executed in a terminal, a computer or a similar computing device. Taking the operation on the terminal as an example, fig. 1 is a hardware structure block diagram of the terminal of the residual fragment restoration method based on the large-scale collaborative genetic algorithm according to the embodiment of the present application. As shown in fig. 1, the terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting on the structure of the terminal described above. For example, the terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for restoring fragments based on a large-scale collaborative genetic algorithm in an embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the above-mentioned method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
The embodiment provides a method for restoring the residual piece based on the large-scale collaborative genetic algorithm, which is operated on the terminal, and fig. 2 is a flowchart of the method for restoring the residual piece based on the large-scale collaborative genetic algorithm according to the embodiment of the application, as shown in fig. 2, the flowchart includes the following steps:
in step S201, in the plurality of fragment images to be restored, the edge point set corresponding to each fragment image is identified, and the edge similarity corresponding to the fragment image is determined based on the edge point sets corresponding to the plurality of fragment images.
In this embodiment, the fragment image is a digital image obtained by scanning scattered relic fragments; after obtaining the patch images, edges of each patch image are extracted, for example: filtering, extracting edges, binarizing according to a set threshold value, identifying an edge point set of each piece of fragment image, and performing cubic spline interpolation on the identified edge point set to finish up-sampling so as to form sub-pixel edges by expanding the distribution density of the sub-pixel edges; in this embodiment, after the edge point set is obtained, the similarity of the patch images is measured based on the edge point set, and it should be understood that the measurement of the edge similarity of the patch images may use an existing image similarity detection algorithm, for example: the edge similarity of the patch image is measured based on a least square method.
Step S202, grouping a plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and performing Prufer coding based on target information of the first fragment image groups to generate a plurality of gene coding sequences, wherein the target information is used for representing fragment images of the first fragment image groups.
In this embodiment, after determining the edge similarity of the patch images, the plurality of patch images are grouped based on the edge similarity, that is, the patch images are initially spliced by preliminary grouping, and when the edge similarity of the two patch images is greater, the effect of splicing and restoring the two patch images is better; in this embodiment, the first fragment image group obtained by grouping has already achieved preliminary stitching; in order to optimize the local stitching corresponding to the patch group, a genetic algorithm is adopted to solve and optimize the local stitching, it can be understood that in the local stitching, one patch image can only be stitched with another patch image, but one patch image can be stitched by a plurality of other patch images, that is, one patch image can be selected from the plurality of patch images to stitch, so in the embodiment, a Prufer array is adopted as a gene code to model the stitching problem as a maximum spanning tree problem, that is, the Prufer code is performed based on the target information of the first patch image group to generate a plurality of gene code sequences; in this embodiment, r-2 random numbers (repeatable) between 0 and r-1 are randomly generated as gene coding sequences of one species (corresponding to one first fragment image group) according to the rule of prufer coding, where r represents the fragment number of the first fragment image group; it will be appreciated that, when a first group of fragmented images includes the edge similarity between the fragmented images and the fragmented images, and the group generates the first group of fragmented images, the corresponding target information is correspondingly generated, for example: the fragment codes of the fragment images in the first fragment image group and the number of the fragment images are used as target information of the first fragment image group, and the target information of the first fragment image group can also comprise edge similarity between the fragment images, and when the Prufer codes are performed to generate a gene coding sequence and generate a corresponding spanning tree, the corresponding edge similarity is used as a weight of a corresponding individual or branch.
Step S203, carrying out genetic evolution processing on a plurality of gene coding sequences based on a preset genetic algorithm to obtain a first spanning tree corresponding to each first fragment image group, and merging the plurality of first spanning trees by utilizing a preset large-scale collaborative algorithm to obtain a first global tree, wherein the first global tree comprises a plurality of second spanning trees used for representing splicing relation information in a second fragment image group, and the genetic evolution operation at least comprises one of the following steps: random tournament selection, genetic crossover, and genetic mutation.
In the embodiment, when genetic evolution processing is performed, a random tournament selection operator, a single-point crossover operator and a single-point mutation operator are adopted, and the genetic evolution operation according to the embodiment of the application is related to the prior art and comprisesIs clear and practicable; in some of these alternative embodiments, a random tournament selection operator is employed, such as: for species (for one gene coding sequence) set K t Randomly selecting K individuals, evaluating the K individuals, and selecting the optimal one of the K individuals to enter the next generation K t+1 The iterative process is repeated until the next generation species scale K t+1 Up to the specified population size K 0 The method comprises the steps of carrying out a first treatment on the surface of the Meanwhile, genetic crossover processing is performed by adopting a single-point crossover algorithm, for example: randomly selecting a point loc in the genome of the two individuals i and j, and exchanging the same part in the genes of the individuals i and j to finish the crossover; furthermore, single point mutations are used for genetic mutation treatment, for example: for gene coding sequencesSelecting any position loc, enabling the value of G at the loc to be re-valued to be 0-r-1, and re-evaluating the individual to finish mutation; in some of these alternative embodiments, the population size K is set 0 At a tournament selectivity P of 50 c 5% of variation probability P m Is 0.1 and the crossover probability P ex 0.8.
In this embodiment, global optimization is performed by using a large-scale collaborative algorithm, that is, collaborative optimization is performed on all first spanning trees generated by decoding genetic code sequences that complete genetic evolution operations, and a distribution solution obtained based on the genetic algorithm is converted into a global optimal solution, so that all the generated first spanning trees need to be combined into a first global tree to perform global optimal solution optimization processing; in this embodiment, after the first global tree is synthesized, the second spanning tree of the first global tree corresponds to the first spanning tree before the merging, i.e., the second spanning tree is a reference of the first spanning tree under the first global tree.
Step S204, determining a first fitness corresponding to each second spanning tree, performing genetic evolution operation update on the plurality of second spanning trees according to the first fitness to generate a target global tree, and splicing the plurality of fragment images based on the target splicing tree obtained by decoding the target global tree, wherein the first fitness is used for representing the precision of fragment splicing in the corresponding fragment image group.
In this embodiment, after the current first global tree is generated, the fitness corresponding to each second spanning tree is calculated, that is, the average fitness of the fragment image packets corresponding to each second spanning tree is detected, so as to determine whether the fragment image packets corresponding to the second spanning tree need to be corrected, and when the correction is needed, that is, when the splicing relationship of the corresponding fragment images needs to be corrected, the fragment images in the fragment image packets corresponding to the second spanning tree are updated, for example: removing part of the fragment images from the corresponding fragment image groups, removing fragment images in other fragment image groups, so that the splicing relation of the fragment images in the corresponding fragment image groups is corrected, and splicing the fragment images by performing genetic evolution operation in the fragment image groups or performing Kruskal maximum spanning tree calculation until each fragment image group does not need to be corrected, further converting a distribution solution into a global optimal solution, when a first global tree which is the global optimal solution is determined, the first global tree is used as a target global tree, and then splicing the fragment images by using the splicing relation of the fragment images corresponding to all second spanning trees corresponding to the target global tree, so as to obtain an expected output image; in this embodiment, the patch images are spliced based on the splicing relationship represented by the target global tree, and the patch images may be spliced by affine transformation.
Through the steps S201 to S204, identifying an edge point set corresponding to each fragment image from the plurality of fragment images to be restored, and determining an edge similarity corresponding to the fragment image based on the edge point sets corresponding to the plurality of fragment images; grouping a plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and performing Prufer coding based on target information of the first fragment image groups to generate a plurality of gene coding sequences; performing genetic evolution processing on a plurality of gene coding sequences based on a preset genetic algorithm to obtain a first spanning tree corresponding to each first fragment image group, and combining the plurality of first spanning trees by utilizing a preset large-scale collaborative algorithm to obtain a first global tree, wherein the first global tree comprises a plurality of second spanning trees used for representing splicing relation information in a second fragment image group; determining a first fitness corresponding to each second spanning tree, performing genetic evolution operation update on a plurality of second spanning trees according to the first fitness to generate a target global tree, splicing a plurality of fragment images based on a target splicing tree obtained by decoding the target global tree, and solving the large-scale problem by utilizing fragment edge information for splicing and performing residue restoration based on a large-scale collaborative genetic algorithm and utilizing grouping collaborative evolution, so that a solution space is searched deeply to quickly obtain a global optimal solution, and further, restoration and splicing are performed on the residues with high efficiency, thereby solving the problems that the residue restoration scheme in the related art cannot perform depth search and solve the global optimal solution, and the problem of low residue restoration efficiency and poor splicing effect are solved.
In some embodiments, identifying a set of edge points corresponding to each patch image among a plurality of patch images to be restored includes the steps of:
and step 21, preprocessing a first digital image corresponding to each fragment image obtained by scanning, wherein the preprocessing comprises median filtering noise reduction processing and binarization processing.
And step 22, carrying out edge extraction on the preprocessed digital image through an edge detection operator to obtain a first point set, wherein the edge detection operator comprises a Canny operator.
Step 23, processing the first point set based on a cubic spline interpolation segmentation expression, generating a sub-pixel edge point set, and then performing downsampling on the sub-pixel edge point set based on local curvature entropy by using an interpolation expression method to reconstruct and generate the edge point set.
In the embodiment, performing cubic spline interpolation on the first point set to finish up-sampling, and amplifying the distribution density of the up-sampling to form a sub-pixel edge; then, the interpolation expression is utilized to carry out secondary downsampling according to the information entropy H (P) derived from the local curvature, and the edge point set is reconstructed and generated.
Preprocessing a first digital image corresponding to each fragment image obtained through scanning in the steps; performing edge extraction on the preprocessed digital image through an edge detection operator to obtain a first point set; after the first point set is processed based on the cubic spline interpolation segmentation expression, the sub-pixel edge point set is generated, and then is downsampled based on local curvature entropy by utilizing the interpolation expression method, the edge point set is generated by reconstruction, edge scanning and edge information amplification are realized, and data is provided for calculating the edge similarity of the fragment image.
In some embodiments, determining the edge similarity corresponding to the patch images based on the edge point sets corresponding to the patch images includes the steps of:
and step 31, grouping edge point sets corresponding to each fragment image by utilizing a track compression Douglas Peucker segmentation method to obtain contour segment groups, wherein each contour segment group corresponds to a coarse granularity.
And step 32, grouping the contour segments corresponding to one target fragment image with the contour segments corresponding to all the matching fragment images respectively, and performing least square matching to obtain a first pixel pair, wherein the target fragment image comprises one of a plurality of fragment images, the matching fragment image comprises one of all fragment images except the target fragment image in the plurality of fragment images, and the first pixel pair is used for representing two contour segment groups with minimum residual energy between the target fragment image and the matching fragment image.
Step 33, a left pixel pair set and a right pixel pair set formed by second pixel pairs distributed on two sides of the first pixel pair are obtained, the left pixel pair set and the right pixel pair set are sequentially traversed from the first pixel pair, when the distance between the traversed first pixel pair and the second pixel pair is larger than a preset threshold value, a first point set and a second point set are determined from edge points corresponding to the traversed second pixel pair, wherein the second pixel pair comprises two outline segment groups corresponding to a target side fragment image and a matching side fragment image, the first point set comprises edge points corresponding to the target side fragment image, and the second point set comprises edge points corresponding to the matching side fragment image.
And step 34, respectively determining a first projection vector corresponding to the first point set and a second projection vector corresponding to the second point set, and determining a first metric coefficient according to Euclidean distances of the first projection vector and the second projection vector, wherein the first metric coefficient is used for representing the matching degree of the contour segments corresponding to all the second pixels traversed by the target side fragment image and the matching side fragment image.
And step 35, calculating the edge similarity between the target fragment image and the matching fragment image according to the residual energy corresponding to the first pixel pair, the first metric coefficient and the logarithm of the traversed second pixel pair.
In this embodiment, the Douglas Peucker segmentation method is used to group the fragment edge point sets, and then coarse granularity matching of the least squares method is performed according to the following logic:
step 1, selecting one fragment image to be recorded as a target fragment image, selecting another different fragment image as a matching party fragment image, grouping i on one contour segment of the target fragment image, and matching the edge point set corresponding to the matching party fragment image.
Step 2, setting an edge point set corresponding to the target side fragment image asSetting an edge point set { P } corresponding to a matching formula fragment image j And (3) performing walking on the edge of the matching square fragment image, and calculating least square matching according to the following formula when walking to one position:
s.t.
A∈R 2×2 ,B∈R 2
s 1 ≤L 1 s 2 ≤L 2 l≤min{L 1 ,L 2 }
wherein A, B is affine transformation operator, A is scaling factor, B is translation factor; l (L) k The optimization target of the least square method is to find the optimal A, B to minimize the residual energy, P and Q are points on two curve segments, s is a starting point, and l is a matching length; based on the above solving problem, an equation T (a 1 ,a 2 ,b 1 ,b 2 ) T =h, the stagnation point can be directly found:
(a 1 ,a 2 ,b 1 ,b 2 )=T -1 H
wherein T is a matrix, which represents the coefficient of the equation set, and H is the constant of the equation set; x is x p And y p Representing the abscissa, x of the curve segment point P q And y q And the abscissa and ordinate of the curve segment point Q are similar, a convolution structure exists in a standing point formula of H, a rapid convolution algorithm is used for improving the operation speed, and the characteristic L value is obtained as follows:
the L value represents the minimum residual energy that can be achieved by the least squares method in the optimal case.
Step 3, calculating to obtain the minimum residual energy L of the position, and recording all the minimum residual energy obtained in the process of one circle of walkMinimum->And recording affine operators A and B at the position point and sequence numbers +.about.where the contour segment groups corresponding to the two fragment images at the position are located >The contour segments corresponding to the two sequence numbers are grouped into a first pixel pair.
Step 4, the target fragment image and the matching fragment image are respectively obtained from the following stepsThe numbered pixels (forming the first pixel pair) start to expand to two sides, and during the expansion process, the matched pixel pair is recorded (i.e. the corresponding distance is smaller than the preset threshold value):
wherein G is match To fit the pixel pair set, d t Is a threshold (the value is 0.95-1).
Step 5, separating the points belonging to the target side fragment image and the points belonging to the matching side fragment image to obtain a set respectively At->Respectively connected with the head and the tail to form a straight line +.>Projecting the two point sets on straight lines respectively, and forming two dimension-reducing vectors by taking the projection length as an element>The cosine distance of the two vectors is calculated as a correction coefficient beta (corresponding to the first metric coefficient), and the minimum residual energy L, the correction coefficients beta and G are calculated match The number of elements of (1) is calculated according to the following formula to form a new metric function SE, namely "similar energy" corresponding to the edge similarity pair:
in the embodiment, the edge information based on the fragment edge modeling is adopted, only the edge information of the fragment image is used for splicing, and the high-efficiency splicing is ensured by using an accelerating least square method and a fine granularity verification mechanism through an information quantity amplification algorithm.
It should be noted that, in the above steps 31 to 35, after the minimum residual energy is matched based on the least square method, the features representing the similarity of the two fragment images are expanded from the minimum residual energy point to two sides, that is, the relevant data of the contour segments of the corresponding areas on two sides of the minimum residual energy point are taken as the data of the corresponding areas in one dimension for measuring the relativity, and the linear projection mapping, the cosine similarity calculation and the length measurement of the corresponding contour segments are performed, so that the parameters for measuring the similarity of the corresponding fragment images are obtained from the edge contour segments on two sides of the minimum residual energy point, and the new dimension measurement data is introduced on the basis of measuring the edge similarity with the minimum residual energy, so that the measurement result can more represent the edge similarity of the two fragment images.
In some embodiments, grouping the plurality of patch images according to the edge similarity results in a plurality of first patch image groupings, comprising the steps of: traversing edge similarity corresponding to the plurality of fragment images, and grouping at least two fragment images with the edge similarity within a preset similarity range to obtain a plurality of first fragment image groups, wherein one fragment image only belongs to one first fragment image group.
In some of these embodiments, prufer encoding is performed based on target information of the first fragment image packet to generate a plurality of gene-encoded sequences, comprising the steps of:
step 41, obtaining fragment codes and the number of fragment images corresponding to all fragment images in the target information of each first fragment image group.
In the present embodiment, the target information of the first patch group includes patch codes of patch images, the number of patch images, and edge similarities between patch images.
Step 42, generating a first gene code corresponding to the first fragment image group based on the fragment codes, and generating a group code corresponding to the first fragment image group according to the first gene code and the number of fragment images.
In the present embodiment, when one first patch image group has r patch images, k is the patch code of the patch image k in the first patch image group, then the correspondingly generated first gene code may be usedRepresenting, i.e. n k A genetic value representing a first group of fragmented images; meanwhile, setting the edge point set corresponding to each fragment image in each first fragment image group as N, and generating group codes according to the first gene codes and the number of the fragment images by using a numbering list The number list is used for representing the set of all fragment images of the corresponding first fragment image group, and fragment images of the first fragment image group can be corresponding to the number list.
And 43, carrying out natural number mapping on the group codes, and carrying out random number generation on the array after the natural number mapping according to a Prufer coding rule to obtain a gene coding sequence corresponding to the corresponding first fragment image group, wherein the gene coding sequence comprises a preset number of random numbers.
In the present embodiment, the block codes are mapped by natural numbers, i.e., the list of labels is mapped by natural numbers, i.e.In this example, according to the rules of Prufer coding (see description of Prufer coding above), r-2 (corresponding numbers) random numbers (repeatable) between 0 and r-1 (corresponding gene values) are randomly generated as the gene codes, i.e., gene coding sequences, of a species.
Obtaining fragment codes and the number of fragment images corresponding to all fragment images in the target information of each first fragment image group in the steps; generating a first gene code corresponding to the first fragment image group based on the fragment codes, and generating a group code corresponding to the first fragment image group according to the first gene code and the number of fragment images; and carrying out natural number mapping on the group codes, carrying out random number generation on the array after the natural number mapping according to a Prufer coding rule to obtain a gene coding sequence corresponding to the corresponding first fragment image group, carrying out genetic coding of a genetic algorithm on the first fragment image group to realize modeling of a fragment splicing problem as a maximum spanning tree problem, and solving and obtaining a distribution solution through the genetic algorithm.
It will be appreciated that, by modifying the initial stitching relationship represented by the initial first patch image group obtained by grouping each edge similarity based on genetic evolution operations of the genetic algorithm, at least the patch image stitching relationship within the first patch image group can be adjusted, for example: in the initial stitching relationship, the fragment image 1 is stitched with the fragment image 2, and after genetic evolution operation, the fragment image 1 is stitched with the fragment image 8; meanwhile, when all the groups are optimized through a large-scale collaborative algorithm, at the moment, the splicing relation of the fragment images among the plurality of first fragment image groups can be adjusted through genetic evolution operation of a genetic algorithm, and the distribution solution is converted into a global optimal solution through corresponding adjustment, for example: after the optimization, the patch images 1 in the first patch group g are adjusted from the previous stitching with the patch images 2 to the stitching with the patch images 5 in the second patch group v.
In some embodiments, merging the plurality of first spanning trees by using a preset large-scale collaborative algorithm to obtain a first global tree, including the following steps:
step 51, a first spanning tree corresponding to a target fragment image group in a plurality of first fragment image groups is obtained, all branches are extracted from the obtained first spanning tree, and a first branch set is obtained, wherein the first spanning tree is generated by performing gene decoding after genetic evolution processing is completed on a corresponding gene coding sequence, the branches are used for representing that two fragment images are spliced, and tag values of the branches are used for representing edge similarity of the two corresponding fragment images.
In this embodiment, for a gene coding sequence corresponding to a certain group of first fragment image groups m (corresponding to target fragment image groups) to be optimized, for random numbers corresponding to individuals corresponding to one fragment image, the Prufer gene is decoded, and after all the random numbers are decoded, a first tree is generated, and a first tree branch set G is obtained by extracting branches included in the first tree, that is, edges in the corresponding tree 1
And 52, taking the randomly selected nodes from the preset tree root nodes of the initial global tree as tree roots, searching the preset number of tree root nodes downwards, determining all branches connected with the searched tree root nodes, and obtaining a second branch set, wherein the initial global tree is randomly generated based on a plurality of first fragment image groups.
In this embodiment, before combining a plurality of first spanning trees by using a large-scale collaborative algorithm to obtain a first global tree, a global tree S is randomly generated g As a global starting solution; at S g Randomly selecting a node as a tree root, searching paths (corresponding branches) of m groups of fragment nodes downwards, and marking the paths as a set G 2 That is, the second branch set G 2
Step 53, processing the union of the first branch set and the second branch set by using the Kruskal maximum spanning tree algorithm to generate a maximum spanning tree subtree, adding the maximum spanning tree subtree into an initial global tree with the branches deleted after deleting all branches corresponding to the union from a preset global tree, and generating a current global tree, wherein the current global tree comprises at least one second spanning tree, and a second fragment image group corresponding to the second spanning tree is generated by updating a target fragment image group.
In the present embodiment, the set G is calculated 3 =G 1 ∪G 2 At G 3 Performing Kruskal maximum spanning treeAlgorithm for forming maximum spanning tree subtree T 3 After that, at global solution S g Delete G on 3 Adding T 3 A current global tree is formed.
And step 54, repeatedly executing a preset iterative optimization step, and performing iterative update on the current global tree to generate a first global tree, wherein the iterative optimization step comprises the steps of acquiring a first branch set corresponding to a first fragment image group, searching a corresponding second branch set from the current global tree, and performing branch deletion and update on the current global tree based on a maximum spanning tree subtree generated by processing a union set of the first branch set and the second branch set by using a Kruskal maximum spanning tree algorithm, wherein the preset times are determined based on the number of the first fragment image groups.
In this embodiment, the first spanning tree corresponding to the m groups of the first fragment image packets is iteratively optimized, that is, steps 51 to 53 are repeatedly performed, so as to implement the current generation of the first global tree.
Through the steps 51 to 53, the method realizes the recovery of the residual fragments by adopting a large-scale collaborative genetic algorithm, searches the distribution solution deeply, rapidly obtains the global optimal solution, forms the solution vector of the residual fragment splicing, and improves the efficiency and the accuracy of the recovery of the residual fragments.
It should be noted that, in this embodiment, after the generation of the first global tree at the present time is completed, that is, after the correction of the group is completed, if the number of fragments in the corresponding fragment image group is less than 3, an invalid gene length is generated, that is, it is indicated that the current fragment image group cannot be optimized and frozen, and it is necessary to wait for other fragment image groups to transmit fragment images to the current fragment image group until the fragment images can be solved, and in the freezing process, the splicing relationship represented by the fragment image group is fixed.
In some of these embodiments, determining a first fitness corresponding to each second spanning tree, and performing a genetic evolution operation update on the plurality of second spanning trees according to the first fitness to generate a target global tree, including the steps of:
Step 61, obtaining all branches corresponding to all second spanning trees of the first global tree and label values corresponding to each branch, and taking the average value of the label values corresponding to all branches as the first fitness corresponding to each second spanning tree.
Step 62, calculating the average value of the first fitness corresponding to all the second spanning trees of the first global tree, and taking the calculated average value as the overall fitness corresponding to the first global tree.
Step 63, judging whether the overall fitness changes, and taking the corresponding first global tree as a target global tree when judging that the overall fitness does not change.
In this embodiment, by determining whether the global fitness corresponding to the first global tree generated at the present time and the previous time changes, when the global fitness does not change, it indicates that the first global tree at the present time has converged, that is, the corresponding global tree S g Is a globally optimal solution.
Acquiring all branches corresponding to all second spanning trees of a first global tree and label values corresponding to each branch through the steps, and taking the average value of the label values corresponding to all branches as a first fitness corresponding to each second spanning tree; and calculating the average value of the first fitness corresponding to all the second spanning trees of the first global tree, and taking the calculated average value as the overall fitness corresponding to the first global tree to realize the determination of the target global tree.
In some of these embodiments, the following steps are also implemented:
step 71, obtaining all branches corresponding to all second spanning trees of the first global tree and label values corresponding to each branch, and taking the average value of the label values corresponding to all branches as the first fitness corresponding to each second spanning tree.
Step 72, calculating the average value of the first fitness corresponding to all the second spanning trees of the first global tree, and taking the calculated average value as the overall fitness corresponding to the first global tree.
Step 73, judging whether the overall fitness changes, and determining a gene coding sequence corresponding to a second spanning tree of the current first global tree to obtain an alternative gene coding sequence under the condition that the overall fitness changes.
And step 74, performing genetic evolution processing on the candidate gene coding sequence by utilizing a preset genetic algorithm, and decoding the candidate gene coding sequence subjected to the genetic evolution processing to obtain a candidate spanning tree.
And 75, merging the alternative spanning trees by using a preset large-scale collaborative algorithm to update the current first global tree, and determining a target global tree according to the overall fitness corresponding to the updated first global tree.
Through the steps 71 to 75, all the distributed solutions are iteratively optimized until the global convergence to obtain the optimal solution S g
In some embodiments, based on a target stitching tree obtained by decoding a target global tree, stitching a plurality of fragment images includes the following steps:
and 81, decoding the target global tree to obtain a target splicing tree, wherein the target splicing tree comprises splicing relation information of the fragment images.
And step 82, based on the splicing relation information, splicing the plurality of fragment images by utilizing affine transformation to obtain a target output image.
Fig. 3 is a flowchart of the restoration of the residue according to the preferred embodiment of the present application, and referring to fig. 3, the following description will be given of the process of the restoration of the residue according to the preferred embodiment of the present application, the restoration of the residue including the steps of:
and step 1, edge scanning.
In this embodiment, the patch images are first scanned into digital image signals, and after filtering and edge extraction, binarizing the image signals according to a set threshold, the edge point set of each patch image is identified as { P } n N e 0,1,2,... And performing cubic spline interpolation on the edge point set to finish up-sampling, and amplifying the distribution density of the edge point set to form a sub-pixel edge.
And 2, measuring the edge similarity of the fragment image based on a least square method.
In this embodiment, the Douglas Peucker segmentation method is basedGrouping the original edge point sets to obtain a plurality of profile segment groups, wherein each profile segment group represents a target of coarse-grained matching; in the present embodiment, the least squares matching of two patch images is modeled, and the profile segment grouping is setGrouping outline segments->And profile segment grouping { P j Performing walk least square matching, traversing all fragment images i to find out the part with the lowest residual energy, and deriving the similar energy E by adopting a preset correction strategy ij To obtain edge similarity.
And 3, carrying out local stitching on the fragment image groups by improving a genetic algorithm.
And 4, optimizing all the fragment image groups through an iterative large-scale collaborative algorithm.
In this embodiment, after a distribution solution is formed based on a result obtained by a genetic algorithm, for each fragment image group and a corresponding fragment image, an average fitness of each fragment image group is detected and whether correction is required is determined, the fragment images in the corrected fragment image group need to be moved out of the corresponding fragment image group, and the optimization process of steps 1 to 3 is repeated, in this iteration process, the fitness is continuously increased, in this embodiment, a kruekarl maximum spanning tree calculation is performed in the fragment image group, and the distribution solution is converted into a global optimal solution.
Specifically, the method utilizes a large-scale collaborative genetic framework K-CCGA based on the Krueskal combination to carry out the restoration and splicing of the residual piece.
Firstly, configuring a genetic algorithm module based on a Prufer tree, equally dividing N fragment images (N is a large number) into M groups, configuring one module for each group, and configuring the gene length of r-2, wherein r represents the number of fragments allocated to the group, and the genetic algorithm adopts a random tournament selection operator, a single-point crossover operator and a single-point mutation operator.
Next, press asThe following steps are performed for optimizing a set of fragmented image groupings: 1. a global tree S is randomly generated before a plurality of first spanning trees are combined by utilizing a large-scale cooperative algorithm to obtain a first global tree g As a global starting solution; 2. for the gene coding sequence corresponding to a certain group of first fragment image groups m (corresponding to target fragment image groups) for optimization, for random numbers corresponding to individuals corresponding to one fragment image, decoding the Prufer genes, generating a first generation tree after decoding all random numbers, obtaining a first branch set G by extracting branches contained in the first generation tree, namely edges in the corresponding generation tree 1 The method comprises the steps of carrying out a first treatment on the surface of the 3. At S g Randomly selecting a node as a tree root, searching paths (corresponding branches) of m groups of fragment nodes downwards, and marking the paths as a set G 2 That is, the second branch set G 2 The method comprises the steps of carrying out a first treatment on the surface of the 4. Calculate the aggregate, G 3 =G 1 ∪G 2 At G 3 Performing Kruskal maximum spanning tree algorithm on the tree to form a maximum spanning tree subtree T 3 The method comprises the steps of carrying out a first treatment on the surface of the 5. At global solution S g Delete G on 3 Adding T 3 Forming a current global tree, updating S g
It should be further noted that, in the embodiment of the application, based on the modeling of the fragment edge, only the fragment edge information is used for splicing, and the high-efficiency splicing is ensured by using an accelerating least square method and a fine granularity verification mechanism through an information quantity amplification algorithm; meanwhile, on the basis of least square residual energy, correction calculation is carried out, and similar energy SE is provided as a matching degree measurement function; furthermore, the method adopts a large-scale collaborative genetic algorithm to recover the fragments, can search the solution space of the combined explosion more deeply, quickly obtain the global optimal solution, form the solution vector of the fragment splicing, and assist or fully automatically recover the fragments, thereby greatly improving the speed of the repairing work of the cultural relics; finally, the embodiment only uses the incomplete edge information for matching, and has high expansibility, not only for 2D Ping Miandian cloud, but also for 3D stereo point cloud and even high-dimensional feature space containing other features.
The embodiment also provides a residue restoration device based on a large-scale collaborative genetic algorithm, which is used for realizing the embodiment and the preferred embodiment, and is not described again. As used below, the terms "module," "unit," "sub-unit," and the like may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 4 is a block diagram of the structure of the restoration of the residual patch based on the large-scale collaborative genetic algorithm according to an embodiment of the present application, and as shown in fig. 4, the apparatus includes an identification module 41, a coding module 42, an optimization module 43, and a processing module 44, wherein,
the identifying module 41 is configured to identify, among a plurality of fragment images to be restored, a set of edge points corresponding to each fragment image, and determine an edge similarity corresponding to the fragment image based on the set of edge points corresponding to the plurality of fragment images;
the encoding module 42 is coupled to the identifying module 41, and is configured to group the plurality of fragment images according to the edge similarity, obtain a plurality of first fragment image groups, and perform Prufer encoding based on target information of the first fragment image groups to generate a plurality of gene encoding sequences, where the target information is used to characterize fragment images of the first fragment image groups;
The optimizing module 43 is coupled to the encoding module 42, and is configured to perform genetic evolution processing on the plurality of gene encoding sequences based on a preset genetic algorithm, obtain a first spanning tree corresponding to each first fragment image group, and combine the plurality of first spanning trees by using a preset large-scale collaborative algorithm, so as to obtain a first global tree, where the first global tree includes a plurality of second spanning trees used to represent splicing relationship information in the second fragment image group, and the genetic evolution operation at least includes one of the following: random tournament selection, genetic crossover, and genetic mutation;
the processing module 44 is coupled to the optimizing module 43, and is configured to determine a first fitness corresponding to each second spanning tree, update the genetic evolution operation of the plurality of second spanning trees according to the first fitness to generate a target global tree, and splice the plurality of fragment images based on the target splicing tree obtained by decoding the target global tree, where the first fitness is used to characterize an accuracy of fragment splicing in the corresponding fragment image packet.
By the residual piece restoration device based on the large-scale collaborative genetic algorithm, identifying an edge point set corresponding to each fragment image in a plurality of fragment images to be restored, and determining the edge similarity corresponding to the fragment images based on the edge point sets corresponding to the plurality of fragment images; grouping a plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and performing Prufer coding based on target information of the first fragment image groups to generate a plurality of gene coding sequences; performing genetic evolution processing on a plurality of gene coding sequences based on a preset genetic algorithm to obtain a first spanning tree corresponding to each first fragment image group, and combining the plurality of first spanning trees by utilizing a preset large-scale collaborative algorithm to obtain a first global tree, wherein the first global tree comprises a plurality of second spanning trees used for representing splicing relation information in a second fragment image group; determining a first fitness corresponding to each second spanning tree, performing genetic evolution operation update on a plurality of second spanning trees according to the first fitness to generate a target global tree, splicing a plurality of fragment images based on a target splicing tree obtained by decoding the target global tree, and solving the large-scale problem by utilizing fragment edge information for splicing and performing residue restoration based on a large-scale collaborative genetic algorithm and utilizing grouping collaborative evolution, so that a solution space is searched deeply to quickly obtain a global optimal solution, and further, restoration and splicing are performed on the residues with high efficiency, thereby solving the problems that the residue restoration scheme in the related art cannot perform depth search and solve the global optimal solution, and the problem of low residue restoration efficiency and poor splicing effect are solved.
In some of these embodiments, the identification module 41 further comprises:
the first preprocessing unit is used for preprocessing a first digital image corresponding to each fragment image obtained through scanning, wherein the preprocessing comprises median filtering noise reduction processing and binarization processing.
The first edge detection unit is coupled with the first preprocessing unit and is used for extracting edges of the preprocessed digital image through an edge detection operator to obtain a first point set, wherein the edge detection operator comprises a Canny operator.
The first reconstruction unit is coupled with the first edge detection unit and is used for performing piecewise expression processing based on cubic spline interpolation on the first point set, generating a sub-pixel edge point set, then performing downsampling on the sub-pixel edge point set based on local curvature entropy and reconstructing the sub-pixel edge point set by using an interpolation expression method to generate the edge point set.
In some of these embodiments, the identification module 41 further comprises:
the first grouping unit is used for grouping the edge point sets corresponding to each fragment image by utilizing a track compression Douglas Peucker segmentation method to obtain outline segment groups, wherein each outline segment group corresponds to one coarse granularity;
The first matching unit is coupled with the first grouping unit and is used for carrying out least square matching on the contour segment group corresponding to one target side fragment image and the contour segment group corresponding to all matching side fragment images respectively to obtain a first pixel pair, wherein the target side fragment image comprises one of a plurality of fragment images, the matching side fragment image comprises one of all fragment images except the target side fragment image in the plurality of fragment images, and the first pixel pair is used for representing two contour segment groups with minimum residual energy between the target side fragment image and the matching side fragment image;
the first expansion unit is coupled with the first matching unit and is used for acquiring a left pixel pair set and a right pixel pair set which are formed by second pixel pairs distributed on two sides of the first pixel pair, traversing the left pixel pair set and the right pixel pair set in sequence from the first pixel pair, and determining a first point set and a second point set from edge points corresponding to the traversed second pixel pair when the distance between the traversed first pixel pair and the traversed second pixel pair is larger than a preset threshold value, wherein the second pixel pair comprises two outline segment groups corresponding to a target side fragment image and a matching side fragment image, the first point set comprises edge points corresponding to the target side fragment image, and the second point set comprises edge points corresponding to the matching formula fragment image;
The first determining unit is coupled with the first expanding unit and is used for respectively determining a first projection vector corresponding to the first point set and a second projection vector corresponding to the second point set, and determining a first metric coefficient according to Euclidean distance between the first projection vector and the second projection vector, wherein the first metric coefficient is used for representing the matching degree of the outline segments corresponding to all second pixel pairs of the target side fragment image and the matching side fragment image;
the first calculating unit is coupled with the first determining unit and is used for calculating the edge similarity between the target fragment image and the matching fragment image according to the residual energy corresponding to the first pixel pair, the first metric coefficient and the traversed logarithm of the second pixel pair.
In some embodiments, the encoding module 42 is configured to traverse edge similarities corresponding to the plurality of tile images, and group at least two tile images with edge similarities within a preset similarity range to obtain a plurality of first tile image groups, where one tile image belongs to only one first tile image group.
In some embodiments, the encoding module 42 is configured to obtain, in the target information of each first tile image group, the tile codes and the number of tile images corresponding to all the tile images; generating a first gene code corresponding to the first fragment image group based on the fragment codes, and generating a group code corresponding to the first fragment image group according to the first gene code and the number of fragment images; and carrying out natural number mapping on the group codes, and carrying out random number generation on the array subjected to the natural number mapping according to a Prufer coding rule to obtain a gene coding sequence corresponding to the corresponding first fragment image group, wherein the gene coding sequence comprises a preset number of random numbers.
In some of these embodiments, the optimization module 43 further includes:
the first extraction unit is used for acquiring first spanning trees corresponding to target fragment image groups in a plurality of first fragment image groups, extracting all branches from the acquired first spanning trees to obtain a first branch set, wherein the first spanning trees are generated by performing gene decoding after genetic evolution processing is completed on corresponding gene coding sequences, the branches are used for representing that two fragment images are spliced, and the tag values of the branches are used for representing the edge similarity of the two corresponding fragment images;
the first searching unit is coupled with the first extracting unit and is used for taking a node randomly selected from tree root nodes of a preset initial global tree as a tree root, searching the tree root nodes of a preset number downwards, determining all branches connected with the searched tree root nodes, and obtaining a second branch set, wherein the initial global tree is randomly generated based on a plurality of first fragment image groups;
the first generation unit is coupled with the first search unit and is used for processing the union set of the first branch set and the second branch set by utilizing the Kruskal maximum spanning tree algorithm to generate a maximum spanning tree subtree, adding the maximum spanning tree subtree into an initial global tree for completing branch deletion after deleting all branches corresponding to the union set from a preset global tree to generate a current global tree, wherein the current global tree comprises at least one second spanning tree, and a second fragment image group corresponding to the second spanning tree is generated by updating a target fragment image group;
The first processing unit is used for repeatedly executing a preset iterative optimization step, and carrying out iterative updating on the current global tree to generate a first global tree, wherein the iterative optimization step comprises the steps of obtaining a first branch set corresponding to a first fragment image group, searching a corresponding second branch set from the current global tree, and carrying out branch deletion and updating on the current global tree based on a maximum spanning tree subtree generated by processing a union set of the first branch set and the second branch set by using a Kruskal maximum spanning tree algorithm, wherein the preset times are determined based on the number of the first fragment image groups.
In some of these embodiments, the processing module 44 further includes:
the first acquisition unit is used for acquiring all branches corresponding to all second spanning trees of the first global tree and label values corresponding to each branch, and taking the average value of the label values corresponding to all branches as a first fitness corresponding to each second spanning tree;
the first operation unit is coupled with the first acquisition unit and is used for calculating the average value of the first fitness corresponding to all the second spanning trees of the first global tree and taking the calculated average value as the overall fitness corresponding to the first global tree;
The first judging unit is coupled with the first operation unit and is used for judging whether the overall fitness changes or not, and taking the corresponding first global tree as a target global tree under the condition that the overall fitness is not changed.
In some embodiments, the processing module 44 is further configured to determine the gene coding sequence corresponding to the second spanning tree of the current first global tree to obtain an alternative gene coding sequence if the overall fitness is determined to be changed; performing genetic evolution processing on the candidate gene coding sequence by using a preset genetic algorithm, and decoding the candidate gene coding sequence subjected to the genetic evolution processing to obtain a candidate spanning tree; and merging the alternative spanning trees by using a preset large-scale cooperative algorithm to update the current first global tree, and determining the target global tree according to the overall fitness corresponding to the updated first global tree.
In some embodiments, the processing module 44 is further configured to decode the target global tree to obtain the target stitching tree, where the target stitching tree includes stitching relationship information of the fragment image; and based on the splicing relation information, splicing the plurality of fragment images by utilizing affine transformation to obtain a target output image.
The present embodiment also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, identifying an edge point set corresponding to each fragment image in a plurality of fragment images to be restored, and determining the edge similarity corresponding to the fragment images based on the edge point sets corresponding to the plurality of fragment images.
S2, grouping the plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and carrying out Prufer coding based on target information of the first fragment image groups to generate a plurality of gene coding sequences.
S3, carrying out genetic evolution processing on the plurality of gene coding sequences based on a preset genetic algorithm to obtain a first spanning tree corresponding to each first fragment image group, and combining the plurality of first spanning trees by utilizing a preset large-scale collaborative algorithm to obtain a first global tree, wherein the first global tree comprises a plurality of second spanning trees used for representing splicing relation information in the second fragment image groups.
S4, determining a first fitness corresponding to each second spanning tree, carrying out genetic evolution operation updating on the plurality of second spanning trees according to the first fitness to generate a target global tree, and splicing the plurality of fragment images based on a target splicing tree obtained by decoding the target global tree.
In addition, in combination with the method for restoring the fragments based on the large-scale collaborative genetic algorithm in the above embodiment, the embodiment of the application can be realized by providing a storage medium. The storage medium has a computer program stored thereon; the computer program, when executed by a processor, implements any of the methods of the embodiments described above based on a massive synergistic genetic algorithm.
It should be understood by those skilled in the art that the technical features of the above embodiments may be combined in any manner, and for brevity, all of the possible combinations of the technical features of the above embodiments are not described, however, they should be considered as being within the scope of the description provided herein, as long as there is no contradiction between the combinations of the technical features.
The foregoing examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. The residual piece restoration method based on the large-scale collaborative genetic algorithm is characterized by comprising the following steps of:
identifying an edge point set corresponding to each fragment image in a plurality of fragment images to be restored, and determining the edge similarity corresponding to the fragment images based on the edge point sets corresponding to the fragment images;
grouping a plurality of fragment images according to the edge similarity to obtain a plurality of first fragment image groups, and performing Prufer coding based on target information of the first fragment image groups to generate a plurality of gene coding sequences, wherein the target information is used for representing the fragment images of the first fragment image groups;
performing genetic evolution processing on the plurality of gene coding sequences based on a preset genetic algorithm to obtain a first spanning tree corresponding to each first fragment image group, and combining the plurality of first spanning trees by using a preset large-scale collaborative algorithm to obtain a first global tree, wherein the first global tree comprises a plurality of second spanning trees used for representing splicing relation information in a second fragment image group, and the genetic evolution operation at least comprises one of the following steps: random tournament selection, genetic crossover, and genetic mutation;
Determining a first fitness corresponding to each second spanning tree, updating the plurality of second spanning trees by genetic evolution operation according to the first fitness to generate a target global tree, and splicing the plurality of fragment images based on a target splicing tree obtained by decoding the target global tree, wherein the first fitness is used for representing the precision of fragment splicing in a corresponding fragment image group.
2. The method of claim 1, wherein identifying, among a plurality of patch images to be restored, a corresponding set of edge points for each of the patch images comprises:
preprocessing a first digital image corresponding to each fragment image obtained through scanning, wherein the preprocessing comprises median filtering noise reduction processing and binarization processing;
performing edge extraction on the preprocessed digital image through an edge detection operator to obtain a first point set, wherein the edge detection operator comprises a Canny operator;
and after the first point set is processed based on a cubic spline interpolation segmentation expression to generate a sub-pixel edge point set, the sub-pixel edge point set is downsampled by using an interpolation expression method based on local curvature entropy, and the edge point set is reconstructed.
3. The method of claim 1, wherein determining edge similarities for the patch images based on the sets of edge points for a plurality of patch images comprises:
grouping the edge point sets corresponding to each fragment image by utilizing a track compression Douglas Peucker segmentation method to obtain contour segment groups, wherein each contour segment group corresponds to a coarse granularity;
performing least square matching on the profile segment group corresponding to one target fragment image and the profile segment groups corresponding to all matching fragment images respectively to obtain a first pixel pair, wherein the target fragment image comprises one of a plurality of fragment images, the matching fragment image comprises one of all fragment images except the target fragment image in the plurality of fragment images, and the first pixel pair is used for representing two profile segment groups with minimum residual energy between the target fragment image and the matching fragment image;
acquiring a left pixel pair set and a right pixel pair set which are formed by second pixel pairs distributed on two sides of the first pixel pair, traversing the left pixel pair set and the right pixel pair set in sequence from the first pixel pair, and determining a first point set and a second point set from edge points corresponding to the traversed second pixel pair when the distance from the traversed first pixel pair to the traversed second pixel pair is larger than a preset threshold value, wherein the second pixel pair comprises two contour segment groups corresponding to the target fragment image and the matching fragment image, the first point set comprises the edge points corresponding to the target fragment image, and the second point set comprises the edge points corresponding to the matching fragment image;
Respectively determining a first projection vector corresponding to the first point set and a second projection vector corresponding to the second point set, and determining a first metric coefficient according to Euclidean distance between the first projection vector and the second projection vector, wherein the first metric coefficient is used for representing matching degree of all the second pixels corresponding to the target side fragment image and the matching side fragment image in traversal;
and calculating the edge similarity between the target square-patch image and the matching square-patch image according to the residual energy corresponding to the first pixel pair, the first metric coefficient and the traversed logarithm of the second pixel pair.
4. The method of claim 1, wherein grouping the plurality of patch images according to the edge similarity results in a plurality of first patch image groupings, comprising: traversing the edge similarity corresponding to the plurality of fragment images, and grouping at least two fragment images with the edge similarity within a preset similarity range to obtain a plurality of first fragment image groups, wherein one fragment image only belongs to one first fragment image group.
5. The method of claim 1, wherein Prufer encoding based on target information of the first fragment image packet to generate a plurality of gene-encoded sequences comprises:
obtaining fragment codes and the number of fragment images corresponding to all the fragment images in the target information of each first fragment image group;
generating a first gene code corresponding to the first fragment image group based on the fragment codes, and generating a group code corresponding to the first fragment image group according to the first gene code and the fragment image number;
and carrying out natural number mapping on the group codes, and carrying out random number generation on the array subjected to the natural number mapping according to a Prufer coding rule to obtain the gene coding sequence corresponding to the corresponding first fragment image group, wherein the gene coding sequence comprises the random numbers with preset numbers.
6. The method of claim 1, wherein merging the plurality of first spanning trees using a predetermined large-scale collaborative algorithm to obtain a first global tree comprises:
acquiring the first spanning tree corresponding to the target fragment image group in the plurality of first fragment image groups, and extracting all branches from the acquired first spanning tree to obtain a first branch set, wherein the first spanning tree is generated by performing gene decoding after the corresponding gene coding sequence completes genetic evolution processing, the branches are used for representing the splicing of two fragment images, and the label values of the branches are used for representing the edge similarity of the two corresponding fragment images;
Taking a node randomly selected from tree root nodes of a preset initial global tree as a tree root, searching a preset number of the tree root nodes downwards, determining all branches connected with the searched tree root nodes, and obtaining a second branch set, wherein the initial global tree is randomly generated based on a plurality of first fragment image groups;
processing a union set of the first branch set and the second branch set by using a Kruskal maximum spanning tree algorithm to generate a maximum spanning tree subtree, adding the maximum spanning tree subtree into the initial global tree with the branches deleted after deleting all the branches corresponding to the union set from the preset global tree, and generating a current global tree, wherein the current global tree comprises at least one second spanning tree, and the second fragment image group corresponding to the second spanning tree is generated by updating the target fragment image group;
repeatedly executing a preset iterative optimization step, and performing iterative updating on the current global tree to generate the first global tree, wherein the iterative optimization step comprises the steps of acquiring the first branch set corresponding to the first fragment image group, searching the second branch set corresponding to the current global tree, and performing branch deletion and updating on the current global tree based on the maximum spanning tree subtree generated by processing the union set of the first branch set and the second branch set by using a Kruskal maximum spanning tree algorithm, wherein the preset times are determined based on the number of the first fragment image groups.
7. The method of claim 6, wherein determining a first fitness for each of the second spanning trees, and wherein performing a genetic evolution operation update on the plurality of second spanning trees based on the first fitness to generate a target global tree comprises:
acquiring all the branches corresponding to all the second spanning trees of the first global tree and the label value corresponding to each branch, and taking the average value of the label values corresponding to all the branches as the first fitness corresponding to each second spanning tree;
calculating the average value of the first fitness corresponding to all the second spanning trees of the first global tree, and taking the calculated average value as the overall fitness corresponding to the first global tree;
judging whether the overall fitness changes or not, and taking the corresponding first global tree as the target global tree under the condition that the overall fitness is not changed.
8. The method of claim 7, wherein in the event that the overall fitness change is determined, the method further comprises:
determining the gene coding sequence corresponding to the second spanning tree of the current first global tree to obtain an alternative gene coding sequence;
Performing genetic evolution processing on the candidate gene coding sequence by using a preset genetic algorithm, and decoding the candidate gene coding sequence subjected to the genetic evolution processing to obtain a candidate spanning tree;
and merging the alternative spanning trees by using a preset large-scale cooperative algorithm to update the current first global tree, and determining the target global tree according to the overall fitness corresponding to the updated first global tree.
9. The method of claim 1, wherein stitching the plurality of fragment images based on a target stitching tree resulting from decoding the target global tree, comprises:
decoding the target global tree to obtain the target splicing tree, wherein the target splicing tree comprises splicing relation information of the fragment images;
and based on the splicing relation information, splicing the plurality of fragment images by utilizing affine transformation to obtain a target output image.
10. A storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the method for restoration of fragments based on a large-scale collaborative genetic algorithm according to any of claims 1 to 9.
CN202310965421.7A 2023-08-02 2023-08-02 Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium Pending CN116934628A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310965421.7A CN116934628A (en) 2023-08-02 2023-08-02 Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310965421.7A CN116934628A (en) 2023-08-02 2023-08-02 Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium

Publications (1)

Publication Number Publication Date
CN116934628A true CN116934628A (en) 2023-10-24

Family

ID=88392280

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310965421.7A Pending CN116934628A (en) 2023-08-02 2023-08-02 Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium

Country Status (1)

Country Link
CN (1) CN116934628A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117915016A (en) * 2024-03-15 2024-04-19 北京云桥智海科技服务有限公司 Enterprise data safety protection system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117915016A (en) * 2024-03-15 2024-04-19 北京云桥智海科技服务有限公司 Enterprise data safety protection system
CN117915016B (en) * 2024-03-15 2024-05-24 北京云桥智海科技服务有限公司 Enterprise data safety protection system

Similar Documents

Publication Publication Date Title
CN109191402B (en) Image restoration method and system based on confrontation generation neural network
CN109614935B (en) Vehicle damage assessment method and device, storage medium and electronic equipment
CN110569901A (en) Channel selection-based countermeasure elimination weak supervision target detection method
KR101183391B1 (en) Image comparison by metric embeddings
CN115546116B (en) Full-coverage type rock mass discontinuous surface extraction and interval calculation method and system
Galvanin et al. Extraction of building roof contours from LiDAR data using a Markov-random-field-based approach
CN116934628A (en) Fragment restoration method based on large-scale collaborative genetic algorithm and storage medium
CN110363178B (en) Airborne laser point cloud classification method based on local and global depth feature embedding
CN113223078B (en) Mark point matching method, device, computer equipment and storage medium
CN113838005A (en) Intelligent rock fracture identification and three-dimensional reconstruction method and system based on dimension conversion
CN115375589A (en) Model for removing image shadow and construction method, device and application thereof
CN113409332A (en) Building plane segmentation method based on three-dimensional point cloud
CN113988147A (en) Multi-label classification method and device for remote sensing image scene based on graph network, and multi-label retrieval method and device
CN110211109B (en) Image change detection method based on deep neural network structure optimization
CN110083734B (en) Semi-supervised image retrieval method based on self-coding network and robust kernel hash
CN116665053A (en) High-resolution remote sensing image building identification method and system considering shadow information
CN113723294B (en) Data processing method and device and object recognition method and device
Ye et al. Ec-sfm: Efficient covisibility-based structure-from-motion for both sequential and unordered images
CN117710603A (en) Unmanned aerial vehicle image three-dimensional building modeling method under constraint of linear geometry
CN111626953A (en) Fragment splicing method and device based on multi-feature information
CN116863349A (en) Remote sensing image change area determining method and device based on triangular network dense matching
CN116188249A (en) Remote sensing image registration method based on image block three-stage matching
CN114612734B (en) Remote sensing image feature matching method and device, storage medium and computer equipment
CN114413882A (en) Global initial positioning method and device based on multi-hypothesis tracking
Cao et al. Understanding 3D point cloud deep neural networks by visualization techniques

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