1
$\begingroup$

While implementing the Shi-Tomasi corner detection algorithm, I got stuck in deciding a suitable threshold for corner detection.

In the Shi-Tomasi algorithm, all those points that qualify $\min( \lambda_1, \lambda_2) > \text{threshold}$ are considered as corner points. (where $\lambda_1, \lambda_2$ are eigenvalues).

My question is: what is a suitable criterion to decide that threshold?

$\endgroup$
1

1 Answer 1

1
$\begingroup$

The threshold is typically chosen empirically, so there is no exact answer.

It's dependent on how many corners you wish to select, and how strict you want the detection, which could depend on the use case, the dataset, and the block size of the algorithm. If you’re not sure what to choose for the threshold, I would suggest using a scheme relative to your images to deduce the best threshold, based on what performs best for your use case.

For example, let the criteria for selection, or scoring function, be $R$, which in the Shi-Tomasi case is $R = min(\lambda_1, \lambda_2)$. We could choose some value $q \in (0,1)$, so that the threshold becomes

$t = q\max_p{R}$,

where the max $R$ is calculated over all points $p$, an approach similar to OpenCV Good Features to Track.

You could examine the corners detected and adjust $q$ based on how stringently you wanted to select corners. If you don't want to waste the time manually fine-tuning the threshold, you could check out some automated approaches in the literature, such as Automated thresholding for low-complexity corner detection

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .