CN111814839A - Template matching method of longicorn group optimization algorithm based on self-adaptive variation - Google Patents

Template matching method of longicorn group optimization algorithm based on self-adaptive variation Download PDF

Info

Publication number
CN111814839A
CN111814839A CN202010553460.2A CN202010553460A CN111814839A CN 111814839 A CN111814839 A CN 111814839A CN 202010553460 A CN202010553460 A CN 202010553460A CN 111814839 A CN111814839 A CN 111814839A
Authority
CN
China
Prior art keywords
iteration
image
longicorn
optimization algorithm
ith individual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010553460.2A
Other languages
Chinese (zh)
Other versions
CN111814839B (en
Inventor
都海波
沈涵
周俊
魏佳佳
俞波
刘昊磊
王鹤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei University of Technology
Original Assignee
Hefei University of Technology
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 Hefei University of Technology filed Critical Hefei University of Technology
Priority to CN202010553460.2A priority Critical patent/CN111814839B/en
Publication of CN111814839A publication Critical patent/CN111814839A/en
Application granted granted Critical
Publication of CN111814839B publication Critical patent/CN111814839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

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

Abstract

The invention discloses a template matching method of a longicorn herd optimization algorithm based on self-adaptive variation, and belongs to the technical field of computer image processing. The method comprises the steps of firstly, acquiring gray value information of an image to be detected and a target template image; expressing the possible positions of the best matched candidate template images by using the individual positions in the adaptive variant longicorn colony optimization algorithm, setting algorithm parameters, and randomly initializing the longicorn colony in a search space; and finally, searching the best matched candidate template image in the search space as a template matching result by using a self-adaptive variant longicorn swarm optimization algorithm. According to the invention, historical information and current particle surrounding information are combined by using a longicorn swarm optimization algorithm based on self-adaptive variation, and the characteristic of a self-adaptive multi-dimensional disturbance variation mode based on the population aggregation degree and the iteration times is introduced, so that the convergence speed and the matching precision in the template matching process are improved.

Description

Template matching method of longicorn group optimization algorithm based on self-adaptive variation
Technical Field
The invention relates to the technical field of computer image processing, in particular to a template matching method of a longicorn herd optimization algorithm based on self-adaptive variation.
Background
The processing procedure of searching the corresponding best matching candidate template image from the confirmed target template image to the image to be detected is called template matching, namely the template matching refers to the process of searching the matched sub-image from a known template image to another image, and the template matching is an important technology in the technical field of computer image processing. Template matching is widely applied to numerous fields of intelligent robot environment perception, target tracking, medical image analysis and the like. With the development of modern electronic information technology, higher and higher requirements are put forward on the accuracy and the rapidity of the template matching technology.
In recent years, many researchers have conducted extensive research into the improvement of the performance of template matching techniques. The similarity of each point is calculated by adopting a point-by-point traversal strategy, so that the high matching accuracy can be ensured, but the calculation amount is overlarge, the running time is long, the real-time performance is difficult to ensure, and the method is not convenient to apply in real-time image processing. Some researchers improve the real-time performance of the system, and provide methods such as coarse and fine search [ Zhuyong, national clarity ] research on correlation matching algorithm based on correlation coefficient [ J ] signal processing, 2003(06):531 and 534 ], disorder matching [ defense, Korean root nail ], application of target tracking algorithm based on template matching to infrared thermal imaging tracking technology [ J ] electronic technology application, 2003(05):12-14 ]. There is still room for greater improvements in operating speed and accuracy. The current improvement aiming at template matching mainly aims at reducing the arithmetic operation amount and improving the matching precision. Therefore, the application of an optimization algorithm to a template matching method, such as a particle swarm optimization-based template matching method [ Li Jie, Happy, Zhang, etc. ] a particle swarm optimization-based template matching tracking algorithm [ J ] computer application 2015,35(09): 2656-.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides the template matching method of the adaptive variation-based longicorn swarm optimization algorithm, the historical information and the current particle surrounding information are combined by the adaptive variation-based longicorn swarm optimization algorithm, and the characteristic of an adaptive multi-dimensional disturbance variation mode based on the population aggregation degree and the iteration times is introduced, so that the convergence speed and the matching precision in the template matching process are improved.
In order to achieve the purpose, the invention adopts the following technical scheme that:
the template matching method of the longicorn herd optimization algorithm based on the self-adaptive variation comprises the following specific steps:
s1, acquiring gray value information of the image to be detected and the target template image, and searching corresponding matched candidate template images in the image to be detected according to the target template image;
s2, representing the positions of the matched candidate template images by the individual positions in the adaptive variant longicorn swarm optimization algorithm, setting parameters of the adaptive variant longicorn swarm optimization algorithm, and initializing the longicorn swarm randomly in a search space;
recording the pixel size of the image to be detected as (H, W); marking the pixel size of the target template image as (M, N); marking the upper left corners of the image to be detected and the target template image as starting points (0, 0);
at the time of the t iteration, the coordinate position of the ith individual in the cattle group is expressed as a vector
Figure BDA0002543349790000021
The velocity of the ith individual is represented by a vector
Figure BDA0002543349790000022
Wherein the content of the first and second substances,
Figure BDA0002543349790000023
indicating that the ith individual is at the th of the t iterationThe position information of the 1-dimensional position,
Figure BDA0002543349790000024
representing the position information of the ith individual in the 2 nd dimension at the t-th iteration,
Figure BDA0002543349790000025
representing the velocity information of the ith individual in the 1 st dimension at the t-th iteration,
Figure BDA0002543349790000026
representing the velocity information of the ith individual in the 2 nd dimension at the tth iteration;
the candidate template image corresponding to each individual is obtained by intercepting the image to be detected, the pixel size of the candidate template image is the same as that of the target template image, and the upper left corner of the candidate template image corresponding to the ith individual is taken as a starting point
Figure BDA0002543349790000027
round (·) represents a rounded rounding function;
the search space satisfies the following equation:
Figure BDA0002543349790000028
the initialization of the coordinate position and velocity of the ith individual is:
Figure BDA0002543349790000029
Figure BDA00025433497900000210
wherein rand is a random number between [0,1 ];
and S3, searching a candidate template image which is best matched in the search space as a template matching result by using a self-adaptive variant longicorn swarm optimization algorithm.
In step S3, the method includes the following steps:
s31, the optimal position of the population is
Figure BDA0002543349790000031
The optimal position of the ith individual is
Figure BDA0002543349790000032
Wherein the content of the first and second substances,
Figure BDA0002543349790000033
1 st dimension information representing the optimal position of the population at the t-th iteration,
Figure BDA0002543349790000034
dimension 2 information representing the optimal position of the population at the t-th iteration,
Figure BDA0002543349790000035
1 st dimension information representing the optimal position of the ith individual at the t-th iteration,
Figure BDA0002543349790000036
2 nd dimension information representing the optimal position of the ith individual at the t-th iteration; subscript g denotes the population, subscript i denotes the ith individual, superscript denotes the number of iterations;
calculating the optimal position of the group when the initial time, namely the iteration time t is 0
Figure BDA0002543349790000037
The ith individual optimum position is
Figure BDA0002543349790000038
Wherein f (-) is a function to be optimized; i is the population scale;
Figure BDA0002543349790000039
corresponding when taking the minimum value
Figure BDA00025433497900000310
The normalized similarity between the target template image and the candidate template image obtained by cutting in the image to be tested is gamma, and the function relationship between the function f (-) to be optimized and the normalized similarity gamma is established as follows:
Figure BDA00025433497900000311
Figure BDA00025433497900000312
s (m, n) and T (m, n) are pixel point gray values of the position coordinates (m, n) in the image to be detected and the target template image respectively; f (-) is belonged to [0,1], when the candidate template image is more similar to the target template image, the value of the function f (-) to be optimized is smaller, and the value is larger otherwise;
s32, judging whether the adaptive variant longicorn herd optimization algorithm meets a convergence condition, namely judging whether the adaptive variant longicorn herd optimization algorithm finishes iteration;
if the optimal solution XbestCorresponding function value f (X) to be optimizedbest) When the iteration time T is less than a set threshold value or reaches the maximum iteration time T, namely the convergence condition is met, ending the iteration, outputting the optimal solution of the matching value, and ending the adaptive variant longicorn group optimization algorithm;
if the optimal solution XbestCorresponding function value f (X) to be optimizedbest) If the iteration number T is not less than the set threshold and the iteration number T does not reach the maximum iteration number T, that is, if the convergence condition is not satisfied, executing step S33;
and S33, updating individual speed and position:
randomly generating a normalized direction vector for the ith individual
Figure BDA0002543349790000041
Comprises the following steps:
Figure BDA0002543349790000042
wherein rand (1,2) is a two-dimensional vector formed by random numbers of [0,1 ];
establishing a functional relation between the distance between the optimal positions of the groups and the optimal positions of the individuals and the whisker length, and calculating the whisker length of the ith individual in the t iteration
Figure BDA0002543349790000043
Comprises the following steps:
Figure BDA0002543349790000044
wherein β is a scaling factor; the left and right whisker length of the ith individual at the t iteration are
Figure BDA0002543349790000045
Calculating the left whisker coordinate of the ith individual
Figure BDA0002543349790000046
Coordinates of right beard
Figure BDA0002543349790000047
Respectively as follows:
Figure BDA0002543349790000048
the update method of the speed and position of the ith individual is as follows:
Figure BDA0002543349790000049
Figure BDA00025433497900000410
wherein ω is the inertial weight; c. C1、c2Are all learning factors, the symbols represent the multiplication of corresponding elements of two matrices having the same shape one by one;
the calculation method of the parameters, i.e., the inertial weight ω and the scaling factor β, in the velocity update method is as follows:
Figure BDA00025433497900000411
s34, updating the individual optimal position and the group optimal position, wherein the updating method of the individual optimal position and the group optimal position is as follows:
Figure BDA00025433497900000412
Figure 100002_1
s35, optimizing the function to be optimized by XbestBest solution of matching value XbestThe update method (2) is as follows:
Figure BDA0002543349790000051
s36, calculating a population standard deviation σ and a variation probability p, wherein the calculation method of the population standard deviation σ and the variation probability p is as follows:
Figure BDA0002543349790000052
Figure BDA0002543349790000053
wherein σ0To normalize the factor, σ0The value of (a) is the population standard deviation which is not normalized during particle swarm initialization; omegaIs the weight of the variation probability standard deviation; omegaptThe iteration times weight is the variation probability; b is a variation probability offset constant;
Figure BDA0002543349790000054
is the mass center of the population,
Figure BDA0002543349790000055
the calculation of (c) is as follows:
Figure BDA0002543349790000056
s37, judging whether to carry out variation operation, if rand is less than p, executing step S38, otherwise, returning to execute step S32;
s38, carrying out disturbance variation on the optimal position of the group, randomly selecting alpha% dimensionality of the optimal position of the group for random disturbance, wherein the random disturbance mode of the k dimensionality is as follows:
Figure BDA0002543349790000057
wherein A is a disturbance amplitude value; randn is a random variable that follows a standard normal distribution;
and after the population optimal position perturbation mutation, returning to the step S32.
The invention has the advantages that:
the method converts the template matching problem into the function optimization problem, adopts the adaptive variation longicorn group optimization algorithm to search the optimal solution of the optimization problem, namely the target of template matching, and has the characteristics of good optimization effect and high convergence speed by virtue of the adaptive variation longicorn group optimization algorithm.
Drawings
Fig. 1 is a flowchart of a template matching method of a longicorn herd optimization algorithm based on adaptive mutation according to the present invention.
Fig. 2 is a diagram illustrating an image to be measured for template matching in this embodiment.
Fig. 3 is a target template image for template matching in the present embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, the template matching method based on the adaptive variant longicorn herd optimization algorithm of the present invention includes the following specific steps:
s1, acquiring gray value information of the image to be detected and the target template image;
s2, representing the possible position of the candidate template image with the best matching by the individual position in the adaptive variation longicorn colony optimization algorithm, setting the parameters of the adaptive variation longicorn colony optimization algorithm, and randomly initializing the longicorn colony in a search space;
recording the pixel size of the image to be detected as (H, W); marking the pixel size of the target template image as (M, N); the upper left corner of the image to be detected and the target template image are marked as a starting point (0, 0);
in the t iteration, the coordinate position of the ith individual is expressed as a vector
Figure BDA0002543349790000061
Velocity is represented by a vector as
Figure BDA0002543349790000062
Wherein the content of the first and second substances,
Figure BDA0002543349790000063
indicating the position information of the ith individual in the 1 st dimension at the t-th iteration,
Figure BDA0002543349790000064
representing the position information of the ith individual in the 2 nd dimension at the t-th iteration,
Figure BDA0002543349790000065
representing the velocity information of the ith individual in the 1 st dimension at the t-th iteration,
Figure BDA0002543349790000066
representing the velocity information of the ith individual in the 2 nd dimension at the tth iteration;
the candidate template image corresponding to each individual is obtained by intercepting the image to be detected, the pixel size of the candidate template image is the same as that of the target template image, and the upper left corner of the candidate template image is used as a starting point
Figure BDA0002543349790000067
round (·) represents a rounded rounding function;
the search space satisfies the following equation:
Figure BDA0002543349790000068
the ith individual initialization method comprises the following steps:
Figure BDA0002543349790000069
Figure BDA0002543349790000071
wherein rand is a random number between [0,1 ];
s3, searching a candidate template image which is optimally matched in a search space as a template matching result by using a self-adaptive variant longicorn swarm optimization algorithm;
step S3 includes the following specific steps:
s31, the optimal position of the population is
Figure BDA0002543349790000072
The optimal position of the ith individual is
Figure BDA0002543349790000073
Wherein the content of the first and second substances,
Figure BDA0002543349790000074
1 st dimension information representing the optimal position of the population at the t-th iteration,
Figure BDA0002543349790000075
denotes the t-th time2 nd dimension information of the optimal position of the population during iteration,
Figure BDA0002543349790000076
1 st dimension information representing the optimal position of the ith individual at the t-th iteration,
Figure BDA0002543349790000077
2 nd dimension information representing the optimal position of the ith individual at the t-th iteration; subscript g denotes the population, subscript i denotes the ith individual, superscript denotes the number of iterations;
calculating the optimal position of the group when the initial time, namely the iteration time t is 0
Figure BDA0002543349790000078
The ith individual optimum position is
Figure BDA0002543349790000079
Wherein f (-) is a function to be optimized; i is the population scale;
Figure BDA00025433497900000710
means that
Figure BDA00025433497900000711
Corresponding when taking the minimum value
Figure BDA00025433497900000712
The normalized similarity between the target template image and the candidate template image obtained by cutting in the image to be tested is gamma, and a function relation between a function f (-) to be optimized and the normalized similarity gamma is established:
Figure BDA00025433497900000713
Figure BDA00025433497900000714
s (m, n) and T (m, n) are pixel point gray values of the position coordinates (m, n) in the image to be detected and the target template image respectively; f (-) is belonged to [0,1], when the candidate template image is more similar to the target template image, the value of the function f (-) to be optimized is smaller, and the value is larger otherwise;
s32, judging whether the adaptive variant longicorn herd optimization algorithm meets a convergence condition, namely judging whether the adaptive variant longicorn herd optimization algorithm finishes iteration;
if the optimal solution XbestCorresponding function value f (X) to be optimizedbest) When the iteration time T is less than a set threshold value or reaches the maximum iteration time T, namely the convergence condition is met, ending the iteration, outputting the optimal solution of the matching value, and ending the adaptive variant longicorn group optimization algorithm;
if the optimal solution XbestCorresponding function value f (X) to be optimizedbest) If the iteration number T is not less than the set threshold and the iteration number T does not reach the maximum iteration number T, that is, if the convergence condition is not satisfied, executing step S33;
and S33, updating individual speed and position:
randomly generating a normalized direction vector for the ith individual
Figure BDA0002543349790000081
Comprises the following steps:
Figure BDA0002543349790000082
wherein rand (1,2) is a two-dimensional vector formed by random numbers of [0,1 ];
establishing a functional relation between the distance between the optimal positions of the groups and the optimal positions of the individuals and the whisker length, and calculating the whisker length of the ith individual in the t iteration
Figure BDA0002543349790000083
Comprises the following steps:
Figure BDA0002543349790000084
wherein β is a scaling factor; ith individual at the time of the t-th iterationBoth the left and right whisker length of (1) are Lti
Calculating the left whisker coordinate of the ith individual
Figure BDA0002543349790000085
Coordinates of right beard
Figure BDA0002543349790000086
Respectively as follows:
Figure BDA0002543349790000087
the update method of the speed and position of the ith individual is as follows:
Figure BDA0002543349790000088
Figure BDA0002543349790000089
wherein ω is the inertial weight; c. C1、c2Are all learning factors, the symbols represent the multiplication of corresponding elements of two matrices having the same shape one by one;
the calculation method of the parameters, i.e., the inertial weight ω and the scaling factor β, in the velocity update method is as follows:
Figure BDA00025433497900000810
s34, updating the individual optimal position and the group optimal position, wherein the updating method of the individual optimal position and the group optimal position is as follows:
Figure BDA00025433497900000811
Figure 2
s35, optimizing the function to be optimized by XbestMatch valueOptimal solution XbestThe update method (2) is as follows:
Figure BDA0002543349790000092
s36, calculating a population standard deviation σ and a variation probability p, wherein the calculation method of the population standard deviation σ and the variation probability p is as follows:
Figure BDA0002543349790000093
Figure BDA0002543349790000094
wherein σ0To normalize the factor, σ0The value of (a) is the population standard deviation which is not normalized during particle swarm initialization; omegaIs the weight of the variation probability standard deviation; omegaptThe iteration times weight is the variation probability; b is a variation probability offset constant;
Figure BDA0002543349790000095
is the mass center of the population,
Figure BDA0002543349790000096
the calculation of (c) is as follows:
Figure BDA0002543349790000097
s37, judging whether to carry out variation operation, if rand is less than p, executing step S38, otherwise, returning to execute step S32;
s38, carrying out disturbance variation on the optimal position of the group, randomly selecting alpha% dimensionality of the optimal position of the group for random disturbance, wherein the random disturbance mode of the k dimensionality is as follows:
Figure BDA0002543349790000098
wherein A is a disturbance amplitude value; randn is a random variable that follows a standard normal distribution;
and after the population optimal position perturbation mutation, returning to the step S32.
In this embodiment, MATLABR2016a is used as simulation software, and the template matching method based on the adaptive mutation longicorn swarm optimization algorithm is compared with the conventional template matching method based on traversal search and the conventional template matching method based on particle swarm optimization. The image to be measured is shown in fig. 2, and the size is 512 × 512; the target template image is shown in FIG. 3, cut from the image under test, and is 70X 60 in size.
The traditional template matching method based on traversal search is based on the principle that similarity is calculated one by one to find the best matching, and parameters, population scale and convergence conditions are not required to be set;
the parameters of the traditional template matching method based on particle swarm optimization are set as follows: ω ═ 0.4,0.9],c1=c2=2;
The parameters of the template matching method based on the adaptive variation longicorn herd optimization algorithm are set as follows: ω ═ 0.5,0.65],c1=c2=1.4962,β∈[0.1,0.25],α%=50%,A=0.34,ω=1.5,ωpt=2, b=0;
The population scales of the traditional template matching method based on particle swarm optimization, the template matching method based on traversal search and the template matching method based on the adaptive variation longicorn swarm optimization algorithm are all set as follows: i is 200; the convergence conditions of the three template matching methods are all target template image parts which are accurately matched with the image to be detected, namely the convergence conditions of the three template matching methods are all as follows: and (3) the optimal solution of the function to be optimized is smaller than a set threshold value 0, or the iteration time reaches the maximum iteration time T which is 200.
The three template matching methods each run independently 30 times to obtain the exact matching rates and running times of the three template matching methods as shown in table 1 below:
Figure BDA0002543349790000101
TABLE 1
As can be seen from the results in table 1, the exact matching rate of the conventional template matching method based on traversal search reaches 100%, because the method calculates the similarity for each pixel point, there is no omission, but the running time of the method is too long. The traditional template matching method based on particle swarm optimization relieves the problem of overlong running time of the template matching method based on traversal search to a certain extent, but the accurate matching rate of the method only reaches 73.3%.
The template matching method based on the adaptive variation longicorn herd optimization algorithm is more applicable to the accurate matching rate and the running time compared with the traditional two methods, and the template matching method based on the adaptive variation longicorn herd optimization algorithm is high in accurate matching rate and high in running speed and can better solve the problem of image template matching.
The invention is not to be considered as limited to the specific embodiments shown and described, but is to be understood to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention as defined by the appended claims.

