access the element of vector point2f c++

#include <iostream>
#include <vector>
#include <opencv2/core.hpp>

int main() {
    std::vector<cv::Point2f> vecOfPoints;

    // Accessing the first element of the vector
    cv::Point2f firstElement = vecOfPoints[0];

    // Accessing the x-coordinate of the first element
    float xCoord = firstElement.x;

    // Accessing the y-coordinate of the first element
    float yCoord = firstElement.y;

    // Printing the x and y coordinates
    std::cout << "X-coordinate: " << xCoord << std::endl;
    std::cout << "Y-coordinate: " << yCoord << std::endl;

    return 0;
}