Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
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
const config = `
<View>
  <Image name="img" value="$image" showMousePos="true" zoom="true"></Image>
  <PolygonLabels name="tag" toName="img" strokewidth="5" fillcolor="red" pointstyle="circle" pointsize="small">
    <Label value="Hello" background="red"></Label>
    <Label value="World" background="blue"></Label>
  </PolygonLabels>
</View>
`;
 
const data = {
  image: "https://upload.wikimedia.org/wikipedia/commons/3/3f/Fronalpstock_big.jpg",
};
 
const result = [
  {
    id: "XSMXwwsaTa",
    from_name: "tag",
    to_name: "img",
    type: "polygonlabels",
    origin: "manual",
    original_width: 10109,
    original_height: 4542,
    image_rotation: 0,
    value: {
      points: [
        [27.199999999999996, 41.246290801186944],
        [25.73333333333333, 70.62314540059347],
        [48.13333333333333, 62.61127596439169],
        [48.13333333333333, 32.93768545994065],
      ],
      polygonlabels: ["Hello"],
      closed: true,
    },
  },
  {
    id: "DSm8iGlaA8",
    from_name: "tag",
    to_name: "img",
    type: "polygonlabels",
    origin: "manual",
    original_width: 10109,
    original_height: 4542,
    image_rotation: 0,
    value: {
      points: [
        [60.788381742738586, 76.21247113163972],
        [65.87136929460583, 52.19399538106235],
        [88.69294605809128, 60.508083140877595],
        [87.75933609958506, 87.06697459584295],
      ],
      closed: true,
      polygonlabels: ["World"],
    },
  },
];
 
const title = "Polygons on Image";
 
module.exports = { config, data, result, title };