Image stitching is important for the perception and manipulation of undersea robots. In spite of a well-developed technique, it is still challenging for undersea images because of their inevitable appearance ambiguity caused by the limited light in the undersea environment, and local disturbance caused by moving objects, ocean current, etc. To get a clean and stable background panorama in the undersea environment, this paper proposes an undersea image-stitching method by introducing graph-based registration and blending procedures. Specifically, in the registration procedure, matching the features in each undersea image pair is formulated and solved by graph matching, to incorporate the structural information between features. In the blending procedure, an energy function on the indirect graph Markov random field is proposed, which takes both image consistency and neighboring consistency into consideration. Coincidentally, both graph matching and energy minimization can be mathematically formulated by integer quadratic programming problems with different constraints; the recently proposed graduated nonconvexity and concavity procedure is used to optimize both problems. Experiments on both synthetic images and real-world undersea images witness the effectiveness of the proposed method.