Intelligent Cropping of Negative Scans

Hi there

I’m trying to work out ways to optimise my negative scanning workflow, and wonder whether anyone has any ideas on how to automatically crop scans to the edge of the scan, preferably in batches.

As it stands, I crop each scan individually, but figure that there must be some better ideas being used.

In theory, I guess it might be even possible to write code to intelligently recognise each edge of the scan and crop accordingly?

Appreciate any ideas.

Regards

Stephen

1 Like

I’d look at Imagemagick (https://imagemagick.org/index.php).

It’s possible that I’ll add something in the future that can auto-crop the negatives if there is enough interest in this…

There’s a free script and plugin here that is proof of concept (not my creation): https://gist.github.com/stecman/91cb5d28d330550a1dc56fa29215cb85

It’s pretty basic in terms of what it can do, is easily thrown off, and installing it right now is definitely not for the average user. But shows a working method for how it can be done.

It uses OpenCV, which I think is much better suited to this task than ImageMagick.

-Nate

2 Likes

Auto Cropping in an intelligent way would be great.

1 Like

Is there a doc how to integrate this to LR for Windows - Step by step?

No, just the directions in the github repository. It is definitely not for the average user to attempt, and would require a pretty good knowledge of things like linux, bash, and installing open source packages. Be prepared to do a lot of googling and a decent amount of banging your head against the wall :wink:

1 Like

:smiley: So I am out here :smiley:

@nate, auto-crop functionality would be very welcome indeed…

On the other hand, I tested NLP with uncropped photos that included both white and black borders and as far as I see, NLP works well with my test copies - when I set border tolerance to 25%

Hey, slightly old thread, but I’m the author of that proof-of-concept auto-cropping plugin linked above. There’s been quite a bit of interest in this recently, so I’m currently packaging it up for easy installation. I’ll give an update here when it’s available.

I’ve also been working on a significantly improved detection algorithm. If anyone wants to provide sample, uncropped negative images, it would help me test this against a variety of setups and tune the software. 1500px JPGs are all that’s needed. The edge of the exposure needs to be intact, but the majority can be covered or heavily blurred if you prefer. For example:

Email me if you don’t want to post publicly / spam the thread with images :+1:

8 Likes

This is great, I’ll be emailing you with my samples shortly. Thanks for providing this software and I hope to use it in the future.

Hey Nate,
is there already an update on this topic? Will there be auto cropping function in the future?
Bests,
Max

Also really keen for an intelligence driven crop tool. Is there a board where we can vote on this functionality being added?

I’ve come to the world of negative scanning after inheriting multiple boxes of prints and negatives after a close family member passed away.

Having worked through the prints first, i currently have around 5000 camera scans of the prints. I have just started working with the negatives and NLP and will soon amass a similar number of scans.

If there was any way that the intelligent crop and straighten tool could also be used with the scanned prints, that would be amazing.

Thank you in advance.

Sam

Hey Stephen, really keen on this functionality. Would love to see it as a plug in.

Sam

The best way would be to ensure that you scan every negative at the same position. You can then batch crop them. Or you crop beforehand, so only the negative is being shot. Before each batch you can take a picture with the border if you want to use whitebalance.

hello guys, any progress on this? either as a part of the NLP or the standalone plugin mentioned by stecman (btw great job! would love to see this streamlined for the avg user usability)

thank you!

Very useful plug-in! Too bad it was never finished.
Does anyone know similar software that can work in Windows?

Would love to see autocrop functionality in NLP

1 Like

Are you still thinking of including this in an update? It would be very useful.

1 Like

Any news on this? I have thousands of film captures I have to do this to.

Yes! This is something I’ve been exploring in more depth recently and am working to incorporate in a future release for Negative Lab Pro v3.x…

I’ve played around quite a bit with techniques that involve existing edge detection methods, and could not get it to a place that accurate enough for what I want to do with it.

So instead, I’m training a neural network to recognize the capture area of a film scan.

To make sure that the training includes all kinds of scans and situations, it would be helpful if anyone wanted to contribute their own uncropped scans…

To submit uncropped scans to be included in the training data:

  1. In Lightroom, make sure you reset any previous cropping you might have done on the photo. If you don’t want to impact any previous settings you have on a photo, you can also make Virtual Copies of all the photos you want to share, then on the virtual copy, reset all the settings in Lightroom so that it appears like it did when you first imported the image.
  2. Export as a JPEG with max length set to 1024 pixels
  3. Upload to this dropbox file request link

-nate

2 Likes