Skip to content

Commit

Permalink
makeORBParams more kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
Affie committed Sep 4, 2023
1 parent 513dfdc commit 33b1bc9
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions examples/tracking/visual/PyCV_TrackFeaturesFwdBck.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 33b1bc9

Please sign in to comment.