Sumedha Vangury
Sumedha Vangury

Reputation: 683

error in using sqrt function for unit

I am executing this code which contains the following line of code:

sf_den=sqrt(sf_den+a*b);  

But I am getting the following error,I cannot figure out why

Undefined function or method 'sqrt' for input arguments of type 'uint8'.

Value of a is 0 and b is <171x210x3 uint8>
What should i do?

Upvotes: 3

Views: 10572

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272647

Convert the data to a type that is supported by sqrt. For example:

sf_den = sqrt(double(sf_den + a*b));

Upvotes: 9

Related Questions