MATLAB IMAGE ACQUISITION TOOLBOX - RELEASE NOTES Guide de l'utilisateur Page 103

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 172
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 102
Supporting ROIs
5-25
Note You use the ROI width and height when you create the frame but you use the full
image width and height when you copy the image data from the buffer into the frame
object.
Example
The following is a version of the isSendFrame() loop in the acquisition thread function
that checks the ROI. Note that you call the getROI() function to get the ROI values, and
then use the width and height values in the call to makeFrame() and the offsets from the
origin in the call to setImage().
if (adaptor->isSendFrame()) {
// Get ROI information.
int roiOriginX, roiOriginY, roiWidth, roiHeight;
adaptor->getROI(roiOriginX,
roiOriginY,
roiWidth,
roiHeight);
// Get frame type & dimensions
imaqkit::frametypes::FRAMETYPE frameType =
adaptor->getFrameType();
int imWidth = adaptor->getMaxWidth();
int imHeight = adaptor->getMaxHeight();
// Create a frame object
imaqkit::IAdaptorFrame* frame =
adaptor->getEngine()->makeFrame(frameType,
roiWidth, // ROI width
roiHeight); // ROI height
// Copy data from buffer into frame object
frame->setImage(imBuffer,
imWidth, // Full image width
imHeight, // Full image height
roiOriginX, // ROI origin
roiOriginY); // ROI origin
// Set image's timestamp
frame->setTime(imaqkit::getCurrentTime());
// Send frame object to engine.
adaptor->getEngine()->receiveFrame(frame);
Vue de la page 102
1 2 ... 98 99 100 101 102 103 104 105 106 107 108 ... 171 172

Commentaires sur ces manuels

Pas de commentaire