1. A defect pixel correction system for image data collected by a pixel array of an image sensor, comprising: a neighborhood analysis component that computes neighborhood statistics for a given pixel from the image data based on values of neighbor pixels of the given pixel from the image data, wherein the neighbor pixels and the given pixel belong to a particular Bayer domain, and wherein each of neighbor pixels of the given pixel are one of vertically, horizontally, or diagonally adjacent to the given pixel within the particular Bayer domain; a defect detection component that detects whether a value of the given pixel from the image data is defective based upon the neighborhood statistics, wherein the defect detection component further comprises: a statistics evaluation component that detects whether the neighbor pixels cover a flat region or a non-flat region based upon the neighborhood statistics; a threshold determination component that selects a predefined parameter as a function of whether the neighbor pixels cover the flat region or the non-flat region, wherein the threshold determination component computes a high threshold and a low threshold based upon the selected predefined parameter and the neighborhood statistics; and a comparison component that compares the value of the given pixel to the high threshold and the low threshold, wherein the value of the given pixel from the image data is detected to be defective when greater than the high threshold or less than the low threshold; and a replacement component that replaces the value of the given pixel from the image data when detected to be defective to output modified image data.