Ask Your Question
1

uniform lbp using lut Func.

asked 2017-03-11 02:15:19 -0600

sabra gravatar image

updated 2017-03-11 02:23:52 -0600

hi I'm new to opencv functions,so please excuse me if I'm asking a simple question. im trying to extract less feature from pics to use in lbp.facerecognizer() i want to put trained lbp model into my code so i need to reduce any thing like this

question 2: if i convert my images using below code,then trained a model using these images, is this right way or should add changes to lbp.facerecognizer function of opencv?

static int uniform[256] = // for exactly 8 bits / neighbours !
{  
    0,1,2,3,4,58,5,6,7,58,58,58,8,58,9,10,11,58,58,58,58,58,58,58,12,58,58,58,13,58,
    14,15,16,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,17,58,58,58,58,58,58,58,18,
    58,58,58,19,58,20,21,22,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,
    58,58,58,58,58,58,58,58,58,58,58,58,23,58,58,58,58,58,58,58,58,58,58,58,58,58,
    58,58,24,58,58,58,58,58,58,58,25,58,58,58,26,58,27,28,29,30,58,31,58,58,58,32,58,
    58,58,58,58,58,58,33,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,34,58,58,58,58,
    58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,
    58,35,36,37,58,38,58,58,58,39,58,58,58,58,58,58,58,40,58,58,58,58,58,58,58,58,58,
    58,58,58,58,58,58,41,42,43,58,44,58,58,58,45,58,58,58,58,58,58,58,46,47,48,58,49,
    58,58,58,50,51,52,58,53,54,55,56,57
};


LUT(im,uniform2, im);

error : no suitable constructor exists to convert from "int [256]" to "cv::_InputArray"

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-03-11 02:39:26 -0600

berak gravatar image

if you want to use it with cv::LUT , you need a cv::Mat, not a simple int[] array:

int uniform[256] = {
...
};

Mat out;
Mat lookup(1,256,CV_32S, uniform); // make a Mat from it
LUT(inp,lookup,out);
edit flag offensive delete link more

Comments

@berak i changed my code to your suggestion,my trained model reduced from 6,7 Mb to 6,3 and accuracy is scandal!!!! why?

sabra gravatar imagesabra ( 2017-03-11 05:50:22 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-03-11 02:15:19 -0600

Seen: 210 times

Last updated: Mar 11 '17