1. A target detecting method, comprising: detecting edges in a first direction in an input image, to obtain an edge image comprising a plurality of edges in the first direction; and generating one or more candidate targets according to the plurality of edges in the first direction, a region between any two of the plurality of edges in the first direction in the input image corresponding to one of the candidate targets; detecting edges in a second direction different from the first direction in an image block corresponding to each candidate target in the input image, to obtain an edge image block comprising one or more edges in the second direction; optimizing the each candidate target according to the one or more edges in the second direction; detecting a region, having a high density of edges in the second direction, in the edge image block, and wherein optimizing the each candidate target comprising: optimizing the each candidate target according to the region having a high density of edges in the second direction.