XMALab crashes when importing images in portrait orientation

Issue #239 wontfix
FUNMORPH UA created an issue

I have image sequences (.tif) recorded with four synchronized cameras in portrait orientation (width 934px, height 1024px). XMALab crashes when I try to import these images. When I rotate the images 90 deg prior to import, it works fine.

I would highly appreciate if XMALab would accept portrait orientation so that I won’t need to track all my recordings in rotated view.

Thanks a lot!

Maja Mielke

Comments (6)

  1. Benjamin Knörlein

    Hi Maja,

    I doubt that there is a problem with XMALab and portrait orientation as there is nothing special with it from the point of view of XMALab. I assume the problem is either with a) the images itself (you basically reencode the images by rotating them) b) OpenGL as the texture resolutions are sometimes a little bit tricky.

    So this is what we can do:

    1. Can you rotate the rotated images back to portrait orientation and try again? In this way we can make sure that it is the problem of the orientation and not a problem of the original images.
    2. Can you create an xma-file and upload the images and xma-file and give me a description on how to reproduce it? I can then quickly run it on my windows machine and get more information on why it crashes and maybe fix it.

    If the problem is a result from OpenCV or OpenGL there is probably not much i can do, but you can simply pad the image to have a resolution of 1024x1024 with black pixel.

    Best.

    Ben

  2. FUNMORPH UA reporter

    Hi Ben,

    Thank you for your response!

    1. When I rotate the images back to portrait orientation, it again does not work. Rotating again to landscape solves the problem again and so forth…
    2. Since XMALab crashes upon import of portrait images, I cannot create an xma file with these. But I created one (attached) with the rotated (landscape) images. I also attached the tested frames (for 2 cameras), both the landscape and the portrait version. To reproduce the error, just try to create a new xma-file (“new dataset” or “new trial without calibration”, does not make a difference in my case) with the portrait images. On my windows machine, XMALab crashes without giving an error message.

    Maybe also of interest: When I open the (attached) xma-file that I created with the landscape images and try to add a new trial with the portrait images, I get the error message “Width and Height of the videos does is not equal to the calibration images. Cannot create Trial.“, although it is an xma-file without calibration.

    I did not yet try adding black pixels to get 1024x1024 images, but I will do. Still, I would like to avoid this, as this will cause an unnecessary increment in data size (I record hundreds of thousands of images each recording day, so this would add up considerably).

    Thank you very much for your help!

    Maja

  3. Benjamin Knörlein

    Hi Maja,

    As i expected the problem lies in the upload of the image to the gpu. OpenGL is kind of picky on the texture sizes. I tested if i can change the code but nothing works so you will need to pad the images. However, you do not have to pad the images to 1024x1024 but it is enough to pad it with 2 pixel so that the resolution is 936x1024. The reason is that it requires the resolution to be a multiple of 4.

    Best,

    Ben

  4. FUNMORPH UA reporter

    Hi Ben,

    OK, thank you for the suggestion! I will try the 2px padding and from now on set the camera resolution to a multiple of 4 in the first place.

    Best,

    Maja

  5. Log in to comment