@echo off
rem

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

set IMAGE=..\..\data\tg128x128.pan
set IMASKED=..\..\data\tg128x128_masked.pan
set IMASK=..\..\data\mask_128x128_brush.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    UDWT transform (natural smooth part)
echo    For UDWT, specify a QMF
echo    ..\..\bin\qmf symmlet 6 qmf.col
..\..\bin\qmf symmlet 6 qmf.col
echo    Make first transform of the dictionary
echo    ..\..\bin\dictionary UDWT 5 qmf.col 0 dict_tg.col dict_tg.col
..\..\bin\dictionary UDWT 5 qmf.col 0 dict_tg.col dict_tg.col

echo.
echo    LDCT transform (textured locally oscillatory part)
echo    Make second transform of the dictionary
echo    ..\..\bin\dictionary LDCT 16 0 0 dict_tg.col dict_tg.col
..\..\bin\dictionary LDCT 16 0 0 dict_tg.col dict_tg.col



rem  ----------------------------------------------------------------------
rem      Apply MCA.

echo.
echo ----------------------------------------------------------------------
echo   Apply MCA.
echo   ..\..\bin\mca 50 1 0.05 0 0 dict_tg.col %IMAGE% mca_test.pan
..\..\bin\mca 50 1 0.05 0 0 dict_tg.col %IMAGE% mca_test.pan



rem  ----------------------------------------------------------------------
rem      Inpainting.

echo.
echo ----------------------------------------------------------------------
echo   Inpainting: ECM with fixed lambda.
echo   ..\..\bin\eminpaint 1 1E-6 3 0.2 1 0 dict_tg.col %IMASKED% %IMASK% inpaint_test_ecm1.pan
..\..\bin\eminpaint 1 1E-6 3 0.2 1 0 dict_tg.col %IMASKED% %IMASK% inpaint_test_ecm1.pan

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



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

echo.
echo    Clean up.
del qmf.col dict_tg.col

echo.
