I am searching for a way to evaluate the similarity between two segmented linear segments. To make things clear, consider the illustration below:
Scanline 1 is very similar to the Template (in fact it's the Template segmentation pattern scaled down, so it has the same ratios between every segment pair as the Template).
On the other hand, Scanline 2 is way less similar to the Template.
The most relevant resource I found so far is the cross-ratio. However, using the cross-ratio metric as defined in the link above, we can only compare two linear segments that are segmented into 3 parts.
Any ideas of generalizing this metric or using another one as a metric?
Update: The metric should be scale invariant
Finally, the comparison of the scanlines will be done without thresholding the values of the image extracted one in order to avoid the "magic number" of the threshold. The comparison will be made between:
The metric to be used is cross correlation implemented using convolution.