Implemented Single-Shot but have problems !!! ON HOLD !!!
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
!!!Please IGNORE THIS THREAD UNTIL FURTHER NOTICE
I may have found the problem elsewhere, will let you know!!!
Hi John,
I implemented a Single-Shot tracking, by adding a "ST" command to the UIMgr, Executive and the logic mainly in FrameMgr.c.
The problems seem to be that often I don't seem to get a "blob", even though maybe 50% I do, if I ask for it... not too often (by clicking a send button in a win app I wrote, so it can't be too fast).
Another problem seems to be that if I move the tracked object, the next few times I ask for blobs I still get the old position... at least it seems so, and then I get the new position.
I didn't do what you suggested to somebody (only block the TX), instead after each tracking I set the state ti Idle.
I think there's something I'm missing, can you please have a look at this:
>>>
static bool_t bSingleTrack;
void FrameMgr_dispatchEvent(unsigned char event)
{
switch(event)
{
case EV_DUMP_FRAME:
/* try re-initializing the camera before we start dumping */
CamConfig_setCamReg(0x11,0x01); /* reduce the frame rate for dumping*/
CamConfig_sendFifoCmds();
Utility_delay(1000); /* allow the new frame rate to settle */
lineCount = 0;
currentState = ST_FrameMgr_DumpingFrame;
//CamIntAsm_waitForNewDumpFrame(currentLineBuffer,previousLineBuffer);
FrameMgr_acquireLine();
break;
case EV_ENABLE_TRACKING:
currentState = ST_FrameMgr_TrackingFrame;
bSingleTrack = FALSE;
FrameMgr_acquireFrame();
break;
case EV_ENABLE_SINGLE_TRACKING: currentState = ST_FrameMgr_TrackingFrame;
bSingleTrack = TRUE;
FrameMgr_acquireFrame();
break;
case EV_ACQUIRE_FRAME_COMPLETE:
FrameMgr_processFrame();
break;
case EV_PROCESS_FRAME_COMPLETE:
FrameMgr_acquireFrame();
if (bSingleTrack)
currentState = ST_FrameMgr_idle; //Cat make status idle if single Tracking
break;
case EV_SERIAL_DATA_RECEIVED:
if (currentState != ST_FrameMgr_idle)
{
/* we need to go back to processing line data, since
serial data reception interrupted us....just trash the
frame and act like the frame has been processed, which
will kick off the system to wait for the next line */
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE);
}
break;
case EV_DISABLE_TRACKING:
/* tracking needs to be turned off */
currentState = ST_FrameMgr_idle;
break;
}
}
I may have found the problem elsewhere, will let you know!!!
Hi John,
I implemented a Single-Shot tracking, by adding a "ST" command to the UIMgr, Executive and the logic mainly in FrameMgr.c.
The problems seem to be that often I don't seem to get a "blob", even though maybe 50% I do, if I ask for it... not too often (by clicking a send button in a win app I wrote, so it can't be too fast).
Another problem seems to be that if I move the tracked object, the next few times I ask for blobs I still get the old position... at least it seems so, and then I get the new position.
I didn't do what you suggested to somebody (only block the TX), instead after each tracking I set the state ti Idle.
I think there's something I'm missing, can you please have a look at this:
>>>
static bool_t bSingleTrack;
void FrameMgr_dispatchEvent(unsigned char event)
{
switch(event)
{
case EV_DUMP_FRAME:
/* try re-initializing the camera before we start dumping */
CamConfig_setCamReg(0x11,0x01); /* reduce the frame rate for dumping*/
CamConfig_sendFifoCmds();
Utility_delay(1000); /* allow the new frame rate to settle */
lineCount = 0;
currentState = ST_FrameMgr_DumpingFrame;
//CamIntAsm_waitForNewDumpFrame(currentLineBuffer,previousLineBuffer);
FrameMgr_acquireLine();
break;
case EV_ENABLE_TRACKING:
currentState = ST_FrameMgr_TrackingFrame;
bSingleTrack = FALSE;
FrameMgr_acquireFrame();
break;
case EV_ENABLE_SINGLE_TRACKING: currentState = ST_FrameMgr_TrackingFrame;
bSingleTrack = TRUE;
FrameMgr_acquireFrame();
break;
case EV_ACQUIRE_FRAME_COMPLETE:
FrameMgr_processFrame();
break;
case EV_PROCESS_FRAME_COMPLETE:
FrameMgr_acquireFrame();
if (bSingleTrack)
currentState = ST_FrameMgr_idle; //Cat make status idle if single Tracking
break;
case EV_SERIAL_DATA_RECEIVED:
if (currentState != ST_FrameMgr_idle)
{
/* we need to go back to processing line data, since
serial data reception interrupted us....just trash the
frame and act like the frame has been processed, which
will kick off the system to wait for the next line */
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE);
}
break;
case EV_DISABLE_TRACKING:
/* tracking needs to be turned off */
currentState = ST_FrameMgr_idle;
break;
}
}