Composite Image Generation - Texture Synthesis
이전 댓글 표시
This is the code for generating composite image. While executing it I get white color patch, instead of the original patch? can anybody help me with this problem?
Code:
function [ CI ] = composite_image_generator( index_table,source_patch_id,source_texture,patchsize )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
%workbench=zeros(tw,th);
start_point=0;
end_pt=0;
e=1;
f=1;
[m, n]=size(index_table);
[o, p]=size(source_patch_id);
a=1;b=1;
for i=1:m
e=1;
a=f;
for j=1:n
b=e;
if(index_table(i,j)>0)
for k=1:o
if(index_table(i,j)==source_patch_id(k,1))
start_point=source_patch_id(k,2);
end_pt=source_patch_id(k,3);
end
end
e=b;
for x = start_point:start_point+patchsize-1
for y = end_pt:end_pt+patchsize-1
tmp_composite_img(a,b) = source_texture(x,y);
b=b+1;
end
a=a+1;
b=e;
end
e=e+patchsize;
a=f;
b=e;
else
for c=1:patchsize
for d=1:patchsize
tmp_composite_img(a,b)=0;
b=b+1;
end
a=a+1;
b=e;
end
e=e+patchsize;
a=f;
end
end
f=f+patchsize;
end
CI=tmp_composite_img;
end
댓글 수: 1
VIGNESH KUMAR RAJAGURU
2015년 8월 8일
편집: VIGNESH KUMAR RAJAGURU
2015년 8월 8일
You have passed index_table,source_patch_id,source texture,patchsize as input parameters to the function. Where are those definitions?? Provide the definitions to debug the code
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!