控制形状和图像 + tikz 添加路径图像背景

控制形状和图像 + tikz 添加路径图像背景

此处提到了所使用的代码和所做的努力:链接1链接2 我最终更新了这个代码,但是 面对错误

\documentclass{article}
\usepackage[table,xcdraw,dvipsnames,svgnames,x11names]{xcolor}
\usepackage{tikz, fontsize}
\usepackage{relsize}
\usetikzlibrary{arrows.meta,positioning,shapes.misc, shadings, fadings}
\tikzset{
    mybox/.style={
        rounded rectangle ,rounded rectangle east arc=concave, 
%       rounded corners=2cm,
        text width=4cm,
        minimum height=2.5cm,
        fill=lightgray,
        text=white,
        font=\rmfamily\bfseries,
        line width=2pt,
        align=center},
    mycircle/.style={circle,minimum height=2cm,
    align=center, path picture={
        \node[anchor=center, top color={##2},bottom color={##3}, circle, minimum size=2cm, inner sep=0pt](ZZ) at (path picture bounding box.center){};
        \node at (path picture bounding ZZ.center){\includegraphics[height=1.5cm]{#1}};
        }},}

\tikzset{fontscale/.style = {font=\relsize{#1}}
}
\begin{document}
    
    \begin{figure}[h]
        \centering
        \begin{tikzpicture}
            \draw [postaction={path fading=north,fill=white}]
                        [postaction={path fading=south,fading angle=-45,fill=lightgray,opacity=.8}]
                            [left color=Green,right color=Green3,draw=white, line width=5mm]
%
                (0,0)circle  [radius=4cm] 
                    node[align=center, , Chartreuse4] (A) 
                        {\Hugerrr\bfseries Image\\ \fontsize{40}{50}\selectfont Processing};
\node[mybox,
                        fill=DeepSkyBlue3,xshift=-3cm 
                        ] 
                        at (150:6cm) (A){Image \\classification};
\node[blue, mycircle=example-image-duck ,top color=pink,red] 
at ([xshift=0.2cm,yshift=-4pt]A.mid east){};
            
        \end{tikzpicture}
        \caption{The initial stage of visual recognition is object detection.}
        \label{fig:enter-label}
    \end{figure}
    
\end{document}

同时我正在寻找类似这样的东西:所需图像

代码正在编译,但我遇到了 9 个错误,我不想忽略它,可能是因为我设置了 3 个参数,并且我正确地调用或提及了它们

答案1

对于周围环境的形状,现成rounded rectangle的可用Tikz- 您只需添加east arc = concave- 您可以轻松调整间距xshiftyshift

在此处输入图片描述

平均能量损失

\documentclass{article}
\usepackage[table,xcdraw,dvipsnames,svgnames,x11names]{xcolor}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning,shapes.misc}
\tikzset{
    mybox/.style={
        rounded rectangle ,rounded rectangle east arc=concave, 
%       rounded corners=2cm,
        text width=4cm,
        minimum height=1.7cm,
        minimum width=2.5cm,
        fill=lightgray,
        text=white,
        font=\rmfamily\bfseries,
        draw=white,
        line width=2pt,
        align=center},
    mycircle/.style={
        draw=white, 
        circle, 
        line width=3pt, 
        inner sep=16pt, 
        path picture={\node at (path picture bounding box.center){\includegraphics[height=2cm]{#1}};}},
    cir/.style ={circle,align=center,minimum width=5cm,fill=Pink},
}

\begin{document}
    
    \begin{figure}[h]
        \centering
        \begin{tikzpicture}
            
            \node[mybox,fill=DeepSkyBlue3 ] at (120:6cm) (A){Image \\classification};
            \node[blue, mycircle=example-image-duck, draw=black,  ] at ([xshift=0.2cm,yshift=-4pt]A.mid east){};
            
        \end{tikzpicture}
        \caption{The initial stage of visual recognition is object detection.}
        \label{fig:enter-label}
    \end{figure}
    
\end{document}`

编辑包括带阴影的中央圆圈

在此处输入图片描述

平均能量损失

\documentclass{article}
\usepackage[table,xcdraw,dvipsnames,svgnames,x11names]{xcolor}
\usepackage{tikz, fontsize}
\usetikzlibrary{arrows.meta,positioning,shapes.misc, shadings, fadings}
\tikzset{
    mybox/.style={
        rounded rectangle ,rounded rectangle east arc=concave, 
%       rounded corners=2cm,
        text width=4cm,
        minimum height=1.7cm,
        minimum width=2.5cm,
        fill=lightgray,
        text=white,
        font=\rmfamily\bfseries,
        draw=white,
        line width=2pt,
        align=center},
    mycircle/.style={
        draw=white, 
        circle, 
        line width=3pt, 
        inner sep=16pt, 
        path picture={\node at (path picture bounding box.center){\includegraphics[height=2cm]{#1}};}},
%   cir/.style ={circle,align=center,minimum width=5cm,fill=Pink},
}
\usepackage{relsize}

\tikzset{fontscale/.style = {font=\relsize{#1}}
}
\begin{document}
    
    \begin{figure}[h]
        \centering
        \begin{tikzpicture}
            \draw [postaction={path fading=south,fill=white}]
                        [postaction={path fading=south,fading angle=-45,fill=blue,opacity=.5}]
                            [left color=blue,right color=white,draw=white, line width=6mm]
%
                (0,0)circle  [radius=8em] 
                    node[align=center, , black!40!blue] (A) 
                        {\Hugerrr\bfseries Image\\ \fontsize{40}{30}\selectfont Processing};
            \node[
                        mybox,
                        fill=DeepSkyBlue3 
                        ] 
                        at (120:6cm) (A){Image \\classification};
            \node[
                        blue, 
                        mycircle=example-image-duck, 
                        draw=black,  
                        ] 
                        at ([xshift=0.2cm,yshift=-4pt]A.mid east){};
            
        \end{tikzpicture}
        \caption{The initial stage of visual recognition is object detection.}
        \label{fig:enter-label}
    \end{figure}
    
\end{document}

编辑2- 回应 OP 的评论 -can you please check code ,and tell me what can i do to not have errors

在此处输入图片描述

平均能量损失

\documentclass{article}
\usepackage[table,xcdraw,dvipsnames,svgnames,x11names]{xcolor}
\usepackage{tikz, fontsize}
\usetikzlibrary{arrows.meta,positioning,shapes.misc, shadings, fadings}
\tikzset{
    mybox/.style={
        rounded rectangle ,
        rounded rectangle east arc=concave, 
        text width=4cm,
        minimum height=1.7cm,
        minimum width=2.5cm,
        fill=lightgray,
        text=white,
        font=\rmfamily\bfseries,
        draw=white,
        line width=2pt,
        align=center},
    mycircle/.style={
        circle, 
        line width=3pt, 
        inner sep=16pt, 
        path picture={
            \node at (path picture bounding box.center){\includegraphics[height=2cm]{#1}};}}
}

\begin{document}
    
    \begin{figure}[h]
        \centering
        \begin{tikzpicture}
            \draw 
            [postaction={
                                    path fading=south,
                                    fill=white}]
            [postaction={
                                    path fading=south,
                                    fading angle=-45,
                                    fill=blue,
                                    opacity=.5}]
            [left color=blue,
            right color=white,
            draw=white, 
            line width=6mm]
            
            
            (0,0)circle  [radius=8em] 
            node[
                    align=center, 
                    black!40!blue] 
                    (A) 
            {\Hugerrr\bfseries Image\\ \fontsize{40}{30}\selectfont Processing};
            
            \node[
            mybox,
            fill=DeepSkyBlue3 
            ] 
            at (150:8cm) (B){Image \\classification};
            
            \node[
            mycircle=example-image-duck, 
            draw=blue,  
            ] 
            at (B.east){};
            
        \end{tikzpicture}
        \caption{The initial stage of visual recognition is object detection.}
        \label{fig:enter-label}
    \end{figure}
    
\end{document}

答案2

正因为结果具有挑战性,这里提供了一种安排,以获得更符合要求的结果,只是阴影环境使用的颜色与填充环境不同,最好问一下为什么会发生这种情况。通常的公式是创建具有必要属性的对象,然后甚至可以嵌套它们,重用它们,简而言之,我希望代码是可读的。

结果:

在此处输入图片描述

梅威瑟:

\documentclass[tikz,border=3.14pt]{standalone}
\usepackage[sfdefault,light,condensed]{roboto} 
\usepackage{fontawesome}
\usetikzlibrary{positioning,backgrounds,ducks,calc,shadings}
\definecolor{BG}{HTML}{F6FAFE}
\definecolor{SB}{HTML}{797d90}
\definecolor{C1}{HTML}{6EA3D1}
\definecolor{C2}{HTML}{004688}
\definecolor{C3}{HTML}{003161}
\definecolor{C4}{HTML}{FE9100}
\definecolor{C5}{HTML}{CA4D52}
\definecolor{C6}{HTML}{9E3D5B}

\begin{document}
    \begin{tikzpicture}[background rectangle/.style={fill=BG}, show background rectangle]
        
    \def\ShadeButton(#1)[#2][#3][#4]#5#6{
        \begin{scope}[shift={(#1)}]
            \shade[left color=#5, right color=white,shading angle=135] (0,0) circle (#2);
            \shade[left color=#5, right color=white,shading angle=-45] (0,0) circle (#2-1.5mm);
            \path [path picture={\node at (path picture bounding box.center){
                    \begin{tikzpicture}
                        \shade[outer color=#5, inner color=white,shading = radial] (0mm,0mm) circle (#2*5);
                        \path(0,0) -- (-6.5*#2,-6.5*#2);
                    \end{tikzpicture}
                };}](0,0) circle (#2-3mm)node[align=center,xscale=#3,yscale=#4]{#6};
        \end{scope}
    }

    \def\Sat(#1)[#2][#3][#4]#5#6#7#8{
        \begin{scope}[shift={(#1)},xscale=#4]
            \shade[shading angle=135] (0,0) circle (#2);
            \fill[#5,opacity=0.5] (0,0) circle (#2);
            \fill[#5,opacity=0.5] (0,0) circle (#2);
            \path [path picture={\node at (path picture bounding box.center){
                    \begin{tikzpicture}
                        \shade[outer color=black!50!BG, inner color=white,shading = radial] (0mm,0mm) circle (#2*5);
                        \path(0,0) -- (-6.5*#2,-6.5*#2);
                    \end{tikzpicture}
                };}](0,0) circle (#2-3mm);
            \fill[#5](180-55:#2+3mm) arc(180-55:180+55:#2+3mm)-- ++(-15em,0) arc (180+55:180-55:#2+3mm) -- cycle;
            \draw (-9em-#2/2,0)node[align=center,xscale=#3*0.9,yscale=#3*1,font=\bf,text=white]{#6};
            \draw (0,0)node[scale=#7, align=center]{#8};
        \end{scope}
    }

    \def\DUCK{% TO PUT DUCKS IN NODES
        \begin{tikz}
            \tikz\shuffleducks\duck[\randomhead,scale=0.3];
            \tikz\shuffleducks\duck[\randomhead,scale=0.3,xshift=1cm];
            \tikz\shuffleducks\duck[\randomhead,scale=0.3,xshift=-1cm];
        \end{tikz}
    }

    % Start drawing the thing
    
    \ShadeButton(0,0)[27mm][1.6][1.3]{SB!100!SB}{\Huge\bf IMAGE\\ \ttfamily Processing}
    \Sat(180-60:5)[14mm][2][1]{C1}{Image \\ clasification}{1}{\DUCK}
    \Sat(180:5)[14mm][2][1]{C2}{Object \\ detection And \\ localization}{4}{\faSearch}
    \Sat(180+60:5)[14mm][1.6][1]{C3}{Image \\ segmentation \\ and object \\recognition}{0.7}{\DUCK \\ \DUCK \\ \DUCK}
    \Sat(60:5)[14mm][2][-1]{C4}{Image \\ understanding\\ and analysis}{1}{
        \begin{tikzpicture}
            \path [path picture={\node at (path picture bounding box.center){
                \begin{tikzpicture}
                    \tikz\shuffleducks\duck[\randomhead,scale=1];
                \end{tikzpicture}
            };}](0,0) circle (10.9mm);
        \end{tikzpicture}
    }
    \Sat(0:5)[14mm][2][-1]{C5}{Image \\ Generation \\ and Synthesis}{1}{\includegraphics[height=12mm]{example-image-a}}
    \Sat(-60:5)[14mm][2][-1]{C6}{Image \\ Restoration And \\ Enhancement}{1}{\includegraphics[height=12mm]{example-image-duck}}
    
    % Adendum
    
    \ShadeButton(-90:8)[20mm][2.1][1.2]{cyan!50!green!70!black}{\Huge NOD\\ \rmfamily JX5893\\ \tiny not enigmatic \\[-1em] \tiny content}
    \Sat($(-90:8)+(180:3.5)$)[10mm][1.8][1]{cyan!50!green!70!black}{another position \\ using calc}{0.5}{\DUCK}
    \Sat($(-90:8)+(0:3.5)$)[10mm][1.8][-1]{cyan!20!green!70!black}{another position \\ using xscale=-1}{0.5}{\DUCK}
            
    \end{tikzpicture}
    
\end{document}

注意:有些ducks可能会有所不同,可能会有多个编码警告,但这是由于使用fontawesome造成的,使用其他字体可以解决。

相关内容