Flex 3 Problems with the boundary points

Post Reply
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Flex 3 Problems with the boundary points

Post by maikelnai »

Hi,

We are having a problem with the Flex 3 boundary points: We're using the cameras to detect IR laser impacts over a projection screen. When these impacts are close to one of the optical limits, the camera returns us wrong points in random places: for instance, if we shoot several times to the pixel 437 the camera return us different pixels positions from pixel 1 to 437 (in X coordinate, in Y coordinate it seems that is working ok).

How we can fix it?

The code that we have used to check this is:


/// Get the number of frames
int lNumberObjects = AuxFrame->ObjectCount();
std::vector<CapturedPoint> NewPoints;

/// If not objects, print it
if(lNumberObjects == 0){
// sprintf_s(m_FrameAvailableBuffer, MESSAGE_SIZE, "La Camara %s ha devuelto %d puntos\0",m_CameraSerial.c_str(), lNumberObjects);
// m_pTheLogger->SendSACMessage(APPLICATION_NAME,"WARNING",m_FrameAvailableBuffer,WHITE_OVER_BLACK,1);
return;
}

/// If there are any object, look for its coordenates and store them into the received vector
if (lNumberObjects > 0 && lNumberObjects <= m_iMaxImpacts){

/// Variable used like a counter when searching for the position of the objects
int c;

for(c=0;c<lNumberObjects;c++){

/// Define the Object to store a single object from the Captured Frame
CameraLibrary::cObject* spObject = AuxFrame->Object(c);

/// The Object to store the values from the camera Object
CapturedPoint auxPoint;

/// Save the time
auxPoint.CapturedInstant = CaptureInstant;

/// Store the values from the Camera Object
auxPoint.Serial = m_CameraSerial;
auxPoint.DelayGroup = m_theConfig.m_iDelayGroup;

/// The X Coordinate of the Center of the Point
auxPoint.CenterX = spObject->X();

/// The Y Coordinate of the Center of the Point
auxPoint.CenterY = spObject->Y();

/// The Area of the Point
auxPoint.Superficie = spObject->Area();

/// The high and width of the rectangle of the Point
auxPoint.Height = (LONG)(spObject->Height());
auxPoint.Width = (LONG)(spObject->Width());

/// The values for the point
auxPoint.CorX = auxPoint.CenterX;
auxPoint.CorY = auxPoint.CenterY;

/// The values for the edges
auxPoint.LeftX = auxPoint.CenterX - auxPoint.Width/2;
auxPoint.RightX = auxPoint.CenterX + auxPoint.Width/2;
auxPoint.UpY = auxPoint.CenterY - auxPoint.Height/2;
auxPoint.DownY = auxPoint.CenterY + auxPoint.Height/2;

/// The frame size
auxPoint.FrameHeight = AuxFrame->GetCamera()->Height();
auxPoint.FrameWidth = AuxFrame->GetCamera()->Width();

/// Add the point to the vector
NewPoints.push_back(auxPoint);

/// Free the last used object

}
}


We use the sections:

/// The X Coordinate of the Center of the Point
auxPoint.CenterX = spObject->X();

/// The Y Coordinate of the Center of the Point
auxPoint.CenterY = spObject->Y();


To obtain the X and Y coordinates and see that the detected point, in X coordinate is wrong because it's value vary significally. In Y coordinate, the detected point is pretty the same.
Post Reply