How to divide a mat matrix by integer
hi, i want to divide a mat variable of 5x5 ones matrix by integer 25 in android opencv. i have done this in c++. the code is as follows :-
c++ code :-
float kernel[5][5] = {{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1}};
Mat ker = Mat(5, 5, CV_32F, &kernel); // float data == CV_32F Mat
ker=ker/25;
android code :-
Mat kernel = new MatOfInt(
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1
);
Core.divide(25, kernel, kernel);
both of them gives different result. as i want result achieved from c++ code.
thanks !!
now, what happens, if you divide an integer by 25 ?
it show error
please learn to format the code in the questions (mark it with the mouse, and press the 10101 button)
what is 10101 button in keybord
when you make a question, / edit it, you have some buttons there ..
(on this webpage, not on your keyboard, sorry)