Ask Your Question
0

why local binary pattern change size of image?

asked Aug 13 '13

bkshn gravatar image

updated Aug 13 '13

i use local binary pattern on an image in size 680-1024, but the calculated LBP image is in the size of 678-1022. I want to use LBP image in another program but because of this modified size , it return an error. Could you help me why size of image is changed?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Aug 13 '13

This is actually normal. LBP calculate a value for each pixel based on the LBP theory, which is based on the surrounding pixel values, 1 pixel layer around the investigated pixel. Since however edge pixels do not have neighbours outside of the image scope, the LBP value isn't calculated. This means that you loose 1 row of pixels on top and bottom, and 1 column of pixels at right and left side. Hope this makes it more clear.

So it all depends on how you define your LBP region for calculation.

Preview: (hide)

Comments

1

You can circumvent the problem by making your image one-pixel larger before computing the LBP-image using copyMakeBorder, e.g. : cv::copyMakeBorder(_img, img, 1, 1, 1, 1, cv::BORDER_REPLICATE);

Guanta gravatar imageGuanta (Aug 13 '13)edit

Actually that is true, but don't you create 'wrong' pixels then? I guess for LBP this isn't that bad however ...

StevenPuttemans gravatar imageStevenPuttemans (Aug 13 '13)edit

Yes, you'll get some LBP-patterns which are not that distinctive, but they would still contain some information from the non-wrapped side (maybe BOARDER_WRAP would thus be better). In general, I would just take the smaller image - just wanted to give @bkshn a possible solution to his problem.

Guanta gravatar imageGuanta (Aug 13 '13)edit

Question Tools

1 follower

Stats

Asked: Aug 13 '13

Seen: 183 times

Last updated: Aug 13 '13