Ask Your Question
0

The function "setTo"about gpumat

asked 2014-03-16 02:16:11 -0500

我干过豪哥 gravatar image

I define GpuMat Img,Mask, and use" Img.setTo(Scalar::all(0),Mask == 0)",but Vs2010 can't complie and report error.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2014-03-16 03:27:00 -0500

Vladislav Vinogradov gravatar image

GpuMat doesn't support expressions like Mask == 0. You have to call plain functions like cv::gpu::bitwise_not:

cv::gpu::bitwise_not(mask, mask);
img.setTo(Scalar::all(0), mask);
edit flag offensive delete link more

Comments

THanks! if GpuMat A ,GpuMat B , int k, A = B > k GpuMat can't support operator.How to do it,can you share you idea?

我干过豪哥 gravatar image我干过豪哥 ( 2014-03-18 09:57:38 -0500 )edit
cv::gpu::compare(B, cv::Scalar::all(k), A, cv::CMP_GT);
Vladislav Vinogradov gravatar imageVladislav Vinogradov ( 2014-03-18 12:29:16 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-03-16 02:16:11 -0500

Seen: 2,274 times

Last updated: Mar 16 '14