Corrosion is considered as one of the most predominant causes of pipeline failures in the oil and gas industry and normally cannot be easily detected at the inner surface of pipelines without service disruption. The real-time inspection of oil and gas pipelines is extremely vital to mitigate accidents and maintenance cost as well as to improve the oil and gas transport efficiency. In this paper, a new, non-contact optical sensor array method for real-time inspection and non-destructive evaluation (NDE) of pipelines is presented. The proposed optical method consists of light emitting diodes (LEDs) and light dependent resistors (LDRs) to send light and receive reflected light from the inner surface of pipelines. The uniqueness of the proposed method lies in its accurate detection as well as its localization of corrosion defects, based on the utilization of optical sensor array in the pipeline, and also the flexibility with which this system can be adopted for pipelines with different services, sizes, and materials, as well as the method's economic viability. Experimental studies are conducted considering corrosion defects with different features and dimensions to confirm the robustness and accuracy of the method. The obtained data are processed with discrete wavelet transform (DWT) for noise cancelation and feature extraction. The estimated sizes of the corrosion defects for different physical parameters, such as inspection speed and lift-off distance, are investigated and, finally, some preliminary tests are conducted based on the implementation of the proposed method on an in-line developed smart pipeline inspection gauge (PIG) for in-line inspection (ILI) application, with resulting success.