Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mat square(const Mat &in) {

size_t n = in.total(); size_t ns = (size_t)sqrt(double(size_t)n); CV_Assert(ns*ns == n); //make sure, there was no rounding. return in.reshape(0, ns); }

Mat square(const Mat &in)
{

{ size_t n = in.total(); in.total(); //count of all elements size_t ns = (size_t)sqrt(double(size_t)n); (size_t)sqrt(double(size_t)n); // squared CV_Assert(ns*ns == n); //make sure, there was no rounding. return in.reshape(0, ns); }

}
Mat square(const Mat &in)
{
    size_t n = in.total(); //count of all elements
    size_t ns = (size_t)sqrt(double(size_t)n); (size_t)sqrt(double(n));   // squared
    CV_Assert(ns*ns == n); //make sure, there was no rounding.
    return  in.reshape(0, ns);
}