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

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 574
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 218
Working with Image Data in MATLAB Workspace
7-21
grayscale
3
Create a one-frame image img using the getsnapshot function.
img = getsnapshot(vid);
4
View the size of the acquired image.
size(img)
ans =
480 640
5
The value of the ReturnedColorSpace property is grayscale because Bayer data
is single-banded and the toolbox doesn't yet know that it needs to decode the data.
Setting the ReturnedColorSpace property to 'bayer' indicates that the toolbox
should decode the data.
% Set the color space to Bayer.
vid.ReturnedColorSpace = 'bayer';
6
In order to properly decode the data, the toolbox also needs to know the alignment
of the Bayer filter array. This should be in the camera documentation. You can then
use the BayerSensorAlignment property to set the alignment.
% Set the alignment.
vid.BayerSensorAlignment = 'gr/jointfilesconvert/367896/bg';
The getdata and getsnapshot functions will now return color data.
% Acquire another image frame.
img = getsnapshot(vid);
% Now check the size of the new frame acquired returning color data.
size(img)
ans =
480 640 3
Remove the image acquisition object from memory.
delete(vid)
clear vid
Vue de la page 218
1 2 ... 214 215 216 217 218 219 220 221 222 223 224 ... 573 574

Commentaires sur ces manuels

Pas de commentaire