cv.jit.blobs.recon's reference matrix differs from cv.jit.learn's

flim's icon

hi!

even with basic shapes I end up failing. (in this case I train cv.jit.learn with a simple circle.) all I get when using cv.jit.blobs.recon is some flickering, a hint of my circle (my only success after minutes of responselessness)

cv.jit.learn's compare mode gives my satisfying results, but when feeding cv.jit.blobs.recon the whole thing turns out quite nerve-wracking. :) (though these initial steps shouldn't be that difficult)

what I noticed right away - cv.jit.learn's and cv.jit.blobs.recon's initial matrix are not congruent:

cv.jit.learn's help file starts off with:
[cv.jit.grab] -> [jit.rgb2luma] -> [cv.jit.threshold]

whilst cv.jit.blobs.recon works with:
[cv.jit.grab] -> [jit.rgb2luma] -> [jit.op]

the picture both objects work with differs. could that be the reason? otherswise I might just not be a match for cv.jit.learn/cv.jit.blobs.recon. either that or my patience is leading me to a dead end :)

I've tried adjusting (beginning with [cv.jit.grab] -> [jit.rgb2luma] -> [jit.op] on both objects), but it just won't work.

cheers!

-jonas

flim's icon

overview :)

Max Patch
Copy patch and select New From Clipboard in Max.

Jean-Marc Pelletier's icon

Hi,

It looks like the way the help file is written causes some display problems when there is only one blob. The output measurement from cv.jit.blobs.recon is correct, though. You can compare and send the same matrix to both cv.jit.learn and cv.jit.blobs.recon and they will report the same distance.

The problem is with how the map matrix for jit.charmap is built. I'll make a note to fix it for the next release, but the problem only affect the display, not the actual measurement.

Jean-Marc

flim's icon

ok. thanks, jean-marc!

as I'm merely dealing with a circle, I thought of manually fooling around with what cv.jit.blobs.moments (respectively cv.jit.moments) gives me on my shape. maybe I get more reliable results feeding cv.jit.blobs.recon directly with moments' output rather than training cv.jit.learn (which I doubt)

all the best

-jonas

flim's icon

I figured out quite well in the end, using cv.jit.learn after all.. my combination of impatience & not focussing/reducing/adapting my reference matrix to the shape of desire paid its toll..

after having gotten rid of superfluous background (instead of drawing on my complete webcam feed for training issues) it turned out to work quite reliable.. what a surprise.

have a nice weekend everyone

-jonas

Max Patch
Copy patch and select New From Clipboard in Max.