1. A pixel defect correction device comprising: a defect determining section that determines whether or not a pixel of interest of an image, in which a plurality of pixels each having a pixel value are arrayed in a two-dimensional manner, is a defect of the image; a gradient detecting section that detects a gradient or an edge in a processing region, which includes a plurality of pixels with the pixel of interest in the middle, on the basis of values of at least peripheral pixels around the pixel of interest which are included in the processing region; a correction value acquisition section that selects a pixel, which is used for acquisition of a correction value of the pixel of interest, according to the detected gradient or edge and acquires the correction value from a value of the selected pixel; and a defective pixel replacing section that replaces the value of the pixel of interest with the correction value when the pixel of interest is determined to be a defect of the image.