Ask Your Question
0

background substraction with CV_16UC1

asked 2013-10-04 15:04:50 -0500

leRoss gravatar image

updated 2013-10-21 13:15:38 -0500

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 ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-10-21 13:35:35 -0500

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);
edit flag offensive delete link more

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 ( 2013-10-21 15:05:46 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-10-04 15:04:50 -0500

Seen: 291 times

Last updated: Oct 21 '13