    %%%%% generating html
    fid = fopen(fullfile(resultPath, ['result' num2str(it) '.html']), 'wt');
    fprintf(fid, 'Original images<br><br>\n');
    
    for i=1:numImage     
        imageLoaded = load(fullfile(cachePath,['SUMMAXmap-image' num2str(i)]));
        fprintf(fid, '%s\n', ['<IMG SRC="' fullfile('./img', files(i).name) '" height=' num2str(imageLoaded.allSizex(originalResolution))  ' width=' num2str(imageLoaded.allSizey(originalResolution)) '>']);
    end
    fprintf(fid, '%s\n', ['<br>']);
    
    fprintf(fid, '%s\n', ['<hr>']);
    

    fprintf(fid, '%s\n', ['<br>']);
    fprintf(fid, '%s\n', ['<hr>']);
    
    fprintf(fid, 'Cropped images<br><br>\n');
    
    for i=1:numImage
        
        fprintf(fid, '%s\n', ['<IMG SRC="' fullfile( ['./iteration' num2str(it)], 'detectedCropped', ['detected-img-' num2str(i,'%04d') '.png']) '" height=' num2str(sx)  ' width=' num2str(sy) '>']);
    end
    fprintf(fid, '%s\n', ['<br>']);
    
    fprintf(fid, '%s\n', ['<hr>']);
    
    
    if it~=0
        fprintf(fid, '%s\n', ['<br>']);
        fprintf(fid, '%s\n', ['<hr>']);
        
        fprintf(fid, 'images with bounding box<br><br>\n');
        
        for i=1:numImage
            imageLoaded = load(fullfile(cachePath,['SUMMAXmap-image' num2str(i)]));
            fprintf(fid, '%s\n', ['<IMG SRC="' fullfile( ['./iteration' num2str(it)], 'boundingBox', ['boundingBox-img-' num2str(i,'%04d') '.png']) '" height=' num2str(imageLoaded.allSizex(originalResolution))  ' width=' num2str(imageLoaded.allSizey(originalResolution)) '>']);
        end
        fprintf(fid, '%s\n', ['<br>']);
        
        fprintf(fid, '%s\n', ['<hr>']);
    end
    fclose(fid);
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
