Skip to content

fix: wrong center after opening another project

d.kilic requested to merge 387-wrong-image-center into master
  • open sequence first, load rest after that
    • ensures the real values for fx, fy, cx, cy etc. are in the allowed range
    • updateImage uses the right image and image size (else borderChanged might become true and an incorrect image size might be given to imageSizeChanged during loading of all the other components)
  • Add check in imageSizeChanged for valid values

This MR did also fix another issue. In the blackdot test case, the wrong head size is used for calculating the area for recognition. This can be seen by turning it off and on again. This leads to different values, because a different headsize is used. This change also fixed this problem (deactivating and activating again results in the same values). But this leads to a different result for this testcase as well. Since the difference comes from a bug, the new trajectories are accepted without a judgement on whether they are "better".

The difference between the two runs is the following (test - new, correct version; truth - old, buggy version):

Different last frame for ID: 7(test) and ID: 7(truth)
Last frame in truth file: 241
Last frame in test file: 346

Different last frame for ID: 9(test) and ID: 9(truth)
Last frame in truth file: 235
Last frame in test file: 236

Different last frame for ID: 170(test) and ID: 169(truth)
Last frame in truth file: 256
Last frame in test file: 257

Closes #387 (closed)

Reviewer Checklist

Formatting

  • the pre-build checks succeed

General code quality

  • naming conventions are met (see .clang-tidy for detailed information)
  • no static analyzer warnings in new code parts (e.g., use clang-tidy for checking)

General usability

  • old versions of pet-files are still loadable

Only if changes in UI

  • new elements are also saved and loaded from pet-file
  • check if tab order is still correct
  • all new SpinBoxes are promoted
  • new keybindings added to Petrack::keyBindings()
Edited by Schrödter, Tobias

Merge request reports