Some notations before the final results. We use homogenous coordinates in our calculations.
I won't finally derive all the results, but the final calculations were something like this -
It finally becomes -
(Also let me know if you find any calculation mistake)
I implemented the adjoint as per the above calculations, and finally got something that was working.
julia> Zygote.gradient(src3, h) do img, tform
c = sum(warp_me2(img, tform))
c
end[2].H
3×3 Matrix{Float64}:
1291.15 348.268 -3.61461
1486.71 439.969 -5.47212
25459.4 17443.4 -75.2837
I shall upload some really juicy results at a later point. I still have to get it working for ::AbstractArray{<:Colorant}
, since mathematical operations aren't defined for colorants as such, and that should take me a little time (?)
I with my mentor Dhairya and Johnny Chen have something really nice in mind. I hope (read expect) it comes to fruiton till the end evaluations.
I will be working on the above mentioned issues, as well as the type where the interpolation scheme is trainable (), but the warp can/cannot be trainable. I am the most excited about this part.
Till then, cheers, be safe and stay healthy!