1. A detection apparatus, comprising: a first array including plural sensors; a second array including plural sensors that are not collinear with the sensors of the first array except for one of the sensors that defines an origin of a spatial phase; and a hardware processor configured to generate a first covariance matrix based on reflected waves received by the second array from targets and generate a second covariance matrix based on reflected waves received by the first array and the second array from the targets, estimate first angles of the targets based on the first covariance matrix, reproduce an angle matrix based on the estimated first angles, perform QR decomposition on a product of a generalized inverse matrix of the reproduced angle matrix and the second covariance matrix to obtain a unitary matrix, construct a similarity transformation problem from submatrices of the obtained unitary matrix, estimate second angles of the targets based on the estimated first angles and solutions of the similarity transformation problem, generate a third covariance matrix based on the reflected waves received by the first array from the targets, and determine validity of pairings of the first angles and the second angles based on the first or third covariance matrix and elements of an upper triangular matrix obtained by performing the QR decomposition on the product of the generalized inverse matrix of the reproduced angle matrix and the second covariance matrix.