Hi there,
I have a set of values and I know that some of them are good and some are not... but I cannot find the ratio.
I know it souns strange but let me explain. Here is the list of values

37 - 16 - good
21 - 12 - good
18 - 10 - good
26 - 12 - good
18 - 9 - good
27 - 12 - good
23 - 10 - good
33 - 20 - good
32 - 23 - good

(I can provide more data if needed).

The above values are the results of python - opencv - SIFT matching: total matching - inlier - resulting homography.
I couldn't find a ratio in the values. I tried the following

if value2/value1 > 0.4 then good

but it doesn't work all the times. I know that when value2 is lower then 10, usually the homography is bad (but you can see above that sometimes this doesn't work too).

Can you help me finding a good ratio for the above values? I can accept some errors but not as the above (on 22 results, only 9 are good).
Thanks,
G.

I dont think there is a good ratio. I used this code

``````import numpy as np
import matplotlib
import matplotlib.pyplot as plt

data = """
37 - 16 - good
21 - 12 - good
18 - 10 - good
26 - 12 - …``````

## All 3 Replies

I dont think there is a good ratio. I used this code

``````import numpy as np
import matplotlib
import matplotlib.pyplot as plt

data = """
37 - 16 - good
21 - 12 - good
18 - 10 - good
26 - 12 - good
18 - 9 - good
27 - 12 - good
23 - 10 - good
33 - 20 - good
32 - 23 - good
""".strip().split('\n')
data = [x.split('-') for x in data]
def conv(t):
x, y, v = t
return (float(x), float(y), (v.strip() == 'good'))
data = [conv(t) for t in data]
print(data)
good = [t for t in data if t]
bad = [t for t in data if not t]
Xg, Yg, tmp = list(zip(*good))

fig = plt.figure()
ax.plot(Xg, Yg, 'og')
ax.plot(Xb, Yb, 'or')
ax.set_title('The Good, the Bad and the Ugly')
plt.show()
``````

The result is this plot, where the red dots are bad data and green dots are good data. If there was anything like a good ratio, the two sets of points would be separated by an oblique line.

Interesting! Thanks Gribouillis.
I'm not good in maths, but I was wondering if other formulas may produce different results (such as the logarithm or whatever else... if it makes sense).
I will see if it changes anything by adding larger dataset.
Thanks,
Gianluca

The general idea is that there exists a reasonably simple mathematical formula if you can draw simple regions in the plane containing only points with a given color.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.