How to create a Scalar with variable number of channels?
I want to create a Scalar which has a variable(integer) number of channels, hopefully all the channels being 0.
int channels = 2;
cv::Scalar(...); //Create Scalar with "channels" number of channels, all with the value of 0
Did you try all()?
From what I've tested myself, it returns a 4 channel scalar with all elements set to a given value (which I would set to 0)