Can someone help me to translate this line of code in java?
if (area >= 30 && std::abs(1 - ((double)rect.width / (double)rect.height)) <= 0.2 && std::abs(1 - (area / (CV_PI * std::pow(radius, 2)))) <= 0.2)
What I want to be translated is the std::abs and the CV_PI * std::pow
I've search the net for std::abs equivalent to java and failed to find any. Please help. Wasn't able to search for CV_PI * std::pow since I can't still find the std::abs
Are you serious? Googling "std::abs java" offers this page as first hit
@LorenaGdL: You are wasting everyones time by posting that as comment instead of providing the answer.
@RolandC who is everyone, what the hell are you talking about? Do I have to post an answer just because you say so? 1) I won't answer some lazy user who didn't even do a basic Google search, and 2) this isn't even OpenCV related, it's about basic C++ and Java
@RolandC, please if you have no useful comments then do not add them ... @LorenaGdL is an active and dedictated user supplying tons of answers and solutions for people. It is basically normal that she does not provide solutions to people who are to lazy to use a simple search engine. The guidelines of this forum clearly state that this forum is a two way effort. If that effort is missing at the user posting the question, then you cannot expect us to be eagerly to help.
@StevenPuttemans she, please :P
changed :D
@StevenPuttemans: What's worse? Someone not googling or someone saying google it yourself when the answer is just a few lines. Clearly @Raymond doesn't know how to program. As someone who likes to help others, I read the question only to see that comment by @LorenaGdL. A waste of time. Why does she write at all instead of simply ignoring the user? And regarding "no useful comments", what's her "she, please :P" and your "changed :D" then?
@RolandC I won't engage in an argument because this is not what it's expected in this forum (and that's also why your 1st comment is out of place). Just saying that if the user don't know how to program and/or do a basic search, then I feel answering him is not gonna help at all. What he must do is start by learning basic programming things, and then he must put effort in it before trying others to solve every little hitch he finds. In fact, my "useless" comment has a link to the answer. And also, ignoring the user won't make him aware of what's expected from him here in the forum. If you don't share my vision, that's alright, answer him, but please don't tell me (nor other users here) what I should do. We're all here ...(more)
sorry for this, though I appreciate the help. I just wanted to clarify though that I googled it for a long time and didn't find the answer. Then when I use the keyword provided by LorenaGdL it appears. I will reflect in this action and won't do it again next time. Though I am glad that RolandC helped me out in my question. At first I thought that it was opencv line of code as I am new to opencv and not familiar with C and as I search I wasn't able to find it. Sincerely I apologize for this question and very thankful for the answer.
@RolandC like I said, I am not going to apologise on the way I am organising this forum. There is a reason why OpenCV developers gave us the privilege of managing it, just because they like our style of working and the way we engage with people. As to random useless comments, true, they could be left out, but lets say that 90% of our comments actually help out users, which is much higher then the average answer rate of the average forum user. @Raymond, no sorry needed ... this somewhat exploded due to the reactions, but as long as next time you first put in a little bit of more effort, all will be fine. Welcome to the community!