26 #include <MCTypes.hpp> 28 #include <boost/shared_ptr.hpp> 37 typedef struct _IplImage IplImage;
47 typedef boost::shared_ptr<MEImage> ImageSPtr;
77 NormalSubtraction = 0,
106 extern const MC::StringList ImageFormatTypeStrs;
127 MEImage(
int width,
int height,
int layers);
141 #ifndef __AIBO_BUILD__ 151 bool LoadFromFile(
const std::string& file_name);
162 bool SaveToFile(
const std::string& file_name)
const;
181 MEImage* GetLayer(
int layer_index)
const;
191 void SetLayer(
const MEImage& new_layer,
int layer_index);
200 const IplImage* GetIplImage()
const;
209 void SetIplImage(
const IplImage* other);
223 void SetRawImageData(
const MCBinaryData& image_data,
int width,
int height,
int layer_count);
247 MCBinaryData* Compress(ME::ImageFormatType format = ME::JpegFormat)
const;
271 bool operator==(
const MEImage& other);
282 bool operator!=(
const MEImage& other);
302 int GetWidth()
const;
311 int GetHeight()
const;
320 int GetRowWidth()
const;
329 int GetLayerCount()
const;
338 int GetImageDataSize()
const;
347 float GetRatio()
const;
357 void Realloc(
int width,
int height);
368 void Realloc(
int width,
int height,
int layer_count);
378 void Resize(
int width,
int height);
389 void ResizeScaleX(
int width);
400 void ResizeScaleY(
int height);
407 void MirrorHorizontal();
414 void MirrorVertical();
424 void Crop(
int x1,
int y1,
int x2,
int y2);
437 void PasteImageInside(
int x,
int y,
MEImage& other);
448 void CopyImagePart(
int x1,
int y1,
int x2,
int y2,
MEImage& other);
461 void DrawLine(
int x0,
int y0,
int x1,
int y1,
const MEColor& color);
475 void DrawRectangle(
int x0,
int y0,
int x1,
int y1,
const MEColor& color,
bool fill =
true);
487 void DrawCircle(
int x,
int y,
int radius,
const MEColor& color,
bool fill =
true);
500 void DrawText(
int x,
int y,
const std::string& text,
float scale,
const MEColor& color);
511 void Erode(
int iteration_count);
522 void Dilate(
int iteration_count);
539 void SmoothAdvanced(ME::SmoothType filter_mode,
int matrix_size);
552 void Canny(
double threshold1 = 800,
double threshold2 = 1100,
int aperture_size = 5);
568 void Quantize(
int level_count);
577 void Threshold(
int threshold_limit);
584 void AdaptiveThreshold();
602 void ConvertToColorSpace(ME::ColorSpaceType transformation);
609 void ConvertToGrayscale();
623 void ConvertBGRToRGB();
632 void LBP(ME::LBPType mode = ME::SpecialLBP);
641 void Binarize(
int threshold);
651 void Subtract(
const MEImage& other, ME::SubtractionType mode);
670 void Addition(
MEImage& other, ME::AdditionType mode);
681 void EliminateSinglePixels();
697 float DifferenceAreas(
MEImage& reference,
int difference)
const;
708 int AverageDifference(
MEImage& reference)
const;
726 float AverageBrightnessLevel()
const;
736 void Rotate(
int x,
int y,
float degree);
747 bool Equal(
const MEImage& other)
const;
759 bool Equal(
const MEImage& other,
int max_diff)
const;
771 unsigned char GrayscalePixel(
int x,
int y)
const;
780 unsigned int GetWhitePixelCount();
803 void GammaCorrection(
float gamma_level);
816 bool _Copy(
const MEImage& other);
827 void _Init(
int width,
int height,
int layer_count);
838 void ComputeColorSpace(ME::ColorSpaceType mode);
IplImage * Image
Image data in OpenCV format.