【发布时间】:2020-04-20 13:42:54
【问题描述】:
我正在使用背页并尝试如下所示进行连接。 see image here 代码使用背面分享
【问题讨论】:
-
能否在您的问题中添加minimal reproducible example?这将确保此问题对未来遇到相同问题的用户仍然有用,即使您不再工作
-
您可能想阅读How to Ask
我正在使用背页并尝试如下所示进行连接。 see image here 代码使用背面分享
【问题讨论】:
快速而肮脏的 hack 箭头:\draw[arrow] ([xshift=-0.5cm]Modify AC coefficients.south) -| ([xshift=3cm]Watermarked Image.north);
请
\tikzstyle,它已过时。latin1 是否真的适合您的文档编码。绝大多数编辑器默认使用 utf8。x 误用为\times
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
%%%<
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
%%%>
\begin{document}
\pagestyle{empty}
\tikzset
{
arrow/.style={
->,>=stealth}
}
% Define block styles
\tikzstyle{decision} = [diamond, draw,
text width=4.5em, text badly centered, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{block1} = [rectangle, draw,
text width=6em, text centered, rounded corners, minimum height=4em]
\tikzstyle{block2} = [rectangle, draw,
text width=15em, text centered, rounded corners, minimum height=4em]
\tikzstyle{block3} = [rectangle, draw,
text width=20em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\begin{tikzpicture}[node distance = 2.5cm, auto]
% Place nodes
\node [block3] (Watermarked Image) {Watermarked Image};
\node[decision, above of =Watermarked Image,node distance=4cm ] (Difference between selected coefficients) {Difference between selected coefficients };
\node [block, left of=Difference between selected coefficients, node distance=3.5cm] (Inverse DCT for each block)
{Inverse DCT for each block};
\node [block, right of=Difference between selected coefficients, node distance=3.5cm] (Modify AC coefficients)
{Modify AC coefficients and perform Inverse DCT for each block};
\node [block2, above of=Difference between selected coefficients] (Genetic Algorithm)
{Genetic Algorithm search DCT coefficients to find best option for insert watermark};
\node [block, above of=Genetic Algorithm] (DCT for each block)
{DCT for each block};
\node [block, left of=DCT for each block] (Watermark Message)
{Watermark Message};
\node [block, above of=DCT for each block] (8x8 Image Blocking)
{8x8 Image Blocking};
\node [block, above of=Watermark Message] (Host Image)
{Host Image};
% Draw edges
\path [line] (Host Image) -- (8x8 Image Blocking);
\path [line] (8x8 Image Blocking) -- (DCT for each block);
\path [line] (DCT for each block) -- (Genetic Algorithm);
%\path [line] (Watermark Message) -- (Genetic Algorithm);
%\path [line] (Modify AC coefficients) -- (Inverse DCT for each block);
%\path [line] (Inverse DCT for each block) -- (Watermarked Image);
\path [line] (Genetic Algorithm) -- (Difference between selected coefficients);
\path [line] (Difference between selected coefficients) -- node {yes} (Inverse DCT for each block);
\path [line] (Difference between selected coefficients) -- node {no}(Modify AC coefficients);
\coordinate (n2nl) at ([xshift=-2cm]Genetic Algorithm.north);
\coordinate (n2nr) at ([xshift=-3cm]Watermarked Image.north);
\coordinate (n2ns) at ([xshift=3cm]Watermarked Image.east);
\draw[arrow] (Watermark Message.south -| n2nl) -- (n2nl);
\draw[arrow] (Inverse DCT for each block.south -| n2nr) -- (n2nr);
% \draw[arrow] (Modify AC coefficients.south -| n2ns) -- (n2ns);
\draw[arrow] ([xshift=-0.5cm]Modify AC coefficients.south) -| ([xshift=3cm]Watermarked Image.north);
\end{tikzpicture}
\end{document}
【讨论】: