-
Notifications
You must be signed in to change notification settings - Fork 2
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
How to add new primitives? #10
Comments
Parameters solved: julia> using ExtractMacro
julia> plane_par = (α=10, ϵ=0.1, other_par = 11.3)
(α = 10, ϵ = 0.1, other_par = 11.3)
julia> sphere_par = (α=5, ϵ=0.05, )
(α = 5, ϵ = 0.05)
julia> iter_par1 = (maxit=100, p = 0.99)
(maxit = 100, p = 0.99)
julia> new_shape = (α=1, ϵ=15, oth="A")
(α = 1, ϵ = 15, oth = "A")
julia> ransacpars = (plane=plane_par, sphere=sphere_par, iterations=iter_par1)
(plane = (α = 10, ϵ = 0.1, other_par = 11.3), sphere = (α = 5, ϵ = 0.05), iterations = (maxit = 100, p = 0.99))
julia> function test1(p)
@extract p : sphere_p=sphere plane_p=plane
@show sphere_p
@show plane_p
end
test1 (generic function with 1 method)
julia> test1(ransacpars)
sphere_p = (α = 5, ϵ = 0.05)
plane_p = (α = 10, ϵ = 0.1, other_par = 11.3)
(α = 10, ϵ = 0.1, other_par = 11.3)
julia> test1(ransacpars);
sphere_p = (α = 5, ϵ = 0.05)
plane_p = (α = 10, ϵ = 0.1, other_par = 11.3)
julia> function test2(p)
@extract p : sphere_p=sphere plane_p=plane
@show sphere_p
@show plane_p
end
test2 (generic function with 1 method)
julia> function test2(p)
@extract p : sphere_p=sphere plane_p=plane
@show sphere_p
@extract sphere_p : sphere_alpha=α
@extract plane_p : plane_alpha = α
@show sphere_alpha
@show plane_alpha
end
test2 (generic function with 1 method)
julia> test2(ransacpars);
sphere_p = (α = 5, ϵ = 0.05)
sphere_alpha = 5
plane_alpha = 10
julia> newshape_par = (newshape=new_shape)
(α = 1, ϵ = 15, oth = "A")
julia> newshape_par = (newshape=new_shape,)
(newshape = (α = 1, ϵ = 15, oth = "A"),)
julia> merge(ransacpars, newshape_par)
(plane = (α = 10, ϵ = 0.1, other_par = 11.3), sphere = (α = 5, ϵ = 0.05), iterations = (maxit = 100, p = 0.99), newshape = (α = 1, ϵ = 15, oth = "A")) |
Implemented in #12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What needs to be done, to add a new shape primitive? (Just gathering the tasks, syntax and names are subject to change.)
struct NewShape <: FittedShape
: a new typefitshape(::Type{NewShape},...)
: a function that fits the primitivecompatibles(shape::NewShape)
: compute the compatible pointsscorecandidate()
- is it even necessary?refitshape()
RANSACParameters
)The text was updated successfully, but these errors were encountered: