FastTrackOrg / FastTrack

FastTrack is a cross-platform application designed to track multiple objects in video recording.
https://www.fasttrack.sh
GNU General Public License v3.0
101 stars 17 forks source link

Fix QMap key typo in AutoLevel implementation #39

Closed musicinmybrain closed 2 years ago

musicinmybrain commented 2 years ago

According to the Qt documentation, I expect that m_parameters.value("normParam").toDouble()) with nonexistent key normParam should be 0.0. This PR corrects the key to normPerim.

See also this downstream bug in Fedora Linux where the expression m_parameters.value("normParam").toDouble()) produced NaN on the ppc64le architecture with a pre-release of GCC 12 (probably a separate Qt6/GCC12 bug), which caused the test to actually fail, resulting in the discovery of this typo. This PR is not, by itself, a fix for the downstream bug since it appears that even the correct key normPerim isn’t expected to be present the first time through the while loop—so m_parameters.value(key).toDouble()) with nonexistent key still needs to return 0.0 as specified.

bgallois commented 2 years ago

Thanks for catching this error. In fact, the m_parameters.value(key) will always have default values passed with the constructor and do not rely on Qt nonexistent key behavior.

bgallois commented 2 years ago

@musicinmybrain Feel free to comment and reopen this pull request for the follow-up of https://bugzilla.redhat.com/show_bug.cgi?id=2045367. For me, it's seem to be an error with the FFmpeg backend of OpenCV not loading [ INFO:0@17.374] global /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/backend_plugin.cpp (383) getPluginCandidates Found 0 plugin(s) for FFMPEG and GStreamer the secondary backend not able to load the test movie [ WARN:0@17.487] global /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_gstreamer.cpp (862) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created.