Ask Your Question

Revision history [back]

How to find the id/index of aruco marker based on its relative position?

This is the image I want to capture with my camera(without the colourful box of course).

image description

I want to find the index of aruco marker in the green box. Each of the green box is either at the top, right, bottom, left of the marker in the red box.

When I detect the marker, I only get a list of marker values. How do I pinpoint which marker is where?

Thanks.

How to find the id/index of aruco marker based on its relative position?

This is the image I want to capture with my camera(without the colourful box of course).

image description

I want to find the index of aruco marker in the green box. Each of the green box is either at the top, right, bottom, left of the marker in the red box.

When I detect the marker, I only get a list of marker values. How do I pinpoint which marker is where?

How do I get the coordinate in 2d and 3d?

Thanks.

How to find the id/index of aruco marker based on its relative position?

This is the image I want to capture with my camera(without the colourful box of course).

image description

I want to find the index of aruco marker in the green box. Each of the green box is either at the top, right, bottom, left of the marker in the red box.box. The marker in the blue box should not be detected.

When I detect the marker, I only get a list of marker values. How do I pinpoint which marker is where?

How do I get the coordinate in 2d and 3d?

Thanks.

How to find the id/index of aruco marker based on its relative position?

This is the image I want to capture with my camera(without the colourful box of course).

image description

I want to find the index of aruco marker in the green box. Each of the green box is either at the top, right, bottom, left of the marker in the red box. The marker in the blue box should not be detected.

When I detect the marker, I only get a list of marker values. How do I pinpoint which marker is where?

How do I get the coordinate in 2d and 3d?

This is my current progress(simplified). As of now, Im able to draw the axis(have correct camera calibration parameters).

        try
        {
            Aruco.detectMarkers(image, markerDictionary, corners, ids, parameters, rejectedImgPoints);
        }
        catch (Exception ex)
        {
            Log.e(TAG, "detectMarkers Exception : " + ex.getMessage());
        }

        if (corners.size() > 0)
        {
            try
            {
                Aruco.drawDetectedMarkers(image, corners, ids);
            }
            catch (Exception ex)
            {
                Log.e(TAG, "drawDetectedMarkers Exception : " + ex.getMessage());
            }

            if (isCalibrationParametersAvailable)
            {
                try
                {
                    Aruco.estimatePoseSingleMarkers(corners, markerLength, cameraMatrix, distCoeffs, rvecs, tvecs);
                } catch (Exception ex)
                {
                    Log.e(TAG, "estimatePoseSingleMarkers Exception : " + ex.getMessage());
                }

                try
                {
                    for (int i = 0; i<ids.toArray().length; i++)
                    {
                        Aruco.drawAxis(image, cameraMatrix, distCoeffs, rvecs.row(i), tvecs.row(i), markerLength * 0.5f);
                    }
                } catch (Exception ex)
                {
                    Log.e(TAG, "drawAxis Exception : " + ex.getMessage());
                }
            }
        }

Thanks.

How to find the id/index of aruco marker based on its relative position?

This is the image I want to capture with my camera(without the colourful box of course).

image description

I want to find the index of aruco marker in the green box. Each of the green box is either at the top, right, bottom, left of the marker in the red box. The marker in the blue box should not be detected.

When I detect the marker, I only get a list of marker values. How do I pinpoint which marker is where?

How do I get the coordinate in 2d and 3d?

This is my current progress(simplified). As of now, Im able to draw the axis(have correct camera calibration parameters).

        try
        {
            Aruco.detectMarkers(image, markerDictionary, corners, ids, parameters, rejectedImgPoints);
        }
        catch (Exception ex)
        {
            Log.e(TAG, "detectMarkers Exception : " + ex.getMessage());
        }

        if (corners.size() > 0)
        {
            try
            {
                Aruco.drawDetectedMarkers(image, corners, ids);
            }
            catch (Exception ex)
            {
                Log.e(TAG, "drawDetectedMarkers Exception : " + ex.getMessage());
            }

            if (isCalibrationParametersAvailable)
            {
                try
                {
                    Aruco.estimatePoseSingleMarkers(corners, markerLength, cameraMatrix, distCoeffs, rvecs, tvecs);
                } catch (Exception ex)
                {
                    Log.e(TAG, "estimatePoseSingleMarkers Exception : " + ex.getMessage());
                }

                try
                {
                    for (int i = 0; i<ids.toArray().length; i++)
                    {
                        Aruco.drawAxis(image, cameraMatrix, distCoeffs, rvecs.row(i), tvecs.row(i), markerLength * 0.5f);
                    }
                } catch (Exception ex)
                {
                    Log.e(TAG, "drawAxis Exception : " + ex.getMessage());
                }
            }

            // centerMarkerIndex is the ids index of marker in the red box
            // targetMarkerValue is the marker value in the green box
            // ids contains the list of detected markers
            int idTopIndex = GetIndexOfTop(centerMarkerIndex, targetMarkerValue, ids)
        }

Thanks.

How to find the id/index of aruco marker based on its relative position?

This is the image I want to capture with my camera(without the colourful box of course).

image description

I want to find the index of aruco marker in the green box. Each of the green box is either at the top, right, bottom, left of the marker in the red box. The marker in the blue box should not be detected.

When I detect the marker, I only get a list of marker values. How do I pinpoint which marker is where?

How do I get the coordinate in 2d and 3d?

This is my current progress(simplified). As of now, Im able to draw the axis(have correct camera calibration parameters).parameters). My development is in Java and I use Aruco from OpenCv contrib.

        try
        {
            Aruco.detectMarkers(image, markerDictionary, corners, ids, parameters, rejectedImgPoints);
        }
        catch (Exception ex)
        {
            Log.e(TAG, "detectMarkers Exception : " + ex.getMessage());
        }

        if (corners.size() > 0)
        {
            try
            {
                Aruco.drawDetectedMarkers(image, corners, ids);
            }
            catch (Exception ex)
            {
                Log.e(TAG, "drawDetectedMarkers Exception : " + ex.getMessage());
            }

            if (isCalibrationParametersAvailable)
            {
                try
                {
                    Aruco.estimatePoseSingleMarkers(corners, markerLength, cameraMatrix, distCoeffs, rvecs, tvecs);
                } catch (Exception ex)
                {
                    Log.e(TAG, "estimatePoseSingleMarkers Exception : " + ex.getMessage());
                }

                try
                {
                    for (int i = 0; i<ids.toArray().length; i++)
                    {
                        Aruco.drawAxis(image, cameraMatrix, distCoeffs, rvecs.row(i), tvecs.row(i), markerLength * 0.5f);
                    }
                } catch (Exception ex)
                {
                    Log.e(TAG, "drawAxis Exception : " + ex.getMessage());
                }
            }

            // centerMarkerIndex is the ids index of marker in the red box
            // targetMarkerValue is the marker value in the green box
            // ids contains the list of detected markers
            int idTopIndex = GetIndexOfTop(centerMarkerIndex, targetMarkerValue, ids)
        }

Thanks.