• setResizeThumbnail how to make sure it pads not crops? How to undo?

My start image is 1632x and 960y
aspect ratio = 1.7

What I want is 160x and 120y
aspect ratio = 1.33

How do I make sure that that it pads not crop to match the aspect ratio?

Also, I will need to update the results of the detection to match the original image for bounding boxes, how do I find this transform?

    Hi AdamPolak
    I have tested the function and it does not crop the image. Does yours get cropped?
    The function checks the wider edge and fits it to the window. Then same aspect ratio is kept for the image, but there is additional padding added at the shorter edge to ensure the padded image has the specified (new) aspect ratio.

    So wider edge should be scaled by some constant K = (original/resized), while the other shorter one is resized/aspect.

    Hope this helps,
    Jaka

    Thanks,
    Jaka