Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using “official” Exif schema as an alternative of extended image metadata? #3

Closed
wrznr opened this issue Jan 5, 2018 · 7 comments

Comments

@wrznr
Copy link
Contributor

wrznr commented Jan 5, 2018

After playing around with the extended PAGE image metadata fields, @Boenig and I wanted to suggest further additions. However, this would ultimately lead to an inclusion of a complete image metadata set into PAGE which might not be desirable. Relying on an already existing XML schema is probably an effective alternative. Luckily, such a schema is existing and, even better, it is maintained under the tutelage of the W3C: https://www.w3.org/2003/12/exif/

So, what do @chris1010010, @splet and @cneud think about simply including this rdf schema in PAGE XML?

@chris1010010
Copy link
Contributor

Being in line with exif makes sense. A few problems:

  • We can't just integrate an RDF schema (we need an XML schema and I couldn't find one quickly)
  • We only need a few attributes from exif
    Can we discuss quickly at some point? What is useful etc. And why these attributes should be in PAGE (and not just in the linked image). Some redundancies are helpful (such as the width and height in order to make sure the coordinates of page content matches the image). But the more redundancy we add the bigger the risk of mismatches (PAGE says one thing and the image metadata says something else).

@chris1010010
Copy link
Contributor

chris1010010 commented Apr 19, 2018 via email

@kba
Copy link
Contributor

kba commented May 7, 2018

Our current understanding at @OCR-D is to not encode EXIF metadata as part of PAGE at all (except for imageWidth/imageHeight for convenience/compliance) but to require image files to contain EXIF data such as pixel density or color depth.

IMHO it's great to have a generic metadata mechanism and attribute for encoding pixel density in PAGE, esp. for ALTO-PAGE interop but from @OCR-D's perspective this issue is resolved.

@wrznr Correct me if I'm wrong.

@chris1010010
Copy link
Contributor

Agreed. Closing :-)

@bertsky
Copy link
Contributor

bertsky commented Dec 18, 2019

Our current understanding at @OCR-D is to not encode EXIF metadata as part of PAGE at all (except for imageWidth/imageHeight for convenience/compliance) but to require image files to contain EXIF data such as pixel density or color depth.

In the meantime, that understanding has been supplanted by the opposite view – for OCR-D. So it's precisely because EXIF/JFIF/... metadata are so unreliable in practice that the additions here in PAGE are vital. We need to (be able to) add metadata from an external/automatic image characterization to the annotation, without changing/copying the original image.

However, I still don't quite understand how the new MetadataItem can be used to host information in the EXIF schema, without using an external schema directly.

@chris1010010, you added some documentation, but no example. Can you please elaborate?

Let's take https://www.w3.org/2003/12/exif/#example – in RDF this looks like this:

<exif:IFD rdf:ID="Primary_Image">
   <exif:make>Canon</exif:make>
   <exif:model>Canon IXY DIGITAL 30</exif:model>
   <exif:orientation>top-left</exif:orientation>
   <exif:xResolution>180/1</exif:xResolution>
   <exif:yResolution>180/1</exif:yResolution>
   <exif:resolutionUnit>inch</exif:resolutionUnit>
   <exif:dateTime>2003-01-18T16:07:30</exif:dateTime>
   <exif:yCbCrPositioning>centered</exif:yCbCrPositioning>
   <exif:exif_IFD_Pointer>
    <exif:IFD>
      <exif:exposureTime>1/400</exif:exposureTime>
      <exif:fNumber>35/10</exif:fNumber>
      <exif:exifVersion>2.20</exif:exifVersion>
      <exif:dateTimeOriginal>2003-01-18T16:07:30</exif:dateTimeOriginal>
      <exif:dateTimeDigitized>2003-01-18T16:07:30</exif:dateTimeDigitized>
      <exif:componentsConfiguration>01 02 03 00</exif:componentsConfiguration>
      <exif:compressedBitsPerPixel>5/1</exif:compressedBitsPerPixel>
      <exif:shutterSpeedValue>76</exif:shutterSpeedValue>
      <exif:apertureValue>116/32</exif:apertureValue>
      <exif:exposureBiasValue>96</exif:exposureBiasValue>
      <exif:maxApertureValue>116/32</exif:maxApertureValue>
      <exif:meteringMode>Pattern</exif:meteringMode>
      <exif:flash>Flash fired, compulsory flash mode, red-eye reduction mode</exif:flash>
      <exif:focalLength>294/32</exif:focalLength>
      <exif:flashpixVersion>1.00</exif:flashpixVersion>
      <exif:colorSpace>sRGB</exif:colorSpace>
    </exif:IFD>
   </exif:exif_IFD_Pointer>
 </exif:IFD>

We can see the recursive nature of IFD at work here. How do we format that using the strict MetadataItem/Labels/Label hierarchy? By flattening? And what do we put in MetadataItem/@name and @value? What in Labels/@externalModel and @externalId?

Is the following the correct/intended representation for this example?

        <pc:MetadataItem type="imageProperties" name="?" value="?">
          <pc:Labels externalModel="http://www.w3.org/2003/12/exif/ns" externalId="IFD" prefix="exif">
            <pc:Label value="Canon" type="make"/>
            <pc:Label value="Canon IXY DIGITAL 30" type="model"/>
            <pc:Label value="top-left" type="orientation"/>
            <pc:Label value="180/1" type="xResolution"/>
            <pc:Label value="180/1" type="yResolution"/>
            <pc:Label value="inch" type="resolutionUnit"/>
            <pc:Label value="2003-01-18T16:07:30" type="dateTime"/>
            <pc:Label value="centered" type="yCbCrPositioning"/>
          </pc:Labels>
          <pc:Labels externalModel="http://www.w3.org/2003/12/exif/ns" externalId="exif_IFD_Pointer" prefix="exif">
            <pc:Label value="1/400" type="exposureTime"/>
            <pc:Label value="35/10" type="fNumber"/>
            <pc:Label value="2.20" type="exifVersion"/>
            <pc:Label value="2003-01-18T16:07:30" type="dateTimeOriginal"/>
            <pc:Label value="2003-01-18T16:07:30" type="dateTimeDigitized"/>
            <pc:Label value="01 02 03 00" type="componentsConfiguration"/>
            <pc:Label value="5/1" type="compressedBitsPerPixel"/>
            <pc:Label value="76" type="shutterSpeedValue"/>
            <pc:Label value="116/32" type="apertureValue"/>
            <pc:Label value="96" type="exposureBiasValue"/>
            <pc:Label value="116/32" type="maxApertureValue"/>
            <pc:Label value="Pattern" type="meteringMode"/>
            <pc:Label value="Flash fired, compulsory flash mode, red-eye reduction mode" type="flash"/>
            <pc:Label value="294/32" type="focalLength"/>
            <pc:Label value="1.00" type="flashpixVersion"/>
            <pc:Label value="sRGB" type="colorSpace"/>
          </pc:Labels>
        </pc:MetadataItem>

@chris1010010
Copy link
Contributor

chris1010010 commented Dec 18, 2019

I'll be out of the office until January.
As far as I remember the idea was to use the Label mechanism to add semantic information (e.g. exif tag types) to the MetadataItem instances.
Edit: just noticed that that's what you did. So, yes, that's one option to realise it

@bertsky
Copy link
Contributor

bertsky commented Dec 18, 2019

This can wait. Thanks @chris1010010 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants