Ask Your Question
0

EMD-L1 only supports 1-dimensional case?

asked 2015-01-01 20:55:09 -0600

ak gravatar image

Does EMD-L1 functions only support 1-dimensional CV::Mat? If so, current version doesn't calculate EMD-L1 between two images because a image is 2-dimensional matrix.

In modules/shape/emdL1.cpp, the second argument of initBase is fixed to 1 although I think it should be sig1.cols (the number of the second dimension).

if(!initBaseTrees(sig1.rows, 1))
    return -1;
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-01-02 13:20:20 -0600

berak gravatar image

well, you're half right, - it supports only 1dim arrays.

and you're probably half wrong, too, - it is not meant to be used with images at all .

look at the docs, "a single column floating-point matrix. Each row is the value of the histogram in each bin." - so it's meant to compare histograms, not images.

(if you want to compare images with the L1 norm, that's a straight double dist = norm(a,b,NORM_L1); )

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-01-01 20:55:09 -0600

Seen: 111 times

Last updated: Jan 02 '15