名前
LAB2RGB — はL*a*b*画像をRGBへ変換する
引数
- LAB
3次元の行列で、型はdoubleである
- RGB
3次元の行列で、型はdoubleである
例
global MATCH_CORRELATION_NORM;
global IPD_PATH;
SourceColorImage = ReadImage(IPD_PATH + 'demos\teaset.png');
SourceImage = RGB2Gray(SourceColorImage);
TemplateColorImage = ReadImage(IPD_PATH + 'demos\cropped_image.png');
TemplateImage = RGB2Gray(TemplateColorImage);
Match = MatchTemplate(SourceImage, TemplateImage, MATCH_CORRELATION_NORM);
MatchList = FindBestMatches(Match, size(TemplateImage), MATCH_CORRELATION_NORM);
SquareList = list();
for n = 1 : size(MatchList, 1)
SquareList($ + 1) = struct('BoundingBox', cat(2, MatchList(n, :) - [1 1], [3 3])');
end;
SourceHandle = figure();
ShowColorImage(SourceColorImage, 'Image with Marked Match Positions');
DrawBoundingBoxes(SquareList, [0 1 0], SourceHandle);
TemplateHandle = figure();
ShowColorImage(TemplateColorImage, 'Template Image');
RGBD = double(RGB) / 255;
LAB = RGB2LAB(RGBD);
RGB_New = LAB2RGB(LAB);
figure(); ShowColorImage(uint8(255 * RGB_New), 'Result of LAB -> RGB');