-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP]Add boosting tracker #20
base: master
Are you sure you want to change the base?
Changes from 1 commit
1f23e78
252c01e
ed3dc2c
dca7da3
3ffa15e
fcddb94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
using ImageTracking | ||
using Test | ||
|
||
|
||
include("farneback.jl") | ||
include("lucas_kanade.jl") | ||
include("haar.jl") | ||
include("visualization.jl") | ||
include("error_evaluation.jl") | ||
|
||
include("tracker/sample_roi.jl") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Images | ||
using ImageTracking:sample_roi | ||
|
||
@testset "ROI sampling" begin | ||
@info "Running ROI sampling tests" | ||
box = BoxROI(ones(300, 300), [125, 125, 175, 175]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To make it less error-prone, I think you need to cover the following types for img = ones(300, 300)
testcolors = (RGB,Gray)
testtypes = (Float32, Float64, N0f8, N0f16)
for C in testcolors, T in testtypes
box = BoxROI(img .|> C{T}, [125, 125, 175, 175])
...
end If the function don't work for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
sampler_overlap = 0.5 | ||
search_factor = 2.0 | ||
int_img = integral_image(box.img) | ||
currentsample = CurrentSampler(sampler_overlap, search_factor) | ||
# positive sampling | ||
currentsample.mode = :positive | ||
@time samples = sample_roi(currentsample, BoxROI(int_img, box.bound)) | ||
|
||
@test size(samples) == (1, 4) | ||
@test samples[1][1] == int_img[125:175, 125:175] | ||
|
||
# negative sampling | ||
currentsample.mode = :negative | ||
@time samples = sample_roi(currentsample, BoxROI(int_img, box.bound)) | ||
|
||
@test size(samples) == (1, 4) | ||
@test samples[1][1] == int_img[100:150, 100:150] | ||
@test samples[2][1] == int_img[100:150, 151:201] | ||
@test samples[3][1] == int_img[151:201, 100:150] | ||
@test samples[4][1] == int_img[151:201, 151:201] | ||
|
||
end; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in general you can write inequalities like this in Julia:
rather than
The former is much more readable.