openMVG / openMVG

open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.
Mozilla Public License 2.0
5.73k stars 1.68k forks source link

Tracks ExportToSTL using uf_tree_.m_cc_parent[k] instead of uf_tree_.Find(k) #2208

Open youtudou opened 1 year ago

youtudou commented 1 year ago

Hi,

I have a question regarding the ExportToSTL() function in tracks.hpp. The function has this line

"const uint32_t & track_id = uf_tree.m_cc_parent[k];"

My understanding is that this line only finds the parent trackid that is one level above the track "k". Is there a reason why this line is not finding the uppermost trackid in the ur_tree (by using "const uint32_t & track_id = uf_tree.Find(k);")? Am I misunderstanding the purpose of the function?

pmoulon commented 1 year ago

I believe at this stage, all parent should already have the right value, so we don't need to call Find again.

Feel free to try to replace with Find(k) and see if the unit test are still running as expected.