1. An ultrasonic image processing device comprising: a specifying unit that specifies, in an M-mode image including a contour line as a motion curve, an image portion that includes an extraction portion of the contour line; and an extracting unit that applies a contour model including a node string to the image portion including the extraction portion, thereby extracting the extraction portion of the contour line, wherein the extracting unit comprises an initial setting unit that configures initial settings of the contour model for the image portion, and a model deforming unit that performs contour search on the M-mode image for each of nodes included in the node string after the initial settings, thereby fitting the node string to the extracting portion and forming a modified contour model.