@echo off
rem

rem ----------------------------------------------------------------------
rem    SparseLab1.1 benchmark
rem    Test image decomposition and inpainting using MCA solver.

set IMAGE=..\..\data\barbara.pan
set IMASKED=..\..\data\barbara_masked.pan
set IMASK=..\..\data\mask_512x512_random50.pan

cls

echo ----------------------------------------------------------------------
echo    SparseLab1.1 benchmark
echo    Test image decomposition and inpainting using MCA solver.


rem ----------------------------------------------------------------------
rem     Dictionary specifications: two transforms for this example.

echo.
echo    FCT transform (natural smooth part)
rem echo    For UDWT, specify a QMF
rem echo    ../bin/qmf symmlet 6 qmf.col
rem ../bin/qmf symmlet 6 qmf.col
echo    Make first transform of the dictionary
echo    ../bin/dictionary FCT 7 16 0 dict_barb.col dict_barb.col
../bin/dictionary FCT 7 16 0 dict_barb.col dict_barb.col

echo.
echo    LDCTIV transform (textured part)
echo    Make second transform of the dictionary
echo    ../bin/dictionary LDCTIV 32 0.25 0 dict_barb.col dict_barb.col
../bin/dictionary LDCTIV 32 0.25 0 dict_barb.col dict_barb.col



rem ----------------------------------------------------------------------
rem     Apply MCA.
# More iterations for a higher quality result, e.g. 1000

echo.
echo   ----------------------------------------------------------------------
echo   Apply MCA.
echo   ../bin/mca 300 1 3 0 0 dict_barb.col %IMAGE% mca_test.pan
../bin/mca 300 1 3 0 0 dict_barb.col %IMAGE% mca_test.pan


echo.
echo   ----------------------------------------------------------------------
echo   Inpainting: ECM with varying lambda (MCA).
echo   ..\..\bin\eminpaint 50 1E-6 0 1 1 2 dict_barb.col %IMASKED% %IMASK% inpaint_test_ecm.pan
..\..\bin\eminpaint 300 1E-6 0 1 1 2 dict_barb.col %IMASKED% %IMASK% inpaint_test_ecm.pan



rem ----------------------------------------------------------------------
rem     Clean up temporary storage.

echo.
echo    Clean up.
del qmf.col dict_barb.col

echo.

