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 Comment

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

Sign in to comment.

Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Asked:

on 23 Feb 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!