anyKode Marilou
ContentsIndexHome
PreviousUpNext
Image

La classe Image.

C++
class Image;

Image.h

La classe Image contient les pixels et information de format d'une image issue par exemple de la camera . 

 

Utilisation avec openCV

L'image peut être convertie aisément pour être utilisées avec d'autres librairies comme openCV: 

 

ModaCPP::Image image;
ModaCPP:DeviceCamera* pCamera;

(...)

//capture the image and store it in opencv image
if(pCamera->GetNextImage(&image))
  {
  int nChannels = image.GetBitsPerPixel() == 1 ? 1 : image.GetBitsPerPixel()/8 ;
  int depth = image.GetBitsPerPixel() == 1 ? IPL_DEPTH_1U : IPL_DEPTH_8U;
  img = cvCreateImage(cvSize(image.GetWidth(),image.GetHeight()), depth,nChannels);
  memcpy(img->imageData, (char*)image.GetImageBits(), image.GetImageBytesCount());
  }

(...)

//release the opencv image
cvReleaseImage(&img);
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
What do you think about this topic? Send feedback!