MATLAB: Do corner point detection functions return the Location of the corner metrics as spatial coordinates

Computer Vision Toolboxcoordinate systemscorner locationscorner metriccornerpointsImage Processing Toolboxpixel coordinatesspatial coordinates

When using cornerPoints() or detectMinEigenFeatures() methods in MATLAB, the output returns the Location (K x 2 matrix), Metric (K x 1) matrix and the Count (K), where I am supposing K to be the number of corner points detected. The Location matrix seems to return the spatial coordinates and not the pixel coordinates (Referring to the Documentation on Coordinate Systems ). I wanted to know a way of understanding this better and being able to convert these spatial coordinates to pixel coordinates of the Image. The former method cornermetric() returned a matrix of corner points equal to the size of the image and hence getting the pixel indices was easy. All the recent corner detection (or keypoint detection) methods return the Location of cornerpoints in I suppose Spatial / Axes coordinates. I needed clarification on this point.
Thank you.

Best Answer

After a bit of a struggle I finally found one solution at the moment. For this I had to run the Shi-Tomasi ( detectMinEigenFeatures()) method in OpenCV3 Python https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_shi_tomasi/py_shi_tomasi.html, I found that they have converted the real values of the location coordinates obtained into integer values. Thus, applying the same method (used uint16), I was able to convert the real values of the Location coordinates to discrete values.
Example code:
img = imread('img1.jpg');
corners = detectMinEigenFeatures(img);
cornersLoc = uint16(corners.Location);
The results were verified with the coordinates obtained using the cornermetric() method (previously used in the earlier versions of MATLAB). Similarly, this can be tried with the other keypoint detection methods.
Related Question