Claims (2)

1. The template matching method of the longicorn herd optimization algorithm based on the self-adaptive variation is characterized by comprising the following specific steps of:
s1, acquiring gray value information of the image to be detected and the target template image, and searching corresponding matched candidate template images in the image to be detected according to the target template image;
s2, representing the positions of the matched candidate template images by the individual positions in the adaptive variant longicorn swarm optimization algorithm, setting parameters of the adaptive variant longicorn swarm optimization algorithm, and initializing the longicorn swarm randomly in a search space;
recording the pixel size of the image to be detected as (H, W); marking the pixel size of the target template image as (M, N); marking the upper left corners of the image to be detected and the target template image as starting points (0, 0);
at the time of the t iteration, the sitting position of the ith individual in the cattle groupThe target position is represented by a vector as
Figure FDA0002543349780000011
The velocity of the ith individual is represented by a vector
Figure FDA0002543349780000012
Wherein the content of the first and second substances,
Figure FDA0002543349780000013
indicating the position information of the ith individual in the 1 st dimension at the t-th iteration,
Figure FDA0002543349780000014
representing the position information of the ith individual in the 2 nd dimension at the t-th iteration,
Figure FDA0002543349780000015
representing the velocity information of the ith individual in the 1 st dimension at the t-th iteration,
Figure FDA0002543349780000016
representing the velocity information of the ith individual in the 2 nd dimension at the tth iteration;
the candidate template image corresponding to each individual is obtained by intercepting the image to be detected, the pixel size of the candidate template image is the same as that of the target template image, and the upper left corner of the candidate template image corresponding to the ith individual is taken as a starting point
Figure FDA0002543349780000017
round (·) represents a rounded rounding function;
the search space satisfies the following equation:
Figure FDA0002543349780000018
the initialization of the coordinate position and velocity of the ith individual is:
Figure FDA0002543349780000019
Figure FDA00025433497800000110
wherein rand is a random number between [0,1 ];
and S3, searching a candidate template image which is best matched in the search space as a template matching result by using a self-adaptive variant longicorn swarm optimization algorithm.
2. The template matching method based on the adaptive variation longicorn herd optimization algorithm of claim 1, wherein the step S3 comprises the following steps:
s31, the optimal position of the population is
Figure FDA0002543349780000021
The optimal position of the ith individual is
Figure FDA0002543349780000022
Wherein the content of the first and second substances,
Figure FDA0002543349780000023
1 st dimension information representing the optimal position of the population at the t-th iteration,
Figure FDA0002543349780000024
dimension 2 information representing the optimal position of the population at the t-th iteration,
Figure FDA0002543349780000025
1 st dimension information representing the optimal position of the ith individual at the t-th iteration,
Figure FDA0002543349780000026
2 nd dimension information representing the optimal position of the ith individual at the t-th iteration; subscript g denotes the population, subscript i denotes the thi individuals, and superscripts represent iteration times;
calculating the optimal position of the group when the initial time, namely the iteration time t is 0
Figure FDA0002543349780000027
The ith individual optimum position is
Figure FDA0002543349780000028
Wherein f (-) is a function to be optimized; i is the population scale;
Figure FDA0002543349780000029
is composed of
Figure FDA00025433497800000210
Corresponding when taking the minimum value
Figure FDA00025433497800000211
The normalized similarity between the target template image and the candidate template image obtained by cutting in the image to be tested is gamma, and the function relationship between the function f (-) to be optimized and the normalized similarity gamma is established as follows:
Figure FDA00025433497800000212
Figure FDA00025433497800000213
s (m, n) and T (m, n) are pixel point gray values of the position coordinates (m, n) in the image to be detected and the target template image respectively; f (-) is belonged to [0,1], when the candidate template image is more similar to the target template image, the value of the function f (-) to be optimized is smaller, and the value is larger otherwise;
s32, judging whether the adaptive variant longicorn herd optimization algorithm meets a convergence condition, namely judging whether the adaptive variant longicorn herd optimization algorithm finishes iteration;
if the optimal solution XbestCorresponding function value f (X) to be optimizedbest) When the iteration time T is less than a set threshold value or reaches the maximum iteration time T, namely the convergence condition is met, ending the iteration, outputting the optimal solution of the matching value, and ending the adaptive variant longicorn group optimization algorithm;
if the optimal solution XbestCorresponding function value f (X) to be optimizedbest) If the iteration number T is not less than the set threshold and the iteration number T does not reach the maximum iteration number T, that is, if the convergence condition is not satisfied, executing step S33;
and S33, updating individual speed and position:
randomly generating a normalized direction vector for the ith individual
Figure FDA00025433497800000214
Comprises the following steps:
Figure FDA0002543349780000031
wherein rand (1,2) is a two-dimensional vector formed by random numbers of [0,1 ];
establishing a functional relation between the distance between the optimal positions of the groups and the optimal positions of the individuals and the whisker length, and calculating the whisker length of the ith individual in the t iteration
Figure FDA0002543349780000032
Comprises the following steps:
Figure FDA0002543349780000033
wherein β is a scaling factor; the left and right whisker length of the ith individual at the t iteration are
Figure FDA0002543349780000034
Calculating the left whisker coordinate of the ith individual
Figure FDA0002543349780000035
Coordinates of right beard
Figure FDA0002543349780000036
Respectively as follows:
Figure FDA0002543349780000037
the update method of the speed and position of the ith individual is as follows:
Figure FDA0002543349780000038
Figure FDA0002543349780000039
wherein ω is the inertial weight; c. C1、c2Are all learning factors, the symbols represent the multiplication of corresponding elements of two matrices having the same shape one by one;
the calculation method of the parameters, i.e., the inertial weight ω and the scaling factor β, in the velocity update method is as follows:
Figure FDA00025433497800000310
s34, updating the individual optimal position and the group optimal position, wherein the updating method of the individual optimal position and the group optimal position is as follows:
Figure FDA00025433497800000311
Figure 1
s35, optimizing the function to be optimized by XbestBest solution of matching value XbestThe update method (2) is as follows:
Figure FDA0002543349780000041
s36, calculating a population standard deviation σ and a variation probability p, wherein the calculation method of the population standard deviation σ and the variation probability p is as follows:
Figure FDA0002543349780000042
Figure FDA0002543349780000043
wherein σ0To normalize the factor, σ0The value of (a) is the population standard deviation which is not normalized during particle swarm initialization; omegaIs the weight of the variation probability standard deviation; omegaptThe iteration times weight is the variation probability; b is a variation probability offset constant;
Figure FDA0002543349780000044
is the mass center of the population,
Figure FDA0002543349780000045
the calculation of (c) is as follows:
Figure FDA0002543349780000046
s37, judging whether to carry out variation operation, if rand is less than p, executing step S38, otherwise, returning to execute step S32;
s38, carrying out disturbance variation on the optimal position of the group, randomly selecting alpha% dimensionality of the optimal position of the group for random disturbance, wherein the random disturbance mode of the k dimensionality is as follows:
Figure FDA0002543349780000047
wherein A is a disturbance amplitude value; randn is a random variable that follows a standard normal distribution;
and after the population optimal position perturbation mutation, returning to the step S32.
CN202010553460.2A 2020-06-17 2020-06-17 Template matching method of longicorn group optimization algorithm based on self-adaptive variation Active CN111814839B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010553460.2A CN111814839B (en) 2020-06-17 2020-06-17 Template matching method of longicorn group optimization algorithm based on self-adaptive variation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010553460.2A CN111814839B (en) 2020-06-17 2020-06-17 Template matching method of longicorn group optimization algorithm based on self-adaptive variation

