\documentclass[8pt,twocolumn]{ctexart}
%\usepackage{amssymb}
%\usepackage{bm}
%\usepackage{textcomp} %命令\textacutedbl的包,二阶导符号
% Page length commands go here in the preamble
%\setlength{\oddsidemargin}{-0.25in} % Left margin of 1 in + 0 in = 1 in
\setlength{\textwidth}{12in} % 指定显示纸张宽度Right margin of 8.5 in - 1 in - 6.5 in = 1 in
%\setlength{\topmargin}{-.75in} % Top margin of 2 in -0.75 in = 1 in
%\setlength{\textheight}{9.2in} % Lower margin of 11 in - 9 in - 1 in = 1 in
%\setlength{\parindent}{0in}
% 前期准备——start
\makeatletter
\newif\if@restonecol
\makeatother
\let\algorithm\relax
\let\endalgorithm\relax
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}%[ruled,vlined]{
\usepackage{algpseudocode}
\usepackage{amsmath}
\renewcommand{\algorithmicrequire}{\textbf{Input:}} % Use Input in the format of Algorithm
\renewcommand{\algorithmicensure}{\textbf{Output:}} % Use Output in the format of Algorithm
% 前期准备——end
\begin{document}
% 主体algorithm部分——start
\begin{algorithm}
\caption{Dual-Template Update Algorithm Based on Re-Initialization}
\LinesNumbered
\KwIn{Search Images: $X$ ,Template Image: $T$ , Target initial position: $pos_ini$,target image: $x$}
\KwOut{Service image storage server $storageserver$,and the image transfer path $path$}
Implementing a twin network-based tracking algorithm\;
\If{ $Scoremax(X,T)>Th$}
{
Set this frame target as an backup template,Save the target matching position:$pos_t_m$ ,and target matching image: $x_t_m$ \;
}
\Else
{
\State keep tracking \;
}
\If{ $Scoremax(X,T)<Td$}
{
Target tracking failure,$count++$\;
\If{ $count>2$}
{
$count=0$;Template updates using initial templates:$pos_ini$\;
}
\Else
{
\State updates using backup templates:$pos_t_m$\;
}
}
\Else
{
\State keep tracking \;
}
\textbf{final} \;
\textbf{return} $storageserver$ and $path$;
\end{algorithm}
% 主体algorithm部分——end
\end{document}
Overleaf在线编辑伪代码示例
最新推荐文章于 2024-06-01 15:26:29 发布