Abstract
This paper shows that structure from motion (SfM) is NP-hard for most sensible cost functions when missing data is allowed. The result provides a fundamental limitation of what is possible to achieve with any structure from motion algorithm. Even though there are recent, promising attempts to compute globally optimal solutions, there is no hope of obtaining a polynomial time algorithm unless P=NP. The proof proceeds by encoding an arbitrary Boolean formula as a structure from motion problem of polynomial size, such that the structure from motion problem has a zero cost solution if and only if the Boolean formula is satisfiable. Hence, if there was a guaranteed way to minimize the error of the relevant family of structure from motion problems in polynomial time, the NP-complete problem 3SAT could be solved in polynomial time, which would imply that P=NP. The proof relies heavily on results from both structure from motion and complexity theory.
Introduction
Structure from Motion (SfM) is the process of estimating 3D structures and camera poses from a series of 2D images. For years, researchers have sought "provably optimal" algorithms—methods that find the absolute best solution according to a specific error metric, rather than just a local minimum. While global optimality has been achieved for specific cases like the Tomasi-Kanade algorithm for affine cameras, these successes typically assume "complete data," where every 3D point is visible in every camera frame. In practice, occlusions and field-of-view limits lead to "missing data." This paper investigates whether the presence of missing data fundamentally changes the computational complexity of the SfM problem.
Methodology: Geometric Gadgets and Polynomial Reduction
To prove that SfM is NP-hard, the authors employ a polynomial reduction from the 3SAT problem. They demonstrate that any instance of 3SAT can be translated into an SfM problem of polynomial size. The construction involves building geometric "gadgets" that mimic digital logic components.
First, an Anchoring Frame is established using fixed points and cameras to define a stable coordinate system. Next, the authors identify Two-State Configurations—specific geometric setups that possess exactly two valid 3D reconstructions, acting as binary variables (0 or 1). Finally, a Variable Transfer mechanism is created to ensure consistency across the reconstruction.
The most critical component is the NAND Gate gadget. By designing a configuration of points and cameras that behaves exactly like a NAND gate, the authors prove that SfM can encode any Boolean formula, as NAND is a universal logic gate.
Key Insights and Results
The core realization of this work is that while SfM appears to be a continuous optimization problem, the introduction of missing data creates a hidden combinatorial structure. This combinatorial nature is what leads to NP-hardness. The paper highlights that "missing data" isn't just a nuisance for practitioners; it is the specific feature that makes the problem mathematically "hard."
The authors prove two primary theorems:
- Theorem 1: There exists no polynomial-time algorithm for solving the SfM problem with missing data based on a norm of reprojection residuals unless $P=NP$.
- Theorem 2: An SfM problem constructed from a Boolean formula has exactly as many zero-cost solutions as there are satisfying assignments for that formula.
This result is general, holding for standard cost functions (like $L_2$ or $L_\infty$ norms) and various camera models. It establishes that a Boolean formula is satisfiable if and only if the corresponding SfM problem has a solution with zero reprojection error.
Limitations and Future Work
The proof relies on some idealizations, such as the use of points at infinity (which can be resolved via homography) and the omission of strict chirality constraints (ensuring points are in front of cameras). While these are considered minor technicalities that do not invalidate the NP-hardness result, they represent areas for further formalization. Future research may explore whether SfM remains NP-hard under the assumption of a unique solution or within strictly calibrated camera models.
Summary updated