Filmulator Quarantine Dev Log

I now have updating of the database working. Next is actually using the data!

1 Like

I pretty well just stole lenstool code to do this. Seems to work okay for distortion; haven’t used any profile that did CA or vignetting correction, though.

Actually, first I’m going to work on the UI.

I’m deciding whether or not to put in the work to create a proper model where you can scroll through the whole list, or if I’ll just list the top five lens matches to whatever’s typed in, which would be simpler to implement… five should be enough, right?

1 Like

For a given mount, you need to think through the largest number of lenses that’d match focal length (range for zooms) and aperture (range for zooms).

I give the user the whole list, and gave them a rapid filter tool. Here’s a screenshot:

rawproc-lenslist

As they type characters in the Filter, the list truncates to the matches. I had to build this dialog box out of wxWidgets widgets, but I’ve been using that toolset for going on 14 years and it’s not so much work anymore. YMMV w/Qt…

I want a shinier, more integrated UI so it’ll involve a bunch of custom work that would be easier if I give up flexibility and only list the top matches.

On the other hand, my furlough has just been extended a week so…

1 Like

The lens selection UI is coming together.

I’m not quite sure what to do for camera crop factor, because lensfun clearly doesn’t know some cameras that I’ve tested (like the GH5s). Maybe have it default to what the detected camera crop factor is, and let the user override it?

2 Likes

Hmmm, doesn’t appear lensfun knows that particular camera at all, according to what’s in the mil-panasonic.xml file. It knows the GH5…

I think yours is the right approach, but I’m wondering if there’s room to consider doing the same thing for cameras you’re doing for lenses: offer the top five closest matches…

Ugh, I just realized that multi-aspect-ratio shooting affects crop factor. Ugh.

And worse, some m43 cameras have multi-aspect sensors where some of the aspect ratios stay at 2.0, and some don’t!

Ouch.

Does the camera present enough metadata to calculate this? exiftool has a composite tag called “Scale Factor To 35 mm Equivalent”, which is calculated by exiftool from these tags:

FocalLength
FocalLengthIn35mmFormat
Composite:DigitalZoom
FocalPlaneDiagonal
SensorSize
FocalPlaneXSize
FocalPlaneYSize
FocalPlaneResolutionUnit
FocalPlaneXResolution
FocalPlaneYResolution
ExifImageWidth
ExifImageHeight
CanonImageWidth
CanonImageHeight
ImageWidth
ImageHeight

I haven’t inspected the exiftool code to determine how it’s done.

Oh, good idea. That could make it foolproof and free of user interaction.

(the less user interaction, the better)

Here’s Phil Harvey’s routine:

Well, I have the database backend done and mostly debugged. It was a solid two days of work, not counting the two weeks of planning, with a massive 750 line commit.

It autodetects lenses if they’re matched closely enough (>25 match score), and if you choose a set of Auto CA and lensfun lens corrections and then click “Remember preferred lens” it’ll save those as default for future images taken with the same camera/lens model combination.

Now I need to actually implement the corrections themselves, and add switches to turn them on and off.

And then I need to implement a non-Bayer-sensor detection function so that I can disable Auto CA correct for cameras it doesn’t support (like Fuji). I plan to hide unavailable corrections.

2 Likes

Cool beans!

I haven’t yet looked at the lensfunAPI to determine if it tells you what corrections are/aren’t available for a specific lens, would be interested in hearing your approach.

That part was very simple.

lfLens::AvailableModifications(cropfactor) gives you an integer that you can mask with LF_MODIFY_TCA, LF_MODIFY_VEGNETTING, and LF_MODIFY_DISTORTION.

For CFA (or lack thereof) I’ll need to figure out some succinct combination of LibRaw’s outputs that tells me what I need to know.

1 Like

Oh gee, just RTFM…

I know the metadata should contain Exif:PhotometricInterpretation, but haven’t looked to see if libraw exposes it.

Ah, you’re using master; I couldn’t find that function in either the 0.3.2 or 0.3.95 tags…

Wait, really? The documentation I was using still says 0.3.95.0.

Yes, go to the gito website, three selections under “API”, and compare…

Huh, indeed you’re right.

Now my CI has started complaining that it doesn’t have std::make_unique, a C++14 feature. It’s supposed to have gcc 9, so it should easily support that, but I don’t know…