eLynx SDK v3.3.0
C++ image processing API reference

Restore missing or dammaged area of an image

Lincoln.png

Lincoln.png
Lincoln_mask.png

Lincoln_mask.png
  char * filenameIn = "../../datas/inpainting/Lincoln.png";
  cout << ".Loading RGBub original image file: " << filenameIn << endl;
  ImageVariant image(filenameIn);
  bool bSuccess = image.IsValid();

  filenameIn = "../../datas/inpainting/Lincoln_mask.png";
  cout << ".Loading Lub mask image file: " << filenameIn << endl;
  ImageVariant mask(filenameIn);
  bSuccess = mask.IsValid();

  ImageVariant image2 = image;

  cout << ".Get a sub part of image" << endl;
  const uint32 x = 90;
  const uint32 y = 80;
  const uint32 w = 200;
  const uint32 h = 220;
  bSuccess = image2.Crop(x,y, w,h);

  cout << ".Zoom image to see details" << endl;
  const uint32 z = 2;
  bSuccess = image2.Zoom(z);

  char * filenameOut = "../../datas/output/Lincoln_details.png";
  cout << ".Save the original zoomed image: " << filenameOut << " ";
  bSuccess = image2.Save(filenameOut);
  cout << (bSuccess? "successfull" : "failed") << endl;

  cout << ".Apply FastInpaint" << filenameIn << endl;
  bSuccess = image.FastInpaint(mask, true);

  image2 = image;
  cout << ".Get a sub part of image" << endl;
  bSuccess = image2.Crop(x,y, w,h);

  cout << ".Zoom image to see inpainting details" << endl;
  bSuccess = image2.Zoom(z);

  filenameOut = "../../datas/output/Lincoln_FastInpaint.png";
  cout << ".Save image as " << filenameOut << " ";
  bSuccess = image2.Save(filenameOut);
  cout << (bSuccess? "successfull" : "failed") << endl;

Output:

.Loading RGBub original image file: ../../datas/inpainting/Lincoln.png
.Loading Lub mask image file: ../../datas/inpainting/Lincoln_mask.png
.Get a sub part of image
.Zoom image to see details
.Save the original zoomed image: ../../datas/output/Lincoln_details.png successfull
.Apply FastInpaint../../datas/inpainting/Lincoln_mask.png
.Get a sub part of image
.Zoom image to see inpainting details
.Save image as ../../datas/output/Lincoln_FastInpaint.png successfull
Lincoln_details.png

Lincoln_details.png
Lincoln_FastInpaint.png

Lincoln_FastInpaint.png

Generated on Thu Dec 9 2010 by doxygen 1.7.2