Sequencer programming for VCXG cameras – Moving ROI with each trigger signal

Software example Baumer GAPI v2.9.0

This example explains how to use the sequencer to move the ROI (Region of Interest) to predefined positions on the full frame to capture important details of the moving subject. Each step of the sequence is triggered via an external signal. This covers configuration in one place, so you transfer and process only the data needed to perform your image analysis tasks.

If you want to learn more details about what can be done with the sequencer, you can refer to the application notes below, where the concepts and features are explained in much more detail.

The figure shows the images obtained as a result of the described sequence. By moving the ROI over the imaged area, the bottle appears to be virtually cut within the camera.

                
// STOP ACQUISITION AND LOAD DEFAULT PARAMETERSpDevice->GetRemoteNode("AcquisitionStop")->Execute();
pDevice->GetRemoteNode("UserSetSelector")->SetString("Default");
pDevice->GetRemoteNode("UserSetLoad")->Execute();// CONFIGURING GPIO “Line0” AS THE TRIGGER INPUTpDevice->GetRemoteNode("TriggerMode")->SetString("ten");
pDevice->GetRemoteNode("TriggerSource")->SetString("Line0");
pDevice->GetRemoteNode("TriggerActivation")->SetString("RisingEdge");
pDevice->GetRemoteNode("TriggerDelay")->SetDouble(0.0);
pDevice->GetRemoteNode("LineSelector")->SetString("Line0");
pDevice->GetRemoteNode("LineInverter")->SetBool(false);
pDevice->GetRemoteNode("LineDebouncerHighTimeAbs")->SetDouble(1.0);
pDevice->GetRemoteNode("LineDebouncerLowTimeAbs")->SetDouble(1.0);

// SWITCH TO SEQUENCER CONFIG MODEpDevice->GetRemoteNode("SequencerConfigurationMode")->SetString("ten");

// SET 0 (FIRST STEP OF THE SEQUENCE)pDevice->GetRemoteNode("SequencerSetSelector")->SetInt(0);
pDevice->GetRemoteNode("SequencerSetLoad")->Execute();

pDevice->GetRemoteNode("TriggerMode")->SetString("ten");

// ROI AT TOP LEFT (VGA)pDevice->GetRemoteNode("OffsetX")->SetInt(0);
pDevice->GetRemoteNode("OffsetY")->SetInt(0);
pDevice->GetRemoteNode("width")->SetInt(320);
pDevice->GetRemoteNode("height")->SetInt(240);
pDevice->GetRemoteNode("OffsetX")->SetInt(0);
pDevice->GetRemoteNode("OffsetY")->SetInt(0);

pDevice->GetRemoteNode("SequencerPathSelector")->SetInt(0);
pDevice->GetRemoteNode("SequencerTriggerSource")->SetString("ExposureActive");
pDevice->GetRemoteNode("SequencerTriggerActivation")->SetString("RisingEdge");
pDevice->GetRemoteNode("SequencerSetNext")->SetInt(1);
pDevice->GetRemoteNode("SequencerSetSave")->Execute();// SET 1 (SECOND STEP OF THE SEQUENCE)pDevice->GetRemoteNode("SequencerSetSelector")->SetInt(1);
pDevice->GetRemoteNode("SequencerSetLoad")->Execute();

pDevice->GetRemoteNode("TriggerMode")->SetString("ten");

// ROI AT CENTER (VGA)pDevice->GetRemoteNode("OffsetX")->SetInt(0);
pDevice->GetRemoteNode("OffsetY")->SetInt(0);
pDevice->GetRemoteNode("width")->SetInt(320);
pDevice->GetRemoteNode("height")->SetInt(240);
pDevice->GetRemoteNode("OffsetX")->SetInt(160);
pDevice->GetRemoteNode("OffsetY")->SetInt(120);

