OpenCV4Android mathematical operations on Mat objects

asked 2013-12-30 18:05:16 -0500

Fisher gravatar image

updated 2018-01-20 17:15:32 -0500

Hello. I am new to OpenCV4Android. I want to rewrite code from C++ to OpenCV4Android:

{
double meanI = 0.0;
{
    Mat tmp;
    pow(abs(I), alpha, tmp);
    meanI = mean(tmp).val[0];

}
I = I / pow(meanI, 1.0/alpha);

}

{
double meanI = 0.0;
{
    Mat tmp;
    pow(min(abs(I), tau), alpha, tmp);
    meanI = mean(tmp).val[0];
}
I = I / pow(meanI, 1.0/alpha);

}

So I have a problem, because I dont know how to make:
1. abs of mat object -> abs(I)
2. how to divide matrix by DOUBLE -> I = I / pow(meanI, 1.0/alpha)


Can anyone help me with that?


Ad.1 I have no clue how to do it by function
Ad.2 I tried sth like that: Core.divide( Math.pow(meanI, 1.0/alpha), I, I) is that correct?

edit retag flag offensive close merge delete