Ask Your Question
0

In the Histogram Cost Extractor module, what does the values returned by buildcostMatrix function signify?

asked 2017-05-29 23:49:50 -0600

lohachan0108 gravatar image

updated 2017-05-30 01:39:46 -0600

I am using buildcostMatrix function and passing it 2 arguments which are the descriptors of two images. I am getting a matrix of double. But it is very huge and therefore hard to comprehend. Can anyone please explain how to make sensible information out of the huge matrix which is returned by the function?

void buildCostMatrix (InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-11-08 13:42:38 -0600

This computes a matrix of pair-wise distances between all pairs of rows of descriptors1 and descriptors2. So costMatrix shape should be (descriptors1.rows, descriptors2.rows) and costMatrix(i,j) = distance(descriptors1, descriptors2) where distance is specific to the histogram cost you chose (L2, chi ...).

Notice that the buildCostMatrix normalizes the rows before computing the distance which may be something you do not want.

You can find the computation details here: https://github.com/opencv/opencv_cont...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-05-29 23:49:50 -0600

Seen: 200 times

Last updated: May 30 '17