hcts-hra / ecpo-annotator

Annotator for Page Segmentations in ECPO
https://ecpo.existsolutions.com/exist/apps/ecpo/
MIT License
2 stars 2 forks source link

Datenimport #39

Closed duncdrum closed 4 years ago

duncdrum commented 4 years ago

In GitLab by @MatthiasArnold on Jan 24, 2019, 11:47

anbei das komplette json aus der früheren annotationrestOfSequence.zip

groups sind nur nice to have

duncdrum commented 4 years ago

In GitLab by @line-o on May 21, 2019, 14:55

20Sequenz.json

duncdrum commented 4 years ago

In GitLab by @line-o on Jun 5, 2019, 16:40

das Datenformat unterscheidet sich erheblich vom Web-Annotation-Standard

Task metadaten werden grösstenteils missachtet.

Mapping:

Zuordnung zum Bild über project.tasks.frame.original (Dateiname)

project.tasks[x] => bild

bild.results.annotations[x] -> annotation

annotation.answers -> category

44 - image 45 - article 46 - advertisement 47 - additional Information

annotation.meta.group -> group

select all annotations with same group create group per group

annotation.points -> SVGSelector

annotation.id -> neu vergeben

duncdrum commented 4 years ago

In GitLab by @line-o on Jun 5, 2019, 16:42

changed the description

duncdrum commented 4 years ago

In GitLab by @MatthiasArnold on Jun 29, 2019, 18:33

wieviel aufwand wäre es, diese daten ins anno-tool zu importieren? das sind immerhin 3 komplett annotierte jahrgänge (ungruppiert) - da wir insgesamt nur 21 jahrgänge haben ist das ziemlich signifikant.

duncdrum commented 4 years ago

In GitLab by @MatthiasArnold on Jul 13, 2019, 07:43

es ist für uns sehr wichtig, diese daten importiert, angezeigt und editierbar zu bekommen. Leute vom EPFL wollen uns helfen, die seitenstruktur der zeitung zu analysieren (mit neuronalen netzwerken). dafür brauchen wir diese bereits korrigierten manuellen annotationen als trainingsdaten. und es steckt auch ziemlich viel (> ein halbes jahr) an arbeit drin...

duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 12:37

@MatthiasArnold das Koordinatensystem der Quelle muss definiert sein damit die Daten erfolgreich importiert werden können.

als Beispiel die erste Annotation des ersten Bildes in restlicheSequenz.json:

Quellbild:

"frame": {
    "path": "http://static1.pallas-ludens.com:80/sequences/c92a3a86-145a-4f0e-b4db-c5d88d68f031/0003b491-9062-4761-961a-0b75bcd142ad.jpg", 
    "frameIndex": 0, 
    "original": "sequences2/069/jb_0001_1919-03-03_0001+0004.jpg"
}, 

Ohne Zugriff auf das Originalbild (im JPEG-Format) ist es unmöglich Bildgrösse, -ausschnitt oder -rotation zu bestimmen.

Punkte:

"points": [
  [
    385, 
    360, 
    1939, 
    360, 
    1939, 
    438, 
    385, 
    438
  ]
], 

Angenommen es handelt sich oben aus Paaren von X,Y-Koordinaten ergibt sich:

p1( 385, 360),
p2(1939, 360),
p3(1939, 468),
p4( 385, 438)

Angenommen das Polygon (p1, p2, p3, p4) entspricht dieser Shape im ECPO-ImageAnnotator. Screenshot_2019-07-28_at_12.12.33

Dieses Polygon wird in ECPO repräsentiert durch:

<selector type="SvgSelector">
  <g transform="matrix(1 0 0 1 475.13 82.67)" id="s-15643085161977">
    <polygon points="-406.57,-7.77 406.57,-10.16 405.93,5.41 -406.37,10.17 "/>
  </g>
</selector>

Nach Anwendung der transformation, eine reine Verschiebung (translation) in x-Richtung um 475,13 Pixel und y-Richtung um 82,67, auf die Eckpunkte ergibt sich die Punkte p1-4:

[
  { x: 68.56, y: 74.9 },
  { x: 881.7, y: 72.51 },
  { x: 881.06, y: 88.08 },
  { x: 68.75999999999999, y: 92.84 }
]

Die absoluten Koordinaten unterscheiden sich also signifikant. Selbst nach proportionaler Skalierung mit einem Faktor von 2,2 weichen die Koordinaten ab. Möglicher Hinweis auf Zugeschnittenes Bildmaterial.