pDevice->GetRemoteNode("SequencerPathSelector")->SetInt(0);
pDevice->GetRemoteNode("SequencerTriggerSource")->SetString("ExposureActive");
pDevice->GetRemoteNode("SequencerTriggerActivation")->SetString("RisingEdge");
pDevice->GetRemoteNode("SequencerSetNext")->SetInt(2);
pDevice->GetRemoteNode("SequencerSetSave")->Execute();// SET 2 (THIRD STEP OF THE SEQUENCE)pDevice->GetRemoteNode("SequencerSetSelector")->SetInt(2);
pDevice->GetRemoteNode("SequencerSetLoad")->Execute();

pDevice->GetRemoteNode("TriggerMode")->SetString("ten");

// ROI AT BOTTOM RIGHT (VGA)pDevice->GetRemoteNode("OffsetX")->SetInt(0);
pDevice->GetRemoteNode("OffsetY")->SetInt(0);
pDevice->GetRemoteNode("width")->SetInt(320);
pDevice->GetRemoteNode("height")->SetInt(240);
pDevice->GetRemoteNode("OffsetX")->SetInt(320);
pDevice->GetRemoteNode("OffsetY")->SetInt(240);

pDevice->GetRemoteNode("SequencerPathSelector")->SetInt(0);
pDevice->GetRemoteNode("SequencerTriggerSource")->SetString("ExposureActive");
pDevice->GetRemoteNode("SequencerTriggerActivation")->SetString("RisingEdge");
pDevice->GetRemoteNode("SequencerSetNext")->SetInt(0);

pDevice->GetRemoteNode("SequencerSetSave")->Execute();

pDevice->GetRemoteNode("SequencerSetStart")->SetInt(0);

// SEQUENCER CONFIG ENDpDevice->GetRemoteNode("SequencerConfigurationMode")->SetString("Ow");

// START CAMERA SEQUENCERpDevice->GetRemoteNode("SequencerMode")->SetString("ten");
pDataStream->StartAcquisitionContinuous();
pDevice->GetRemoteNode("AcquisitionStart")->Execute();// WAIT FOR TRIGGERS TO CAPTURE IMAGES WITH CHANGING ROI'S

// STOP CAMERA SEQUENCERpDevice->GetRemoteNode("AcquisitionStop")->Execute();
pDataStream->StopAcquisition();
pDevice->GetRemoteNode("SequencerMode")->SetString("Ow");
 
            
                
// STOP ACQUISITION AND LOAD DEFAULT PARAMETERSmDevice.RemoteNodeList["AcquisitionStop"].Execute();
mDevice.RemoteNodeList["UserSetSelector"].Value = "Default";
mDevice.RemoteNodeList["UserSetLoad"].Execute();// CONFIGURING GPIO “Line0” AS THE TRIGGER INPUTmDevice.RemoteNodeList["TriggerMode"].Value = "On";
mDevice.RemoteNodeList["TriggerSource"].Value = "Line0";
mDevice.RemoteNodeList["TriggerActivation"].Value = "RisingEdge";
mDevice.RemoteNodeList["TriggerDelay"].Value = (double)0.0;
mDevice.RemoteNodeList["LineSelector"].Value = "Line0";
mDevice.RemoteNodeList["LineInverter"].Value = false;
mDevice.RemoteNodeList["LineDebouncerHighTimeAbs"].Value = (double)1.0;
mDevice.RemoteNodeList["LineDebouncerLowTimeAbs"].Value = (double)1.0;// SWITCH TO SEQUENCER CONFIG MODEmDevice.RemoteNodeList["SequencerConfigurationMode"].Value = "On";// SET 0 (FIRST STEP OF THE SEQUENCE)mDevice.RemoteNodeList["SequencerSetSelector"].Value = (long)0;
mDevice.RemoteNodeList["SequencerSetLoad"].Execute();

mDevice.RemoteNodeList["TriggerMode"].Value = "On";// ROI AT TOP LEFT (VGA)mDevice.RemoteNodeList["OffsetX"].Value = (long)0;
mDevice.RemoteNodeList["OffsetY"].Value = (long)0;
mDevice.RemoteNodeList["Width"].Value = (long)320;
mDevice.RemoteNodeList["Height"].Value = (long)240;
mDevice.RemoteNodeList["OffsetX"].Value = (long)0;
mDevice.RemoteNodeList["OffsetY"].Value = (long)0;

