1. An image rectification method, the method comprising: receiving a plurality of images; determining a matrix for performing rectification on the plurality of images based on a first cost function and a second cost function, the first cost function being associated with a distance of a corresponding pair of points from among the plurality of images, the second cost function being associated with distortion in a converted image; converting the plurality of images based on the matrix to generate the converted image; and performing stereo matching based on the converted image.