0

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.

lakshmi
  • 43
  • 1
  • 7

2 Answers2

0

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.

Augmented Jacob
  • 1,567
  • 19
  • 45
  • Hi, Thanks a lot for your information. Suppose if we scan any object , can we get the name and other details of the object through vuforia augmented reality and can we load dynamic models?Please suggest me any tutorials. – lakshmi Apr 29 '15 at 09:55
  • Vuforia has an app called Vuforia Object Scanner, that enables you to scan any object 360 and use it in the app. But this cannot be done dynamically. It should be scanned during the development of the app. There are no tutorials but you can go ahead and check the the Vuforia site for any info ,although it maybe horrible. Any questions can always be asked on SO as a separate question. :) Good luck! – Augmented Jacob Apr 30 '15 at 01:59
0

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.

Niels
  • 1,340
  • 2
  • 15
  • 32