32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
|
|
const { execSync } = require('child_process');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const BASE_PATH = path.join(__dirname, '..');
|
|
const PYTHON_CMD = process.platform === 'win32' ? 'python' : 'python3';
|
|
|
|
describe('Camera Pose Script', () => {
|
|
|
|
test('should build scene JSON with timestamp parameter', () => {
|
|
|
|
const outDir = "test/data/screenShots";
|
|
const strFile0 = path.join(outDir, "snapshot_video0_1778819665744.jpg");
|
|
const strFile1 = path.join(outDir, "snapshot_video1_1778819665744.jpg");
|
|
|
|
const command2 = `${PYTHON_CMD} ${path.join(BASE_PATH, 'programs/readTwoImages.py')} \
|
|
-i ${strFile0} \
|
|
-i ${strFile1} \
|
|
-npz ${path.join(BASE_PATH, 'data/settings/callibration_cam0.npz')} \
|
|
-npz ${path.join(BASE_PATH, 'data/settings/callibration_cam1.npz')} \
|
|
-settings ${path.join(BASE_PATH, 'data/settings/settings1m.json')}`;
|
|
|
|
|
|
try {
|
|
execSync(command2, { stdio: 'inherit' });
|
|
|
|
} catch (error) {
|
|
fail(`Failed to execute command: ${error.message}`);
|
|
}
|
|
});
|
|
}); |