extending stitching module for Java and Python bindings

Replacement for ill-formed PR #3141.