Skip to content

Commit

Permalink
Merge pull request #979 from JuliaRobotics/23Q3/enh/orb_create
Browse files Browse the repository at this point in the history
makeORBParams more kwargs
  • Loading branch information
dehann authored Sep 8, 2023
2 parents 513dfdc + 33b1bc9 commit 36d6650
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 36d6650

Please sign in to comment.