Ask Your Question
0

accuracy of uniform lbp is scandal

asked 2017-03-13 00:58:24 -0600

sabra gravatar image

updated 2017-03-13 03:34:07 -0600

hi, im using opencv func for uniform lbp (LUT ) and accuracy of recognition get worth but i read that this will not happen,what am i wrong?

read images

resize each image

lut(images,lookup table,images);

train images detection

edit retag flag offensive close merge delete

Comments

you'll probably have to show us, what you're doing.

and yes, slight decrease in accuracy is expected.

berak gravatar imageberak ( 2017-03-13 01:54:09 -0600 )edit

@berak : i edited it,if you need more details, i must first sort my code :)

sabra gravatar imagesabra ( 2017-03-13 03:35:19 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-03-13 03:39:33 -0600

berak gravatar image

updated 2017-03-13 03:52:56 -0600

yea, cleaning up is always a good idea..

but already from here: you'd have to apply the lut to the LBP image, not the grayscale input !

(which also means, you'd have to interfere with the library code !)

e.g. it should go here here , then also the number of histogram bins should be adapted here from 256 to 59

(this is the actual feature reduction)

edit flag offensive delete link more

Comments

tnx alot but in second link what is your mean?

 static_cast<int>(std::pow(2.0, static_cast<double>(_neighbors))),

this result is 2^8 so

should i set it to static_cast<int>(59) ?

sabra gravatar imagesabra ( 2017-03-13 06:18:05 -0600 )edit

you probably don't need the cast, but yes, to 59.

berak gravatar imageberak ( 2017-03-13 06:22:24 -0600 )edit

@berak i did all but : assertion failed : (lutcn == cn || lutcn == 1) && lut.total() == 256 && lut.isContinuous() && (src.depth() == CV_8U || src.depth() == CV_8S) in function LUT

sabra gravatar imagesabra ( 2017-03-14 00:59:30 -0600 )edit

i cheked like below

        Mat lookup(1,256,CV_32S, uniform); // make a Mat from it
        bool x=lookup.isContinuous();
        int cnn=lookup.channels();
        int y=lookup.total();
        int z= lbp_image.depth();
            LUT(lbp_image,lookup,lbp_image);// =====> error appear here

        Mat p = spatial_histogram(
                lbp_image, /* lbp_image */
                static_cast<int>(59), /* number of possible patterns */
                _grid_x, /* grid size x */
                _grid_y, /* grid size y */
                true);

x--> true

cnn-->1

y-->256

z-->4

@berak

sabra gravatar imagesabra ( 2017-03-14 01:16:43 -0600 )edit

yea, sorry. problem is here <--> (src.depth() == CV_8U || src.depth() == CV_8S)

berak gravatar imageberak ( 2017-03-14 02:35:19 -0600 )edit

so? what can i do? please @berak

sabra gravatar imagesabra ( 2017-03-14 02:48:11 -0600 )edit

make dst uchar, also here

ofc. that means, you have to stick wit exactly 8 neighbours. (do you understand, why ?)

berak gravatar imageberak ( 2017-03-14 02:55:12 -0600 )edit

how make dst uchar? what changes are need? sorry im inexperienced @berak

sabra gravatar imagesabra ( 2017-03-14 03:14:42 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-03-13 00:58:24 -0600

Seen: 324 times

Last updated: Mar 13 '17