Ask Your Question
0

background substraction with CV_16UC1

asked Oct 4 '13

leRoss gravatar image

updated Oct 21 '13

With Openni I want to use the Depthmap who is in CV_16UC1 and apply the background substracter to find the background pixels.

The background cv::BackgroundSubtractorMOG seems to accept only CV_8U images.

Is there a way to make it work with CV_16U images ?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Oct 21 '13

Moster gravatar image

You will need to convert your image to 8 bit.

So, try this:

Mat input8bit;
input16bit.convertTo(input8bit, CV_8U, 1.0/256);
Preview: (hide)

Comments

I will loose some precision that way.

Someone told me that if I remove the ASSERT that validate if the CV_U8 images it worked for them before. ( I have to recompile OpenCV)

I will try it and post my results here

leRoss gravatar imageleRoss (Oct 21 '13)edit

Question Tools

Stats

Asked: Oct 4 '13

Seen: 450 times

Last updated: Oct 21 '13