Overleaf在线编辑伪代码示例

\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}



在这里插入图片描述

  • 11
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值