Publications (2)

Publication Number Publication Date
CN111814839A true CN111814839A (en) 2020-10-23
CN111814839B CN111814839B (en) 2023-09-01

Family

ID=72846580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010553460.2A Active CN111814839B (en) 2020-06-17 2020-06-17 Template matching method of longicorn group optimization algorithm based on self-adaptive variation

Country Status (1)

Country Link
CN (1) CN111814839B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598313A (en) * 2020-12-29 2021-04-02 南方电网数字电网研究院有限公司 Electricity utilization scheduling method and device based on longicorn stigma search algorithm and computer equipment
CN112927168A (en) * 2021-03-26 2021-06-08 江西理工大学 Image enhancement method based on longicorn stigma search and differential evolution hybrid algorithm
CN113326856A (en) * 2021-08-03 2021-08-31 电子科技大学 Self-adaptive two-stage feature point matching method based on matching difficulty
CN113434982A (en) * 2021-07-07 2021-09-24 合肥工业大学 Inverse kinematics solution method of electric intelligent bionic climbing robot
CN113570647A (en) * 2021-07-21 2021-10-29 中国能源建设集团安徽省电力设计院有限公司 Stereo target space registration method between oblique photography and remote sensing optical image
CN116152316A (en) * 2023-04-17 2023-05-23 山东省工业技术研究院 Image registration method based on self-adaptive parameter particle swarm algorithm

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915969A (en) * 2015-05-21 2015-09-16 云南大学 Template matching tracking method based on particle swarm optimization
WO2018072351A1 (en) * 2016-10-20 2018-04-26 北京工业大学 Method for optimizing support vector machine on basis of particle swarm optimization algorithm
CN110288074A (en) * 2018-12-04 2019-09-27 东华大学 A kind of improvement longicorn palpus searching algorithm based on the mechanism of encirclement

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915969A (en) * 2015-05-21 2015-09-16 云南大学 Template matching tracking method based on particle swarm optimization
WO2018072351A1 (en) * 2016-10-20 2018-04-26 北京工业大学 Method for optimizing support vector machine on basis of particle swarm optimization algorithm
CN110288074A (en) * 2018-12-04 2019-09-27 东华大学 A kind of improvement longicorn palpus searching algorithm based on the mechanism of encirclement

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
冯浩;: "基于自适应粒子群优化的图像匹配算法", 宿州学院学报, no. 11 *
冯浩;李现伟;: "基于改进粒子群算法的图像匹配技术研究", 安阳工学院学报, no. 06 *
唐艳;展华伟;唐组阁;杨丹;: "基于天牛须优化的BAS-CRI图像修复算法", 太原师范学院学报(自然科学版), no. 04 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598313A (en) * 2020-12-29 2021-04-02 南方电网数字电网研究院有限公司 Electricity utilization scheduling method and device based on longicorn stigma search algorithm and computer equipment
CN112598313B (en) * 2020-12-29 2023-02-21 南方电网数字电网研究院有限公司 Electricity utilization scheduling method and device based on longicorn stigma search algorithm and computer equipment
CN112927168A (en) * 2021-03-26 2021-06-08 江西理工大学 Image enhancement method based on longicorn stigma search and differential evolution hybrid algorithm
CN112927168B (en) * 2021-03-26 2023-04-18 江西理工大学 Image enhancement method based on longicorn stigma search and differential evolution hybrid algorithm
CN113434982A (en) * 2021-07-07 2021-09-24 合肥工业大学 Inverse kinematics solution method of electric intelligent bionic climbing robot
CN113434982B (en) * 2021-07-07 2022-09-27 合肥工业大学 Inverse kinematics solution method of electric intelligent bionic climbing robot
CN113570647A (en) * 2021-07-21 2021-10-29 中国能源建设集团安徽省电力设计院有限公司 Stereo target space registration method between oblique photography and remote sensing optical image
CN113326856A (en) * 2021-08-03 2021-08-31 电子科技大学 Self-adaptive two-stage feature point matching method based on matching difficulty
CN116152316A (en) * 2023-04-17 2023-05-23 山东省工业技术研究院 Image registration method based on self-adaptive parameter particle swarm algorithm

