Menu

#86 Lens names

wont-fix
None
2019-04-20
2017-09-11
Beep6581
No

Hello

Where does lensfun get its lens names from?
If it's from exiv2 or ExifTool, are the names retrieved automatically (which implies that exiv2 or exiftool are a run-time dependency) or do you rip them manually or using some script?

Discussion

  • seebk

    seebk - 2017-09-11

    Lensfun itself cannot retrieve exif information from files. Typically,
    applications using Lensfun already internally have this image information
    available from exiv2 or similar libraries. You then only pass the camera
    and lens name strings to the respective lfDatabase functions to query a
    matching lens profile.

    Am 11. September 2017 17:11:06 schrieb "Beep6581" beep6581@users.sf.net:


    ** [bugs:#86] Lens names**

    Status: open
    Created: Mon Sep 11, 2017 03:11 PM UTC by Beep6581
    Last Updated: Mon Sep 11, 2017 03:11 PM UTC
    Owner: nobody

    Hello

    Where does lensfun get its lens names from?
    If it's from exiv2 or ExifTool, are the names retrieved automatically
    (which implies that exiv2 or exiftool are a run-time dependency) or do you
    rip them manually or using some script?


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/lensfun/bugs/86/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     
  • Beep6581

    Beep6581 - 2017-09-12

    When I look at slr-sigma.xml for example I see:
    Sigma 100-300mm f/4 APO EX DG HSM

    while ExifTool shows
    Sigma APO 100-300mm F4 EX IF HSM

    So how does one match the lens used in a raw file to a lens profile from lensfun?
    What if the lens profile in lensfun or the lens name from ExifTool or Exiv2 has a typo in the name or just uses a different convention, e.g. writing f/4 as F4 or any other variation?

     

    Last edit: Beep6581 2017-09-12
  • seebk

    seebk - 2017-09-13

    The database search is not a simple string matching, it splits the name into substrings and matches each one individually. Searching for "Sigma APO 100-300mm F4 EX IF HSM" will yield the correct profile. Even "Sigma 100-300" will give a result. However, adding the IF in the name seems to confuse the search algorithm (maybe we should try to find out if the search can be improved in the above case).

    BTW: In general the lens names in the database follow the naming scheme of the exiv2 library.

     
  • Torsten Bronger

    Torsten Bronger - 2017-09-22

    This data was submitted by a user three years ago, so I cannot check any RAW files against a current exiv2 version.

    @Beep6581: Is this really the same lens? Not different models with some numbers which are the same?

    @seebk: So, "Sigma 100-300mm f/4 APO EX DG HSM IF" in the XML broke the search for "Sigma 100-300mm f/4 APO EX DG HSM" and "Sigma APO 100-300mm F4 EX IF HSM"? Actually, both should be found.

     
    • seebk

      seebk - 2017-10-24

      Sorry there was an error in above message. What I found:

      Lens name in database: Sigma 100-300mm f/4 APO EX DG HSM

      $ lenstool -L "Sigma APO 100-300mm F4 EX HSM"
      
      Matching lens found in the database:
         Sigma / Sigma 100-300mm f/4 APO EX DG HSM
           |- Crop factor: 1,523
           |- Aspect ratio: 1,5
           |- Focal: 100-300mm
           |- Min-Aperture: f/4
           |- Center: 0,0
           |- Compatible mounts: Sigma SA, Nikon F AF, Sony Alpha, Pentax KAF2, Canon EF, 
           |- Calibration data: tca, vign, dist,
      
       $ lenstool -L "Sigma APO 100-300mm F4 EX HSM IF"
      Database loaded succesfully.
      
      Cannot find a lens matching `Sigma APO 100-300mm F4 EX HSM IF' in database
      
      $ lenstool -L "Sigma APO 100-300mm"
      Database loaded succesfully.
      
      Matching lens found in the database:
        Sigma / Sigma 100-300mm f/4 APO EX DG HSM
          |- Crop factor: 1,523
          |- Aspect ratio: 1,5
          |- Focal: 100-300mm
          |- Min-Aperture: f/4
          |- Center: 0,0
          |- Compatible mounts: Sigma SA, Nikon F AF, Sony Alpha, Pentax KAF2, Canon EF, 
          |- Calibration data: tca, vign, dist,
      

      Looking at above result it seems that a lens name never matches if it contains more tokens than the name in the database.

       
      • Torsten Bronger

        Torsten Bronger - 2017-10-25

        No matches if the lens name contains more tokens than the name in the database is intended behaviour – well, intended by Lensfun's original author FWIW.

         
        • seebk

          seebk - 2017-10-25

          Mhm.. I think the current behaviour makes sense. AFAIK there are a few lens models which only differ in one token, e.g. a lens with and without HSM.

          One possible solution could be to make lens names in the database as specific as possible, means to include all possible tokens. Having a too long lens name in the database should not cause a problem, only having a too short name... Right?

           
          • Torsten Bronger

            Torsten Bronger - 2017-10-25

            I think so, too. This actually has been my strategy in the past years: Creating the longest lens name that is still sane.

             
  • Torsten Bronger

    Torsten Bronger - 2017-09-22
    • assigned_to: Torsten Bronger
     
  • André Gauthier

    André Gauthier - 2017-09-29

    Other mismatch :
    On Nikon camera
    decoded lens name (exiftool or exiv2): Tamron SP 70-300mm f/4-5.6 Di VC USD (A005)
    Lensfun DB name : Tamron SP 70-300mm f/4.0-5.6 Di VC USD

    The exif decoded name is exactly the name given by Tamron to its lens.
    DB name differs in two points : 4.0 instead of 4 and missing (A005).
    The name of two different lenses can differ only by the model number (Axxx).

    I did not check what is the decoded name for that lens on a Canon camera.

     

    Last edit: André Gauthier 2017-09-29
    • Torsten Bronger

      Torsten Bronger - 2017-10-23

      This does not belong to this thread, does it?

       
      • André Gauthier

        André Gauthier - 2017-10-23

        If you consider the specific problem of naming of this lens, it doesn't belong to this thread.
        But, if you look at the title of this thread (lens naming), it can belong to this thread.

         
        • Torsten Bronger

          Torsten Bronger - 2017-10-24

          But I can only close a thread, not a single post. ;-) Anyway, the A005 is in.

           
  • Beep6581

    Beep6581 - 2017-10-27

    Hello

    The original question was:

    Where does lensfun get its lens names from?
    If it's from exiv2 or ExifTool, are the names retrieved automatically (which implies that exiv2 or exiftool are a run-time dependency) or do you rip them manually or using some script?

    The reply was:

    Lensfun itself cannot retrieve exif information from files.

    But that wasn't what I asked. Lensfun very clearly does use and store lens names internally, so I would appreciate it if you could explicitly answer:

    1. Where do lens names come from?
    2. Seebk hinted, "BTW: In general the lens names in the database follow the naming scheme of the exiv2 library". What does "in general" mean, does this vary? When does it vary? What is the fallback?
    3. If some lens from Exiv2 has "F4" as part of its name, while another has "f/4" and yet another has "F4.0", do you leave that as-is, or you do normalize that? I'm asking about the stored names, not the lens matching logic.

    Thank you

     
    • Torsten Bronger

      Torsten Bronger - 2017-10-27

      The Lensfun DB is 10 years old, and the naming policy has changed over time.

      Since I help to maintain it (2012), I stick to the exiv2 name, possibly enriched with tokens from earlier exiv2 versions which have been dropped over time, so that matching always works. I stick to the "f/2.0" syntax and avoid all-uppercase elements.

      For non-electronic lenses, I sometimes browse on ebay to find original packaging images with the proper lens names.

      For Samyang lenses, I use the Samyang name, even it is was sold as Walimex, Rokinon, Optica, or whatever. This may change a bit since Samyang started to manufacture electronic lenses.

      So, there are some rules, but it is also a matter of taste and experience.

       

      Last edit: Torsten Bronger 2017-10-27
  • Torsten Bronger

    Torsten Bronger - 2019-04-20
    • status: open --> wont-fix
     
MongoDB Logo MongoDB