Newbie here - trying to make crude image stabilization using RL
Hi there! I recently dived into the topic of RL after finishing a neural networks course at my university. I have basic understanding of the underlying principles of CNNs, the general idea of what Reinforcement Learning is, and I'm trying to learn more by making a project.
The problem that I came up with is as follows:The system receives consecutive images frame after a frame (let's assume the frames come from a prerecorded video of stationary object, but the cameraman's hand is shaking/moving slowly) and tries to compute offsets for them that allow the user to align new frames to the original one.
My idea is to use RL to train a network to recognize how the current frame is offset from the original (initial, first frame fed to the network) to allow some other software or even the user to manually translate this frame by the X/Y offsets received from the NN to "stabilize" the image. Such a network would take a small bitmap as an input (a small piece of the image, e.g. a 200x200px area from the center of the frame) and give two signed values on the output (the X and Y offsets in px from the original).
I'm fully aware that this is very primitive way of performing image stabilization, but that's the whole idea, I'm trying to learn RL by defining a clear and simple problem that doesn't necessarily have much usefulness in the real world.
My current idea on how to approach it is as follows:
- Prepare several large resolution images (e.g. 1920x1080 px)
- Make a simple python script, which takes an image (1920x1080) as an input
- With the script, define an "anchoring area", e.g. a 200x200 square in the center of the original large image
- Feed the NN with this reference 200x200 image
- The Python script would then randomize an offset/drift and instead of 200x200 square in the center of the image, it would take a 200x200 square offset by 10-50 pixels from the center in X/Y (for example -20,20 offset)
- The script wuld feed the NN with the offset 200x200 image
- The NN would receive positive points for outputing offsets that cancel-out the script's artificial deviations (e.g. 20, -20 offset for the previous example) and negative points for outputing offsets that make matters worse (e.g. -10, 15).
Now, I'm very inexperienced and I understand that this is not a simple thing to achieve, therefore I wanted to ask you, is my approach correct, and if you can give me any hints or direct me to some sources where something like this was previously done. I'll appreciate any help on how to make this real. Thanks!
Posted Nov 1, 2023, 4:11 PM UTC