Example #1
0
/** Return the handle to a collection of identified xpoints by the most recent processed frame. ?? */
mtHandle XPoints::detectedXPoints(MCamera *cam)
{
	mtHandle identifiedHandle = Collection_New();
	mtHandle camHandle = NULL;
	if (cam != NULL)
  {
		camHandle = cam->Handle();
	}
	XPoints_DetectedXPointsGet(camHandle, identifiedHandle );
	return identifiedHandle;
}
Example #2
0
/** Return a handle to the collection of the identified facets */
int Marker::identifiedFacets(MCamera *cam)
{
	int camHandle;
	if (cam == NULL) {
		camHandle = NULL;
	} else {
		camHandle = cam->Handle();
	}
	int identifiedHandle = Collection_New();
	Marker_IdentifiedFacetsGet(this->m_handle, camHandle, true, identifiedHandle);
	return identifiedHandle;
}
Example #3
0
/** Return the handle to a collection of unidentified vestors by the most recent processed frame. */
int Markers::unidentifiedVectors(MCamera *cam)
{
	int unidentifiedHandle = Collection_New();
	int camHandle;
	if (cam == NULL) {
		camHandle = NULL;
	} else {
		camHandle = cam->Handle();
	}
	Markers_UnidentifiedVectorsGet(camHandle, unidentifiedHandle);
	return unidentifiedHandle;
}
Example #4
0
bool mitk::ClaronInterface::StartTracking()
{
  isTracking = false;
  MTC( Cameras_AttachAvailableCameras(calibrationDir) ); //Connect to camera
  if (Cameras_Count() < 1)
  {
    printf("No camera found!\n");
    return false;
  }

  try
  {
    //Step 1: initialize cameras
    MTC(Cameras_HistogramEqualizeImagesSet(true)); //set the histogram equalizing
    MTC( Cameras_ItemGet(0, &CurrCamera) ); //Obtain a handle to the first/only camera in the array

    MITK_INFO<<markerDir;
    //Step 2: Load the marker templates
    MTC( Markers_LoadTemplates(markerDir) ); //Path to directory where the marker templates are
    printf("Loaded %d marker templates\n",Markers_TemplatesCount());

    //Step 3: Wait for 20 frames
    for (int i=0; i<20; i++)//the first 20 frames are auto-adjustment frames, we ignore them
    {
      MTC( Cameras_GrabFrame(NULL) ); //Grab a frame (all cameras together)
      MTC( Markers_ProcessFrame(NULL) ); //Proces the frame(s) to obtain measurements
    }

    //Step 4: Initialize IdentifiedMarkers and PoseXf
    IdentifiedMarkers = Collection_New();
    PoseXf = Xform3D_New();

    //now we are tracking...

    /* MTHome is not in use. The following code has to be activated if you want to use MTHome!
    //Initialize MTHome
    if ( getMTHome (MTHome, sizeof(MTHome)) < 0 )
    {
    // No Environment
    printf("MTHome environment variable is not set!\n");
    }*/
  }
  catch(...)
  {
    Cameras_Detach();
    printf(" Error while connecting MicronTracker!\n -------------------------------");
    return false;
  }

  isTracking = true;
  return true;
}