Also Published As

Publication number Publication date
CN111814839B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN111814839A (en) Template matching method of longicorn group optimization algorithm based on self-adaptive variation
US10891511B1 (en) Human hairstyle generation method based on multi-feature retrieval and deformation
US11107242B2 (en) Detecting pose using floating keypoint(s)
US11017210B2 (en) Image processing apparatus and method
CN108010069B (en) Rapid image matching method based on whale optimization algorithm and gray correlation analysis
CN110853064B (en) Image collaborative segmentation method based on minimum fuzzy divergence
CN112085055B (en) Black box attack method based on transfer model Jacobian array feature vector disturbance
CN107862680B (en) Target tracking optimization method based on correlation filter
CN103262118A (en) Attribute value estimation device, attribute value estimation method, program, and recording medium
WO2014112346A1 (en) Device for detecting feature-point position, method for detecting feature-point position, and program for detecting feature-point position
CN111260701A (en) Multi-mode retina fundus image registration method and device
CN111242971B (en) Target tracking method based on improved double-center particle swarm optimization algorithm
CN109712146B (en) EM multi-threshold image segmentation method and device based on histogram
CN110598595A (en) Multi-attribute face generation algorithm based on face key points and postures
CN110070120B (en) Depth measurement learning method and system based on discrimination sampling strategy
CN116052209B (en) Processing method of infrared image and standard 3D human body model and storage medium
CN111145221A (en) Target tracking algorithm based on multi-layer depth feature extraction
CN112733758B (en) Curve-based three-dimensional face recognition method and system under Riemann geometric invariance
CN108596048B (en) Target tracking detection method based on correlation filter
Sang et al. Unseen head pose prediction using dense multivariate label distribution
JP2010073138A (en) Feature point detector, feature point detection method, and feature point detection program
Wu et al. Real-time visual tracking via incremental covariance model update on Log-Euclidean Riemannian manifold
CN112580496B (en) Face relative attitude estimation method combining face key point detection
US20240177520A1 (en) Image processing device, image processing method, and recording medium
CN118172820A (en) Three-dimensional face recognition method applied to point cloud

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
GR01 Patent grant
GR01 Patent grant