A system and method for detecting defects in a tubular structure installed in a wellbore extending into a subterranean formation. An input image of the tubular structure contains input data indicative of a characteristic of the tubular structure. A background image is determined based on the input image. The background image contains background data indicative of the characteristic of the tubular structure associated with manufacturing of the tubular structure. A defect image is determined based on a difference between the input image and the background image. The defect image contains defect data indicative of the characteristic of the tubular structure associated with defects in the tubular structure.