[
  { x: 150.83200000000002, y: 164.78000000000003 },
  { x: 1939.7400000000002, y: 159.52200000000002 },
  { x: 1938.332, y: 193.776 },
  { x: 151.272, y: 204.24800000000002 }
]

Fazit:

Die vorhandenen Annotationen können nur importiert werden wenn Quellbilder oder Bezugssystem bekannt sind.

duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 12:45

Nimmt man an das die oben als Beispiel verwendete Annotation dieser Form entspricht: Screenshot_2019-07-28_at_12.43.41

ergeben sich mit Skalierungsfaktor 4,5 folgende Eckpunkte:

[
  { x: 310.77, y: 339.3 },
  { x: 1984.1399999999999, y: 333.22499999999997 },
  { x: 1986.075, y: 403.38 },
  { x: 311.66999999999996, y: 420.07500000000005 }
]
duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 12:55

Der rechnerisch korrekte Umrechnungsfaktor ist 4,096 (1000 virtuelle Pixel des Fabric Canvas Overlays zu 4096 realen Pixeln Breite des Bildes).

[
  { x: 282.86976000000004, y: 308.83840000000004 },
  { x: 1806.00832, y: 303.3088 },
  { x: 1807.7696, y: 367.16544 },
  { x: 283.68895999999995, y: 382.36160000000007 }
]
duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 13:01

Die Reale Breite aller Quellbilder ist also mindestens nötig um das Bezugssystem zu kennen, angenommen die Bilder wurden weder gedreht noch zugeschnitten.

duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 13:19

mit dem Link http://kjc-sv010.kjc.uni-heidelberg.de:8080/fcgi-bin/iipsrv.fcgi?IIIF=imageStorage/ecpo_new/jingbao/1919/03/jb_0001_1919-03-03_0001%252B0004.tif/full/full/0/default.jpg liefert der IIIF server ein Bild mit 4864 Pixeln Breite zurück. Das entspräche einem Skalierungsfaktor von 4,864.

[
  { x: 335.90784, y: 366.7456 },
  { x: 2144.6348799999996, y: 360.1792 },
  { x: 2146.7264, y: 436.00896 },
  { x: 336.88063999999997, y: 454.05440000000004 }
]

die Quellpunkte sind so relativ vergleichbar

p1( 385, 360),
p2(1939, 360),
p3(1939, 468),
p4( 385, 438)
duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 13:28

Mit diesen Erkenntnissen angepasste Vergleichsannotation Screenshot_2019-07-28_at_13.27.45

Ergibt folgende absolute Koordinaten:

[
  { x: 369.95584, y: 369.9072 },
  { x: 1938.01216, y: 368.49663999999996 },
  { x: 1934.8505599999999, y: 444.27776 },
  { x: 370.88, y: 443.49951999999996 }
]
duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 20:02

Eine erstmal händisch erzeugte annotation

<annotation xml:id="s-testanno" created="2019-07-28T17:25:59.160Z">
    <body type="CategoryLabel">
        <category name="advertisement" color="green" label="Advertisement"/>
    </body>
    <target xml:id="s-testtarget" type="SpecificResource"
        source="http://kjc-sv010.kjc.uni-heidelberg.de:8080/fcgi-bin/iipsrv.fcgi?IIIF=imageStorage/ecpo_new/jingbao/1919/03/jb_0001_1919-03-03_0001%252B0004.tif/full/full/0/default.jpg">
        <selector type="SvgSelector">
            <g transform="matrix(1 0 0 1 0 0)" id="s-testpoly">
                <polygon points="385,360 1939,360 1939,468 385,438 "/>
            </g>
        </selector>
    </target>
</annotation>

So sieht das dann im Image Annotator aus.

Screenshot_2019-07-28_at_20.00.33

duncdrum commented 4 years ago

In GitLab by @line-o on Jul 28, 2019, 22:39

Die Zuordnungen sind noch falsch aber es geht voran: Screenshot_2019-07-28_at_22.38.27

duncdrum commented 4 years ago

In GitLab by @MatthiasArnold on Jul 29, 2019, 22:12

Hi Juri, das sieht schon ziemlich perfekt aus! SUPER! wir müssen das vermutlich noch einmal korrigieren, damit die annotationen für das netzwerk freigegeben werden könenn, aber es siehr sehr vielversprechend aus! vielen dank! lg, matz

duncdrum commented 4 years ago

In GitLab by @line-o on Nov 19, 2019, 11:30

closed