Ask Your Question

Revision history [back]

there is no problem you swap parameter 0 and 65535 :

Mat ucm = (Mat_<ushort>(2, 2) << 1, 2, 3, 4);
cout << ucm << endl;
cv::normalize(ucm, ucm, 65535, 0, cv::NORM_L2, CV_16UC1);
cout<<ucm<<endl;

and result :

[1, 2;
 3, 4]
[11965, 23930;
 35895, 47860]
11965 47860

47860 =4* 65535/sqrt(1+22+33+4*4)

there is no problem you swap parameter 0 and 65535 :

Mat ucm = (Mat_<ushort>(2, 2) << 1, 2, 3, 4);
cout << ucm << endl;
cv::normalize(ucm, ucm, 65535, 0, cv::NORM_L2, CV_16UC1);
cout<<ucm<<endl;

and result :

[1, 2;
 3, 4]
[11965, 23930;
 35895, 47860]
11965 47860

47860 =4* 65535/sqrt(1+22+33+4*4)65535/sqrt(1+2 * 2+3 * 3+4 * 4)