Fri, 30 Jun 2023

Perspective correction and uncanny valley

— SjG @ 8:23 am

It’s interesting how optical corrections to “fix perspective” can end up making something look simultaneously “correct” and very, very wrong.

When I say “fix perspective,” I’m talking about the convergence of lines due to perspective. The further something is from your eye, the smaller it appears, so if you’re looking up at a building, the top looks narrower than the bottom. Similarly, if it’s not in the center of the frame, the different vanishing points combine with general lens distortion to make a funny-house mirror image.

This building does not, in fact, get smaller on the higher floors.

Now, optically, your eye sees perspective this way too, but the image-processing in the brain tends to counter it. What you “know” about the building overrides what you’re seeing, and you don’t really notice that it’s going all pointy on top. Weirdly, something that doesn’t bother us when we’re out on the street tends to bother a lot of people when they see it in photography.

In the old days, if you wanted to prevent this perspective narrowing of an architectural feature, you’d use an expensive and somewhat esoteric piece of equipment called a “tilt shift lens.” It would allow you to align the lens with the plane of what you’re photographing, and thereby cancel out some of the distortions. What that means in practical terms is that you can, in a controlled way, counter the convergence of lines due to perspective.

Now we do the same with ordinary lenses and software.

Where the “uncanny valley” comes in is that the convergence due to perspective can be fixed, but the point of view does not actually change. Where you see this dramatically is in something like this tower, where the perspective is telling your eye that you’re seeing it straight on, while the point of view of the constituent beams is from below. It’s mildly Escheresque. Compare the “corrected” and “uncorrected” views below.

I guess the solution is to always photograph everything using remote-controlled drones that sit in the perfect perspective spot, and then fix any lens distortions.

Wed, 14 Jun 2023

pamd running out of sessions for cron

— SjG @ 6:51 am

I manage a very busy Rocky Linux test-server. For one staging environment, cron is already running five or six maintenance scripts every minute. But when the tests run, the system has to do a lot of additional permissions fixes and filesystem adjustments. I’ve started seeing in the logs the following error message:

pam_systemd(sudo:session): Failed to create session: Maximum number of sessions (8192) reached, refusing further sessions

Now, there is a known older problem with systemd and dbus, that comes up when you search for this error message. I couldn’t find any concrete actions I could take to fix the issue. The other major search results are RedHat pages behind their subscription wall, and, at this point I’m apparently too dumb and out of date to even be able to figure out how to pay for a RedHat subscription.

I think I’ve found at least a temporary solution, however. In /etc/systemd/logind.conf there is the SessionsMax field where you can override the default. I doubled it to 16384, then ran systemctl restart systemd-logind

I’ll have to see if that’s a viable long-term fix rather than just treating the symptoms of a bigger issue.