Skip to content
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

fix penalty in GenProj residual #696

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/RoMECameraModelsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function (cf::CalcFactor{<:GenericProjection{S,T}})(
w_P_o
) where {S,T}

κ = 1000
κ = 0.001
M = SpecialEuclidean(3)

w_Ph = SVector{4,Float64}(w_P_o..., 1.0)
Expand All @@ -47,10 +47,10 @@ function (cf::CalcFactor{<:GenericProjection{S,T}})(
# experimental cost function to try force bad reprojects in front of the camera during optimization
# κ*(abs(pred.depth) - pred.depth)^2 + (c_X[1]-pred[1])^2 + (c_X[2]-pred[2])^2

frontPenalty = κ*(abs(pred.depth) - pred.depth)^2
res = SVector{3,Float64}(
c_X[1]-pred[1],
c_X[2]-pred[2],
κ*(abs(pred.depth) - pred.depth)
frontPenalty + (c_X[1]-pred[1]),
frontPenalty + (c_X[2]-pred[2]),
)

# error vs measured projection
Expand Down