Friday, July 25, 2014

Study Memo of ROOT - Gradient Merge of Two Images 学習メモ

Original Image 1
Original Image 2
Gradient Merge

#include "TImage.h"
#include "TCanvas.h"
#include "TArrayD.h"
#include "TROOT.h"
#include "TColor.h"
#include "TAttImage.h"
#include "TEnv.h"

void imgProc02()
{
  TImage *img1 = TImage::Open("IMGP4782.png");
  TImage *imgG = img1->Clone("img2");
  TImage *img2 = TImage::Open("IMGP4783.png");

  imgG->Gradient();
  img1->Merge(imgG, "tint");
  imgG->Gradient(0, "#000000 #FFFFFF");
  img2->Merge(imgG, "tint");
  img1->Merge(img2, "lighten");
  img1->WriteImage("GradientMerge.png");
}

No comments:

Post a Comment