From 33b1bc9f529a06f38f62d70715f665851a5c9e81 Mon Sep 17 00:00:00 2001 From: Johannes Terblanche Date: Mon, 4 Sep 2023 16:06:14 +0200 Subject: [PATCH] makeORBParams more kwargs --- .../visual/PyCV_TrackFeaturesFwdBck.jl | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/examples/tracking/visual/PyCV_TrackFeaturesFwdBck.jl b/examples/tracking/visual/PyCV_TrackFeaturesFwdBck.jl index 286b7b18e..5b582c177 100644 --- a/examples/tracking/visual/PyCV_TrackFeaturesFwdBck.jl +++ b/examples/tracking/visual/PyCV_TrackFeaturesFwdBck.jl @@ -146,6 +146,7 @@ function trackFeaturesForwardsBackwards(imgs, feature_params, lk_params; mask=no tracks = trackFeaturesFrames(feats0, imgs[cen:end], lk_params; mask) for (i,tr) in enumerate(tracks) + isnothing(tr) && continue img_tracks[i] = [tr[k,:,:][:] for k in 1:size(tr,1)] end @@ -205,13 +206,34 @@ function makeBlobFeatureTracksPerImage_FwdBck!( end end -function makeORBParams(feature_params) - orb = cv.ORB_create() - orb.setMaxFeatures(feature_params.maxCorners) - orb.setPatchSize(feature_params.blockSize) - orb.setNLevels(1) - # orb.setScoreType(1) # FAST +function makeORBParams( + feature_params; + nfeatures = feature_params.maxCorners, + nlevels = 1, + fastThreshold = 20, + edgeThreshold = 31, + firstLevel = 0, + patchSize = 31, + WTA_K = 2, + scaleFactor = 1.1, + scoreType = 1, +) + orb = cv.ORB_create( + nlevels = nlevels, + fastThreshold = fastThreshold, + edgeThreshold = edgeThreshold, + firstLevel = firstLevel, + patchSize = patchSize, + WTA_K = WTA_K, + nfeatures = nfeatures, + scaleFactor = scaleFactor, + scoreType = scoreType, + ) + # orb.setMaxFeatures(feature_params.maxCorners) + # orb.setPatchSize(feature_params.blockSize) + # orb.setNLevels(1) + # orb.setScoreType(1) # FAST return orb end