#includeint main() { cv::IntPoint point(10, 20); std::cout << point.x << ", " << point.y << std::endl; // Output: 10, 20 return 0; }
#includeIn this example, two IntPoint objects are created with x and y values. Then, various arithmetic operations like addition and subtraction are performed on these objects. The resulting IntPoint objects are then printed to the console. As mentioned earlier, IntPoint is a part of the OpenCV library. Hence, the package/library to be installed to use IntPoint in C++ is OpenCV.int main() { cv::IntPoint point1(10, 20); cv::IntPoint point2(5, 10); cv::IntPoint point3 = point1 + point2; // Addition cv::IntPoint point4 = point1 - point2; // Subtraction std::cout << point3.x << ", " << point3.y << std::endl; // Output: 15, 30 std::cout << point4.x << ", " << point4.y << std::endl; // Output: 5, 10 return 0; }