Detection of nonuniform residual strain in a pipe