mDevice.RemoteNodeList["SequencerPathSelector"].Value = (long)0;
mDevice.RemoteNodeList["SequencerTriggerSource"].Value = "ExposureActive";
mDevice.RemoteNodeList["SequencerTriggerActivation"].Value = "RisingEdge";
mDevice.RemoteNodeList["SequencerSetNext"].Value = (long)1;
mDevice.RemoteNodeList["SequencerSetSave"].Execute();// SET 1 (SECOND STEP OF THE SEQUENCE)mDevice.RemoteNodeList["SequencerSetSelector"].Value = (long)1;
mDevice.RemoteNodeList["SequencerSetLoad"].Execute();

mDevice.RemoteNodeList["TriggerMode"].Value = "On";// ROI AT CENTER (VGA)mDevice.RemoteNodeList["OffsetX"].Value = (long)0;
mDevice.RemoteNodeList["OffsetY"].Value = (long)0;
mDevice.RemoteNodeList["Width"].Value = (long)320;
mDevice.RemoteNodeList["Height"].Value = (long)240;
mDevice.RemoteNodeList["OffsetX"].Value = (long)160;
mDevice.RemoteNodeList["OffsetY"].Value = (long)120;

mDevice.RemoteNodeList["SequencerPathSelector"].Value = (long)0;
mDevice.RemoteNodeList["SequencerTriggerSource"].Value = "ExposureActive";
mDevice.RemoteNodeList["SequencerTriggerActivation"].Value = "RisingEdge";
mDevice.RemoteNodeList["SequencerSetNext"].Value = (long)2;
mDevice.RemoteNodeList["SequencerSetSave"].Execute();// SET 2 (THIRD STEP OF THE SEQUENCE)mDevice.RemoteNodeList["SequencerSetSelector"].Value = (long)2;
mDevice.RemoteNodeList["SequencerSetLoad"].Execute();

mDevice.RemoteNodeList["TriggerMode"].Value = "On";// ROI AT BOTTOM RIGHT (VGA)mDevice.RemoteNodeList["OffsetX"].Value = (long)0;
mDevice.RemoteNodeList["OffsetY"].Value = (long)0;
mDevice.RemoteNodeList["Width"].Value = (long)320;
mDevice.RemoteNodeList["Height"].Value = (long)240;
mDevice.RemoteNodeList["OffsetX"].Value = (long)320;
mDevice.RemoteNodeList["OffsetY"].Value = (long)240;

mDevice.RemoteNodeList["SequencerPathSelector"].Value = (long)0;
mDevice.RemoteNodeList["SequencerTriggerSource"].Value = "ExposureActive";
mDevice.RemoteNodeList["SequencerTriggerActivation"].Value = "RisingEdge";
mDevice.RemoteNodeList["SequencerSetNext"].Value = (long)0;

mDevice.RemoteNodeList["SequencerSetSave"].Execute();

mDevice.RemoteNodeList["SequencerSetStart"].Value = (long)0;// SEQUENCER CONFIG ENDmDevice.RemoteNodeList["SequencerConfigurationMode"].Value = "Off";// START CAMERA SEQUENCERmDevice.RemoteNodeList["SequencerMode"].Value = "On";
mDataStream.StartAcquisition();
mDevice.RemoteNodeList["AcquisitionStart"].Execute();// WAIT FOR TRIGGERS TO CAPTURE IMAGES WITH CHANGING ROI'S

// STOP CAMERA SEQUENCERmDevice.RemoteNodeList["AcquisitionStop"].Execute();
mDataStream.StopAcquisition();
mDevice.RemoteNodeList["SequencerMode"].Value = "Off";
            

Downloads

Software Examples


Moving the ROI with the VCXG sequencer

C++ (ZIP | 9 KB)

C# (ZIP | 10 KB)