Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use image stacking instead of gluing slices together #20

Open
clonejo opened this issue Nov 25, 2023 · 5 comments
Open

Use image stacking instead of gluing slices together #20

clonejo opened this issue Nov 25, 2023 · 5 comments

Comments

@clonejo
Copy link
Contributor

clonejo commented Nov 25, 2023

Currently, trainbot pieces slices of the moved train together. This works well when within the used crop rectangle the view is unobstructed, and the exposure/lighting is similar in the X axis.

Unfortunately, i have to deal with some obstruction from foliage:
train_20231125_120357 38_+01 00

One can kinda reduce this by narrowing the crop rectangle, but i am already quite limited.

But since we have each piece of the train exposed at least twice (with the current movement detection code, even three times), we can stack them together. Here is an example using a better camera, manual stacking of three frames in GIMP, and then enfuse for stacking:
enfuse
compared to a single frame:
manuall-stacked-637

We could even pick out the parts that don't change between frames, and create a non-rectangular mask for picking only the unobstructed parts.

Possible implementation: We pretty much have all the pieces already, we'll just have to save each frame placed into a separate otherwise transparent image file, and then run enfuse over all the files.

@clonejo
Copy link
Contributor Author

clonejo commented Nov 25, 2023

This also means we get more exposure for each bit of train, and thus reduce noise.

@jo-m
Copy link
Owner

jo-m commented Nov 25, 2023

Indeed, we actually have enough raw images to get rid of obstructions in your specific case.
IMO this is however not true in the general case.

Anyways, feel free to experiment with this and to submit a PR!
I will not implement it.

@jo-m
Copy link
Owner

jo-m commented Nov 25, 2023

This also means we get more exposure for each bit of train, and thus reduce noise.

Noise yes, blur no.

@natevw
Copy link

natevw commented Dec 13, 2023

Hmm, I also have problems with obstructions but rather than a whole bunch of extra DSP my thinking was maybe just somehow use offset boxes that get lined back up based on the appropriate time delay from train speed:

Screen Shot 2023-12-12 at 9 29 36 PM

I wonder if that would be a bit easier to work into the existing logic and/or a little bit more generalizable to various situations?

@jo-m
Copy link
Owner

jo-m commented Dec 13, 2023

It should be easy enough to adapt the stitching logic so that it can be chosen from which image area the patches are taken for stitching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants