0
votes

I need to implement image recognition in real time. So I have tried metaio SDK for Augmented reality. In Metaio SDK I have used extended image tracking. But through that, only one image and text to that image can be added in static. So that if I scan that image, I can get the text. How can we achieve this dynamically for object recognition through Augmented Reality way. Are there any other SDK's(trial versions) that supports object recognition and 3D tracking.

Help is highly appreciable.

Thanks in advance, laxmi.

2

2 Answers

0
votes

Well, I don't know about Metaio, but Vuforia has this feature you seek.

Vuforia has this concept of User-defined targets. You can download the Vuforia SDK or Unity extension of Vuforia ot do so.

I personally use Vuforia Unity and the ARCamera from there just needs to be changed so that it fits the User Defined settings.

After that you simply need to add this script that allows access to the camera Images as follows:

using UnityEngine;
using System.Collections;
public class CameraImageAccess : MonoBehaviour 
{
    private Image.PIXEL_FORMAT m_PixelFormat = Image.PIXEL_FORMAT.RGB888;
    private bool m_RegisteredFormat = false;
    private bool m_LogInfo = true;
    void Start()
    {
        QCARBehaviour qcarBehaviour = (QCARBehaviour) FindObjectOfType(typeof(QCARBehaviour));
        if (qcarBehaviour)
        {
            qcarBehaviour.RegisterTrackablesUpdatedCallback(OnTrackablesUpdated);
        }
    }
    public void OnTrackablesUpdated()
    {
        if (!m_RegisteredFormat)
        {
            CameraDevice.Instance.SetFrameFormat(m_PixelFormat, true);
            m_RegisteredFormat = true;
        }
        if (m_LogInfo)
        {
            CameraDevice cam = CameraDevice.Instance;
            Image image = cam.GetCameraImage(m_PixelFormat);
            if (image == null)
            {
                Debug.Log(m_PixelFormat + " image is not available yet");
            }
            else
            {
                string s = m_PixelFormat + " image: \n";
                s += "  size: " + image.Width + "x" + image.Height + "\n";
                s += "  bufferSize: " + image.BufferWidth + "x" + image.BufferHeight + "\n";
                s += "  stride: " + image.Stride;
                Debug.Log(s);
                m_LogInfo = false;
            }
        }
    }

If you're planning to use the Vuforia SDK instead then you should Use the image class so works much like the native version.

  • Register for the desired image format using the CameraDevice.SetFrameFormat method: CameraDevice.Instance.SetFrameFormat(Image.PIXEL_FORMAT.RGB888, true);

  • Call this method after QCARBehaviour has a chance to run its Start method.

  • Use the Unity script-ordering feature, or do this once in an Update callback.
  • Retrieve the image using the CameraDevice.GetCameraImage method.
  • Take this action from the ITrackerEventHandler.OnTrackablesUpdated callback. That way you can ensure that you retrieve the latest camera image that matches the current frame.
  • Always make sure that the camera image is not null, since it can take a few frames for the image to become available after registering for an image format.

Thumbs up, if this was helpful.

0
votes

Take a look at ARtoolkit (open source), which can recognize and track your own images (So only 2d surfaces, not 3d objects) using Natural Feature Tracking.

Another alternative is OpenCV, which is a huge open source computer vision library.