如何将图像放入流程图内或图表的一角

如何将图像放入流程图内或图表的一角

所以我愿意得到类似的东西在此处输入图片描述

但不知何故,由于我缺乏关于乳胶的专业知识,所以我有这个代码

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\definecolor{cola}{HTML}{F23030}
\definecolor{colb}{HTML}{F28705}
\definecolor{colc}{HTML}{F29F05}
\definecolor{cold}{HTML}{F2CB05}
\definecolor{cole}{HTML}{267365}
\tikzset{
    customshape/.style={
      lightgray!50,
      line width=0.1cm,
      arrows={-Stealth }
    },
mybox/.style={
      rectangle,
      rounded corners=0.25cm,
      text width=6cm,
      minimum height=1.5cm,
      minimum width=8cm,
      fill=lightgray,
      text=white,
      font=\rmfamily\bfseries,
      draw=white,
      line width=2pt,
      align=center}}



\begin{document}

\begin{figure}[h]
 \centering
\begin{tikzpicture}
\node[mybox,fill=cola ] (A){\MakeUppercase{Input Images}}; 
\node[mybox,fill=colb,below right=0.2cm and -5cm of A] (B) { \MakeUppercase{Extraction of image representation}};
\node[mybox,fill=colc,below right=0.2cm and -5cm of B] (C) {\MakeUppercase{Representation scheme}};
\node[mybox,fill=cold,below right=0.2cm and -5cm of C] (D) {\MakeUppercase{Analysis;Interpretation;\\Understranding}};
\node[mybox,fill=cole,below right=0.2cm and -5cm of D] (E) {\MakeUppercase{decision and result}};


\draw[customshape,cola!20] ([xshift=0.4cm]A.south west) |- (B.mid west);
\draw[customshape,colb!20] ([xshift=0.4cm]B.south   west) |- (C.west);
\draw[customshape,colc!20] ([xshift=0.4cm]C.south west) |- (D.west);
\draw[customshape,cold!20] ([xshift=0.4cm]D.south west) |- (E.west);

\end{tikzpicture}
\caption{The initial stage of visual recognition is object detection.}
\label{fig:enter-label}
\end{figure}

\end{document}

答案1

您可以将图像作为 包含进来path pictureA定义节点后,使用以下命令放置图像:

\node[blue, mycircle=example-image-duck] at (A.north east){};

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\definecolor{cola}{HTML}{F23030}
\definecolor{colb}{HTML}{F28705}
\definecolor{colc}{HTML}{F29F05}
\definecolor{cold}{HTML}{F2CB05}
\definecolor{cole}{HTML}{267365}
\tikzset{
    customshape/.style={
      lightgray!50,
      line width=0.1cm,
      arrows={-Stealth }},
    mybox/.style={
      rectangle,
      rounded corners=0.25cm,
      text width=6cm,
      minimum height=1.5cm,
      minimum width=8cm,
      fill=lightgray,
      text=white,
      font=\rmfamily\bfseries,
      draw=white,
      line width=2pt,
      align=center},
    mycircle/.style={
      draw, 
      circle, 
      line width=3pt, 
      inner sep=0pt, 
      minimum size=1cm, 
      path picture={\node at (path picture bounding box.center){\includegraphics[height=1cm]{#1}};}}
}

\begin{document}

\begin{figure}[h]
 \centering
\begin{tikzpicture}
\node[mybox,fill=cola ] (A){\MakeUppercase{Input Images}}; 
  \node[blue, mycircle=example-image-duck] at (A.north east){};
\node[mybox,fill=colb,below right=0.2cm and -5cm of A] (B) { \MakeUppercase{Extraction of image representation}};
\node[mybox,fill=colc,below right=0.2cm and -5cm of B] (C) {\MakeUppercase{Representation scheme}};
\node[mybox,fill=cold,below right=0.2cm and -5cm of C] (D) {\MakeUppercase{Analysis;Interpretation;\\Understranding}};
\node[mybox,fill=cole,below right=0.2cm and -5cm of D] (E) {\MakeUppercase{decision and result}};


\draw[customshape,cola!20] ([xshift=0.4cm]A.south west) |- (B.mid west);
\draw[customshape,colb!20] ([xshift=0.4cm]B.south   west) |- (C.west);
\draw[customshape,colc!20] ([xshift=0.4cm]C.south west) |- (D.west);
\draw[customshape,cold!20] ([xshift=0.4cm]D.south west) |- (E.west);

\end{tikzpicture}
\caption{The initial stage of visual recognition is object detection.}
\label{fig:enter-label}
\end{figure}

\end{document}

相关内容