Skip to content

Commit befac1e

Browse files
Specify console level for camerasolver tests.
Also adds some lens tests for solving lens distortion values.
1 parent 852c484 commit befac1e

1 file changed

Lines changed: 108 additions & 38 deletions

File tree

lib/rust/mmcamerasolve-bin/test.bash

Lines changed: 108 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if [ -f "${UV_FILE}" ]; then
7272
--image-height 2400 \
7373
--prefix cube_a \
7474
--output-dir "${OUTPUT_BASE}" \
75-
--log-level info
75+
--console-level progress
7676
echo "Output: ${OUTPUT_BASE}"
7777
else
7878
echo "SKIP: ${UV_FILE} not found"
@@ -93,7 +93,7 @@ if [ -f "${UV_FILE}" ]; then
9393
--image-height 2400 \
9494
--prefix cube_b \
9595
--output-dir "${OUTPUT_BASE}" \
96-
--log-level info
96+
--console-level progress
9797
echo "Output: ${OUTPUT_BASE}"
9898
else
9999
echo "SKIP: ${UV_FILE} not found"
@@ -111,7 +111,7 @@ if [ -f "${UV_FILE}" ] && [ -f "${MMCAMERA_FILE}" ]; then
111111
--mmcamera "${MMCAMERA_FILE}" \
112112
--prefix stA_mmcamera \
113113
--output-dir "${OUTPUT_BASE}" \
114-
--log-level info
114+
--console-level progress
115115
echo "Output: ${OUTPUT_BASE}"
116116
else
117117
echo "SKIP: ${UV_FILE} or ${MMCAMERA_FILE} not found"
@@ -131,7 +131,7 @@ if [ -f "${UV_FILE}" ] && [ -f "${MMCAMERA_FILE}" ] && [ -f "${NUKE_LENS_FILE}"
131131
--nuke-lens "${NUKE_LENS_FILE}" \
132132
--prefix stA_nuke_lens \
133133
--output-dir "${OUTPUT_BASE}" \
134-
--log-level info
134+
--console-level progress
135135
echo "Output: ${OUTPUT_BASE}"
136136
else
137137
echo "SKIP: required files not found"
@@ -151,7 +151,7 @@ if [ -f "${UV_FILE}" ] && [ -f "${MMCAMERA_FILE}" ] && [ -f "${NUKE_LENS_FILE}"
151151
--nuke-lens "${NUKE_LENS_FILE}" \
152152
--prefix stA_undistort \
153153
--output-dir "${OUTPUT_BASE}" \
154-
--log-level info
154+
--console-level progress
155155
echo "Output: ${OUTPUT_BASE}"
156156
else
157157
echo "SKIP: required files not found"
@@ -169,7 +169,7 @@ if [ -f "${UV_FILE}" ] && [ -f "${MMCAMERA_FILE}" ]; then
169169
--mmcamera "${MMCAMERA_FILE}" \
170170
--prefix stA_no_lens \
171171
--output-dir "${OUTPUT_BASE}" \
172-
--log-level info
172+
--console-level progress
173173
echo "Output: ${OUTPUT_BASE}"
174174
else
175175
echo "SKIP: required files not found"
@@ -192,7 +192,7 @@ if [ -f "${UV_FILE}" ] && [ -f "${SETTINGS_FILE}" ]; then
192192
--solver-settings "${SETTINGS_FILE}" \
193193
--prefix stA_settings \
194194
--output-dir "${OUTPUT_BASE}" \
195-
--log-level info
195+
--console-level progress
196196
echo "Output: ${OUTPUT_BASE}"
197197
else
198198
echo "SKIP: ${UV_FILE} or ${SETTINGS_FILE} not found"
@@ -216,38 +216,107 @@ if [ -f "${UV_FILE}" ] && [ -f "${SETTINGS_FILE2}" ]; then
216216
--solver evolution_refine \
217217
--solver-settings "${SETTINGS_FILE2}" \
218218
--output-dir "${OUTPUT_BASE}" \
219-
--log-level info
219+
--console-level progress
220220
echo "Output: ${OUTPUT_BASE}"
221221
else
222222
echo "SKIP: ${UV_FILE} or ${SETTINGS_FILE2} not found"
223223
fi
224224
echo ""
225225

226-
# Test 11: Blasterwalk dataset.
226+
# Test 11: stA dataset with lens parameter optimization (uniform_grid).
227227
echo "----------------------------------------------"
228-
echo "Test 11: Blasterwalk dataset"
228+
echo "Test 11: stA dataset (lens parameter optimization - uniform grid)"
229229
echo "----------------------------------------------"
230-
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/blasterwalk_camera_2dtracks_v1_format.uv"
230+
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/stA_v1_format.uv"
231+
MMCAMERA_FILE="${PROJECT_ROOT}/tests/data/mmcamera/stA_copyCamera.mmcamera"
232+
NUKE_LENS_FILE="${PROJECT_ROOT}/tests/data/lens_example_files/stA_v001.nk"
233+
SETTINGS_FILE_LENS="${PROJECT_ROOT}/tests/data/mmsettings/solver_settings_with_lens.mmsettings"
234+
if [ -f "${UV_FILE}" ] && [ -f "${MMCAMERA_FILE}" ] && [ -f "${NUKE_LENS_FILE}" ] && [ -f "${SETTINGS_FILE_LENS}" ]; then
235+
${MM_CAMERA_SOLVE} "${UV_FILE}" \
236+
--mmcamera "${MMCAMERA_FILE}" \
237+
--nuke-lens "${NUKE_LENS_FILE}" \
238+
--solver-settings "${SETTINGS_FILE_LENS}" \
239+
--solver uniform_grid \
240+
--prefix stA_lens_opt_uniform_grid \
241+
--output-dir "${OUTPUT_BASE}" \
242+
--console-level progress
243+
echo "Output: ${OUTPUT_BASE}"
244+
else
245+
echo "SKIP: required files not found"
246+
fi
247+
echo ""
248+
249+
# Test 12: stA dataset with lens parameter optimization (evolution_refine).
250+
echo "----------------------------------------------"
251+
echo "Test 12: stA dataset (lens parameter optimization - evolution_refine)"
252+
echo "----------------------------------------------"
253+
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/stA_v1_format.uv"
254+
MMCAMERA_FILE="${PROJECT_ROOT}/tests/data/mmcamera/stA_copyCamera.mmcamera"
255+
NUKE_LENS_FILE="${PROJECT_ROOT}/tests/data/lens_example_files/stA_v001.nk"
256+
SETTINGS_FILE_LENS="${PROJECT_ROOT}/tests/data/mmsettings/solver_settings_with_lens.mmsettings"
257+
if [ -f "${UV_FILE}" ] && [ -f "${MMCAMERA_FILE}" ] && [ -f "${NUKE_LENS_FILE}" ] && [ -f "${SETTINGS_FILE_LENS}" ]; then
258+
${MM_CAMERA_SOLVE} "${UV_FILE}" \
259+
--mmcamera "${MMCAMERA_FILE}" \
260+
--nuke-lens "${NUKE_LENS_FILE}" \
261+
--solver-settings "${SETTINGS_FILE_LENS}" \
262+
--solver evolution_refine \
263+
--prefix stA_lens_opt_evolution_refine \
264+
--output-dir "${OUTPUT_BASE}" \
265+
--console-level progress
266+
echo "Output: ${OUTPUT_BASE}"
267+
else
268+
echo "SKIP: required files not found"
269+
fi
270+
echo ""
271+
272+
# Test 13: stA dataset with lens parameter optimization (evolution_unknown).
273+
echo "----------------------------------------------"
274+
echo "Test 13: stA dataset (lens parameter optimization - evolution_unknown)"
275+
echo "----------------------------------------------"
276+
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/stA_v1_format.uv"
277+
MMCAMERA_FILE="${PROJECT_ROOT}/tests/data/mmcamera/stA_copyCamera.mmcamera"
278+
NUKE_LENS_FILE="${PROJECT_ROOT}/tests/data/lens_example_files/stA_v001.nk"
279+
SETTINGS_FILE_LENS="${PROJECT_ROOT}/tests/data/mmsettings/solver_settings_with_lens.mmsettings"
280+
if [ -f "${UV_FILE}" ] && [ -f "${MMCAMERA_FILE}" ] && [ -f "${NUKE_LENS_FILE}" ] && [ -f "${SETTINGS_FILE_LENS}" ]; then
281+
${MM_CAMERA_SOLVE} "${UV_FILE}" \
282+
--mmcamera "${MMCAMERA_FILE}" \
283+
--nuke-lens "${NUKE_LENS_FILE}" \
284+
--solver-settings "${SETTINGS_FILE_LENS}" \
285+
--solver evolution_unknown \
286+
--prefix stA_lens_opt_evolution_refine \
287+
--output-dir "${OUTPUT_BASE}" \
288+
--console-level progress
289+
echo "Output: ${OUTPUT_BASE}"
290+
else
291+
echo "SKIP: required files not found"
292+
fi
293+
echo ""
294+
295+
# Test 14: Opera House dataset.
296+
echo "----------------------------------------------"
297+
echo "Test 14: Opera House dataset"
298+
echo "----------------------------------------------"
299+
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/operahouse_v1_format.uv"
231300
if [ -f "${UV_FILE}" ]; then
232301
${MM_CAMERA_SOLVE} "${UV_FILE}" \
233-
--focal-length 56.4 \
302+
--focal-length 91 \
234303
--film-back-width 36 \
235-
--film-back-height 20.25 \
236-
--image-width 3600 \
237-
--image-height 2025 \
304+
--film-back-height 27 \
305+
--image-width 3072 \
306+
--image-height 2304 \
238307
--solver evolution_refine \
239-
--prefix blasterwalk \
308+
--prefix operahouse \
240309
--output-dir "${OUTPUT_BASE}" \
241-
--log-level info
310+
--console-level progress
242311
echo "Output: ${OUTPUT_BASE}"
243312
else
244313
echo "SKIP: ${UV_FILE} not found"
245314
fi
246315
echo ""
247316

248-
# Test 12: HCW Painting dataset.
317+
# Test 15: HCW Painting dataset.
249318
echo "----------------------------------------------"
250-
echo "Test 12: HCW Painting dataset"
319+
echo "Test 15: HCW Painting dataset"
251320
echo "----------------------------------------------"
252321
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/hcw_painting_2dtracks_v1_format.uv"
253322
if [ -f "${UV_FILE}" ]; then
@@ -260,38 +329,38 @@ if [ -f "${UV_FILE}" ]; then
260329
--solver evolution_refine \
261330
--prefix hcw_painting \
262331
--output-dir "${OUTPUT_BASE}" \
263-
--log-level info
332+
--console-level progress
264333
echo "Output: ${OUTPUT_BASE}"
265334
else
266335
echo "SKIP: ${UV_FILE} not found"
267336
fi
268337
echo ""
269338

270-
# Test 13: Opera House dataset.
339+
# Test 16: Blasterwalk dataset.
271340
echo "----------------------------------------------"
272-
echo "Test 13: Opera House dataset"
341+
echo "Test 16: Blasterwalk dataset"
273342
echo "----------------------------------------------"
274-
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/operahouse_v1_format.uv"
343+
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/blasterwalk_camera_2dtracks_v1_format.uv"
275344
if [ -f "${UV_FILE}" ]; then
276345
${MM_CAMERA_SOLVE} "${UV_FILE}" \
277-
--focal-length 91 \
346+
--focal-length 56.4 \
278347
--film-back-width 36 \
279-
--film-back-height 27 \
280-
--image-width 3072 \
281-
--image-height 2304 \
348+
--film-back-height 20.25 \
349+
--image-width 3600 \
350+
--image-height 2025 \
282351
--solver evolution_refine \
283-
--prefix operahouse \
352+
--prefix blasterwalk \
284353
--output-dir "${OUTPUT_BASE}" \
285-
--log-level info
354+
--console-level progress
286355
echo "Output: ${OUTPUT_BASE}"
287356
else
288357
echo "SKIP: ${UV_FILE} not found"
289358
fi
290359
echo ""
291360

292-
# Test 14: Garage dataset.
361+
# Test 17: Garage dataset.
293362
echo "----------------------------------------------"
294-
echo "Test 14: Garage dataset"
363+
echo "Test 17: Garage dataset"
295364
echo "----------------------------------------------"
296365
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/garage_2dtracks_v1_format.uv"
297366
if [ -f "${UV_FILE}" ]; then
@@ -306,16 +375,16 @@ if [ -f "${UV_FILE}" ]; then
306375
--end-frame 2706 \
307376
--intermediate-output \
308377
--output-dir "${OUTPUT_BASE}" \
309-
--log-level info
378+
--console-level progress
310379
echo "Output: ${OUTPUT_BASE}"
311380
else
312381
echo "SKIP: ${UV_FILE} not found"
313382
fi
314383
echo ""
315384

316-
# Test 15: Quiet mode.
385+
# Test 18: Quiet mode.
317386
echo "----------------------------------------------"
318-
echo "Test 15: Quiet mode"
387+
echo "Test 18: Quiet mode"
319388
echo "----------------------------------------------"
320389
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/test_cube_a_markers_v1_fmt.uv"
321390
if [ -f "${UV_FILE}" ]; then
@@ -327,17 +396,18 @@ if [ -f "${UV_FILE}" ]; then
327396
--image-height 2400 \
328397
--solver evolution_refine \
329398
--prefix quiet_test \
330-
--output-dir "${OUTPUT_BASE}"
399+
--output-dir "${OUTPUT_BASE}" \
400+
--console-level error
331401
echo "Quiet mode completed (no output expected above)"
332402
echo "Output: ${OUTPUT_BASE}"
333403
else
334404
echo "SKIP: ${UV_FILE} not found"
335405
fi
336406
echo ""
337407

338-
# Test 16: Frame range override.
408+
# Test 19: Frame range override.
339409
echo "----------------------------------------------"
340-
echo "Test 16: Frame range override (frames 1-10)"
410+
echo "Test 19: Frame range override (frames 1-10)"
341411
echo "----------------------------------------------"
342412
UV_FILE="${PROJECT_ROOT}/tests/data/uvtrack/test_cube_a_markers_v1_fmt.uv"
343413
if [ -f "${UV_FILE}" ]; then
@@ -352,7 +422,7 @@ if [ -f "${UV_FILE}" ]; then
352422
--solver evolution_refine \
353423
--prefix frame_range \
354424
--output-dir "${OUTPUT_BASE}" \
355-
--log-level info
425+
--console-level progress
356426
echo "Output: ${OUTPUT_BASE}"
357427
else
358428
echo "SKIP: ${UV_FILE} not found"

0 commit comments

Comments
 (0)