Skip to content

Commit

Permalink
add (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
powei-lin authored Dec 26, 2024
1 parent 7f5d450 commit 7cba577
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "camera-intrinsic-calibration"
version = "0.5.2"
version = "0.5.3"
edition = "2021"
authors = ["Powei Lin <poweilin1994@gmail.com>"]
readme = "README.md"
Expand All @@ -21,7 +21,7 @@ exclude = [
]

[dependencies]
aprilgrid = "0.4.3"
aprilgrid = "0.5.1"
camera-intrinsic-model = "0.3.1"
clap = { version = "4.5.23", features = ["derive"] }
colorous = "1.0.15"
Expand All @@ -38,10 +38,10 @@ rand_chacha = "0.3.1"
rayon = "1.10.0"
rerun = "0.17.0"
serde = { version = "1.0.216", features = ["derive"] }
serde_json = "1.0.133"
serde_json = "1.0.134"
sqpnp_simple = "0.1.5"
time = "0.3.37"
tiny-solver = "0.12.1"
tiny-solver = "0.13.0"

[[bin]]
name = "ccrs"
Expand Down
10 changes: 5 additions & 5 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ pub fn convert_model(
HashMap::<String, na::DVector<f64>>::from([("params".to_string(), target_params_init)]);

// initialize optimizer
let optimizer = tiny_solver::GaussNewtonOptimizer {};
let optimizer = tiny_solver::LevenbergMarquardtOptimizer::default();

// distortion parameter bound
set_problem_parameter_bound("params", &mut problem, target_model, false);
Expand Down Expand Up @@ -311,7 +311,7 @@ pub fn init_ucm(
]);

// initialize optimizer
let optimizer = tiny_solver::GaussNewtonOptimizer {};
let optimizer = tiny_solver::LevenbergMarquardtOptimizer::default();
if fixed_focal {
init_focal_alpha_problem.fix_variable("params", 0);
}
Expand Down Expand Up @@ -407,7 +407,7 @@ pub fn calib_camera(
}
}

let optimizer = tiny_solver::GaussNewtonOptimizer {};
let optimizer = tiny_solver::LevenbergMarquardtOptimizer::default();
// let initial_values = optimizer.optimize(&problem, &initial_values, None);

set_problem_parameter_bound("params", &mut problem, generic_camera, xy_same_focal);
Expand Down Expand Up @@ -513,7 +513,7 @@ pub fn init_camera_extrinsic(cam_rtvecs: &[HashMap<usize, RvecTvec>]) -> Vec<Rve
("tvec".to_string(), tvec),
]);

let optimizer = tiny_solver::GaussNewtonOptimizer {};
let optimizer = tiny_solver::LevenbergMarquardtOptimizer::default();
let result = optimizer.optimize(&problem, &initial_values, None).unwrap();
println!("extrinsic cam{} cam0", cam_i);
println!("rvec: {}", result["rvec"]);
Expand Down Expand Up @@ -629,7 +629,7 @@ pub fn calib_all_camera_with_extrinsics(
println!("set focal");
problem.fix_variable("params0", 0);
}
let optimizer = tiny_solver::GaussNewtonOptimizer {};
let optimizer = tiny_solver::LevenbergMarquardtOptimizer::default();

let result_option = optimizer.optimize(&problem, &initial_values, None);
if let Some(mut result) = result_option {
Expand Down

0 comments on commit 7cba577

Please sign in to comment.