Skip to content

Commit

Permalink
Fix the regression due to the overuse of std::ref()
Browse files Browse the repository at this point in the history
This bug is introduced by Support_CentOS7 and caused the issue pablofdezalc#1 and pablofdezalc#2.

Lx and Ly must be passed by value, instead of by reference, because Lx
and Ly are local variables and the lifetime of kcontrast_ async task
extends beyond the scope of Compute_Base_Evolution_Level().

Although the heap memory is supposed to be pinned down by
AKAZEFeatures::lx_ and ly_, its reference count seems to go wrong.
  • Loading branch information
h2suzuki committed Jul 21, 2015
1 parent 11d35c3 commit 6616328
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fast_akaze/akaze/AKAZEFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ float AKAZEFeaturesV2::Compute_Base_Evolution_Level(const cv::Mat& img)

gaussian_2D_convolutionV2(img, Lsmooth, 0, 0, 1.0f);
image_derivatives(Lsmooth, Lx, Ly);
kcontrast_ = async(launch::async, compute_k_percentileV2, ref(Lx), ref(Ly), options_.kcontrast_percentile, ref(modgs_), ref(histgram_));
kcontrast_ = async(launch::async, compute_k_percentileV2, Lx, Ly, options_.kcontrast_percentile, ref(modgs_), ref(histgram_));

e0_Lsmooth.get();
Compute_Determinant_Hessian_Response(0);
Expand Down

0 comments on commit 6616328

Please sign in to comment.