diff --git a/README.md b/README.md index 4361648..c03843b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,13 @@ Comments/Suggestions/Bugs to: > for more details). The results of texture synthesis are still qualitatively > similar. +> [!WARNING] +> +> In https://github.com/LabForComputationalVision/textureSynth/pull/5, a small +> change was made to the plotting code for compatibility with recent versions +> of matlab. The code now works with Matlab >= 2023. Back-compatibility is +> unclear. + ## INSTALLATION 1) download and unpack the code. You can put the code anywhere on your diff --git a/textureSynthesis.m b/textureSynthesis.m index 378fbfe..e6de718 100644 --- a/textureSynthesis.m +++ b/textureSynthesis.m @@ -117,14 +117,14 @@ end end -imf = max(1,gcf-1); snrf = imf+1; +imf = max(1,get(gcf,'Number')-1); snrf = imf+1; figure(imf); clf subplot(1,2,1); grayRange = showIm(im,'auto',1); title('Starting image'); drawnow prev_im=im; -imf = max(1,gcf-1); +imf = max(1,get(gcf, 'Number')-1); figure(imf); clf;showIm(im,'auto',1); title(sprintf('iteration 0'));