Hi everyone!
I’m trying to decide:
Do I need to make a custom cost function? (I’m thinking I probably do)
---- If so, would I have to implement backwards() as well? (even if everything happens in / with Variables?)
Long story short, I have two images: a target image and an attempt to mimic the image (i.e. a distorted or perturbed version). I have two sets of pixel coordinates that are common to both images. Imagine something like Scale Invariant Feature Transform (SIFT), but no 1-1 mapping between each pixel in one image to the pixel in the other.
Imagine overlaying the attempt image over the target image such that the centers of each image are on top of each other. I want to transform the attempt image using only translation (y, x), rotation (theta), and scaling (s) in order to minimize the distance between every “important” point in the target image (tar) and every “important” point in the attempt (att) image.
Here’s the cost function more formally.

There isn’t a ground truth value, I just want to find the y, x, theta, and s values that make that function as close as possible to 0.
EDIT: I also realize that there are an infinite amount of solutions thanks to the cyclic nature of theta. Assume it’s restricted to something like -30 degrees <= theta <= 30 degrees.