Fast image rows compare with 100 templates in C++, openCV -


after transformations thresholded image, matrix more 1000 rows , more 1000 cols, this:

... ...1,4,2,4,5,1,3,7.... ...2,5,3,4,6,7,2,1.... ...5,3,1,7,3,3,4,6....                   .... etc.. 

i need go each row , compare each row near 100 templates, find out: "can find 1 of 100 templates in row or not?"

template, example: 2,4,5,1;(true 1st row of example) 1,7,3,3 (true 3 row of example)

i use next algorithm go rows:

for (i=0; i<image.rows; ++i)     {       pixel = image.ptr<uchar>(i);       (j=0; j<image.cols; ++j)        {           transformations 255,255,0,255 1,4,2... example on top...        } 

here add current row in <vector> using <insert> , compare other template , using:

search(vector.begin(), vector.end(), temp.begin(), temp.end()) != vector.end(); 

i getting compare result slow. want have ability work fullhd video, works slow work inside video flow! result need sequence of 100 found templates in list top bottom.

what can advise make compare faster than<vector> compare, maybe using opencv libs, please?


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -