Convert equirectangular to fisheye

Hi all,

Imagine an equirectangular image rendered using For that image we have several view directions for which we want to create fisheye renderings. Perhaps the idea is clearer from the illustration. You will see three red spheres indicating the view directions, and for each the corresponding hemispherical fisheye rendering created by separate rpict calls.

I am wondering if it is possible to instead extract a fisheye image from an equirectangular image by some kind of transformation – or rather if it should be possible – without too much distortion.of both the visual appearance and the data so post-processing and analysis of the fisheye images is possible.

Any thoughts or ideas are appreciated.