clear
clc

topics=readTopic_rgb('topic30.txt',[480 720]);% read the source result of semantic regions.
bg=imread('bg.jpg');
bg=im2double(bg);

for i=1:size(topics,1)
    curImg=genOptTopicIm_color(topics(i,:),bg); % show semantic regions on background images.
    imwrite(curImg,[num2str(i) '.jpg'], 'jpg');
end

display('all done!');
