1. A boundary detecting method detecting one edge configuring a boundary of a source document by using a difference between materials in an image obtained by capturing the source document with a scanner, comprising: a step of detecting edge segments by searching all of the search lines in the image from an extremity of the image in a direction perpendicular to the top, bottom, left or right edge to be detected by a computer; a step of extracting a ruled line from the source document in the image by the computer; a step of detecting edge segments by searching all of the search lines from a vicinity of a center of the image toward the extremity of the image by the computer, if a line whose edge segment cannot be detected exists; and a step of determining a line approximating the top, bottom, left or right edge from the edge segments detected for all of the search lines by the computer, wherein each search line comprises a plurality of search blocks; each search block is more than one pixel high and more than one pixel wide; the search block corresponding to a portion of the edge to be detected is detected as the edge segment; each of the edge segments is defined by a length of a search block image portion corresponding to an edge, as detected in the searching of the search lines; said step of determining a line comprises a candidate determining step of obtaining a plurality of edge candidates from the edge segments for all of the search lines, and a selecting step of selecting an optimum candidate from among the plurality of edge candidates on a basis of a difference between first and second differences between each of the plurality of edge candidates and the ruled line, wherein the first and second differences regarding one of the plurality of edge candidates are defined as a length of an axis from a first or second end of the ruled line to the one of the plurality of edge candidates respectively.