轮胎外观检测添加思谋语义分割模型检测工具
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
 
namespace LB_VisionControls
{
    public class VisualMarker
    {
        public readonly Rectangle rectangle;
 
        public VisualMarker(Rectangle rectangle)
        {
            this.rectangle = rectangle;
        }
 
        public virtual void Draw(Graphics gr, Pen pen)
        {
        }
 
        public virtual Cursor Cursor
        {
            get { return Cursors.Hand; }
        }
    }
 
    class CollapseFoldingMarker: VisualMarker
    {
        public readonly int iLine;
 
        public CollapseFoldingMarker(int iLine, Rectangle rectangle)
            : base(rectangle)
        {
            this.iLine = iLine;
        }
 
        public override void Draw(Graphics gr, Pen pen)
        {
            //draw minus
            gr.FillRectangle(Brushes.White, rectangle);
            gr.DrawRectangle(pen, rectangle);
            gr.DrawLine(pen, rectangle.Left + 2, rectangle.Top + rectangle.Height / 2, rectangle.Right - 2, rectangle.Top + rectangle.Height / 2);
        }
    }
 
    class ExpandFoldingMarker : VisualMarker
    {
        public readonly int iLine;
 
        public ExpandFoldingMarker(int iLine, Rectangle rectangle)
            : base(rectangle)
        {
            this.iLine = iLine;
        }
 
        public override void Draw(Graphics gr, Pen pen)
        {
            //draw plus
            gr.FillRectangle(Brushes.White, rectangle);
            gr.DrawRectangle(pen, rectangle);
            gr.DrawLine(Pens.Red, rectangle.Left + 2, rectangle.Top + rectangle.Height / 2, rectangle.Right - 2, rectangle.Top + rectangle.Height / 2);
            gr.DrawLine(Pens.Red, rectangle.Left + rectangle.Width / 2, rectangle.Top + 2, rectangle.Left + rectangle.Width / 2, rectangle.Bottom - 2);
        }
    }
 
    public class FoldedAreaMarker : VisualMarker
    {
        public readonly int iLine;
 
        public FoldedAreaMarker(int iLine, Rectangle rectangle)
            : base(rectangle)
        {
            this.iLine = iLine;
        }
 
        public override void Draw(Graphics gr, Pen pen)
        {
            gr.DrawRectangle(pen, rectangle);
        }
    }
 
    public class StyleVisualMarker : VisualMarker
    {
        public Style Style{get;private set;}
 
        public StyleVisualMarker(Rectangle rectangle, Style style)
            : base(rectangle)
        {
            this.Style = style;
        }
    }
 
    public class VisualMarkerEventArgs : MouseEventArgs
    {
        public Style Style { get; private set; }
        public StyleVisualMarker Marker { get; private set; }
 
        public VisualMarkerEventArgs(Style style, StyleVisualMarker marker, MouseEventArgs args)
            : base(args.Button, args.Clicks, args.X, args.Y, args.Delta)
        {
            this.Style = style;
            this.Marker = marker;
        }
    }
}