I'd go with 3d (I use Blender but it would be +/- the same in any software) but just because I don't know a better solution. Let's say I have an image like this and I want to extract this CAHABA thing (a random image from Internet)
I'd setup a scene so that camera matches photo as much as possible. Here I had to eyeball a camera orientation, if there was a boxy shape in the photo I could've used as a reference, I'd use a camera matching software/plugin (like an opensource fSpy) to restore perspective more precisely.
Then I'd project UVs from the camera — this object will be source for remapping:
Then I'll make a duplicate of the object: this duplicate will have a proper aligned UVs and will be a target for remapping:
Then baking. There're different ways of doing that, I'll use a free EasyBake addon. Baking process is transferring different data from one object to another (mostly), in this case I'm transfering color information from Source to Target:
Here's the result: