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?
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.
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?
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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"Matchinglensfoundinthedatabase:Sigma/Sigma100-300mmf/4APOEXDGHSM|-Cropfactor:1,523|-Aspectratio:1,5|-Focal:100-300mm|-Min-Aperture:f/4|-Center:0,0|-Compatiblemounts:SigmaSA,NikonFAF,SonyAlpha,PentaxKAF2,CanonEF,|-Calibrationdata:tca,vign,dist,$lenstool-L"Sigma APO 100-300mm F4 EX HSM IF"Databaseloadedsuccesfully.Cannotfindalensmatching`SigmaAPO100-300mmF4EXHSMIF' in database$lenstool-L"Sigma APO 100-300mm"Databaseloadedsuccesfully.Matchinglensfoundinthedatabase:Sigma/Sigma100-300mmf/4APOEXDGHSM|-Cropfactor:1,523|-Aspectratio:1,5|-Focal:100-300mm|-Min-Aperture:f/4|-Center:0,0|-Compatiblemounts:SigmaSA,NikonFAF,SonyAlpha,PentaxKAF2,CanonEF,|-Calibrationdata: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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
Where do lens names come from?
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?
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
When I look at slr-sigma.xml for example I see:
Sigma 100-300mm f/4 APO EX DG HSMwhile ExifTool shows
Sigma APO 100-300mm F4 EX IF HSMSo 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/4asF4or any other variation?Last edit: Beep6581 2017-09-12
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.
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.
Sorry there was an error in above message. What I found:
Lens name in database: Sigma 100-300mm f/4 APO EX DG HSM
Looking at above result it seems that a lens name never matches if it contains more tokens than the name in the database.
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.
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?
I think so, too. This actually has been my strategy in the past years: Creating the longest lens name that is still sane.
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
This does not belong to this thread, does it?
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.
But I can only close a thread, not a single post. ;-) Anyway, the A005 is in.
Hello
The original question was:
The reply was:
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:
Thank you
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