Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C++
#include <iostream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
int method(cv::Size var1){
    int a,b,c = var1.area();
    return a,b,c;
}

int main(){
  cv::Size var1(300,150);
  int ret = method(var1);

  return ret;
}
Also please tell me what does area() return. Why does area() return three variables?

What I have tried:

I tried googling but didnt find any solution there. Also openCV documentation is not well written.
Posted
Updated 14-Jul-19 21:37pm
v2
Comments
KarstenK 15-Jul-19 3:38am    
Try to think: "What does 'area' means when you have a 'size'?" ;-)

1 solution

Start reading a tutorial, for instance: OpenCV-Python Tutorials — OpenCV-Python Tutorials 1 documentation[^].

Quote:
Also please tell me what does area() return. Why does area() return three variables?
It doesn't. As matter of fact, it returns a double (see, for instance Size[^]).
In
C++
int method(cv::Size var1){
int a,b,c = var1.area();
return a,b,c; }

a, b are irrelevant you may (should) remove them (see the 'comma operator' section in Other operators - cppreference.com[^]).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900