>>254906
The input field has 2^16 = 65536 possible combinations. Detecting the actual piece is optional for success. Bishop, queen, and king often look fucked, but you don't need to discern which it is to handle that edge case. Extracting the geometry of the warped board should not be that hard. It's a four by four matrix, you just need to pick the nearest pieces and remove anything on the border that is not a piece. (It's just black boxes, so not that hard.) Then just use the percentage of black/white pixels for each piece as a heuristic. Then toggle and brute force the most likely options.
This is what I have to do anyway as a human, and with multiple tries I just cycle through three or four until I have one I'm confident I can solve. The only reason this hasn't been broken yet is because nobody gives enough a shit.