Hi,

I fixed this a while back, here is my updated code:

:: batch file to be run in OSGeo4W command window to
:: optically calibrate, pan sharpen and orthorectify
:: satellite imagery

:: Rob Watson; 12/12/17

:: set variable to define year of the satellite image to be processed:

SET year=2015

for /f "tokens=*" %%a in ('dir GAH_Satellite_Images\"%year%"\PAN\*.TIF /b') 
do SET pan_image=%%a
for /f "tokens=*" %%a in ('dir GAH_Satellite_Images\"%year%"\MUL\*.TIF /b') 
do SET mul_image=%%a

:: optically calibrate pixel values for sensor gain, spectral
:: response and solar illumination.
:: takes around 20-30s for pan, 4-10 seconds for mul for digital globe
:: satellites, for pleiades pan takes longer (70s, 2013)
:: satellites supported include QuickBird, Ikonos, WorldView2, Pleiades

:: panchromatic image:

call otbcli_OpticalCalibration -in 
GAH_Satellite_Images\%year%\PAN\%pan_image% -level toa -out 
calibration\OPT_CAL\%year%\PAN_OPT_CAL.tif

:: multi-spectral image:

call otbcli_OpticalCalibration -in 
GAH_Satellite_Images\%year%\MUL\%mul_image% -level toa -out 
calibration\OPT_CAL\%year%\MUL_OPT_CAL.tif

:: pan-sharpen optically calibrated images by using BundleToPerfectSensor; 
:: performs RCS pan-sharpening algorithm
:: this stage takes ~5minutes for newer images, ~2 minutes for older ones 
(DG)
:: pleiades takes longer (8mins, 2013), probably because images are newer
 
call otbcli_BundleToPerfectSensor -inp 
calibration\OPT_CAL\%year%\PAN_OPT_CAL.tif -inxs 
calibration\OPT_CAL\%year%\MUL_OPT_CAL.tif -elev.dem DEMs\SRTM\dem_otb 
-mode default -out calibration\PANSHARPENED\%year%\OPT_CAL_PS.tif -ram 4096

:: orthorectify pan-sharpened image using SRTM digital elevation model;
:: takes 100-200s for newer images, ~60s for older ones
call otbcli_OrthoRectification -io.in 
calibration\PANSHARPENED\%year%\OPT_CAL_PS.tif -io.out 
calibration\ORTHO\%year%\OPT_CAL_PS_OR.tif -elev.dem DEMs\SRTM\dem_otb

cheers,

Rob

On Friday, December 22, 2017 at 10:30:38 AM UTC, Manuel Grizonnet wrote:
>
> Hi,
>
> the otbcli application will not interpret the special character '*'. 
> You'll need to list images you want to process in your script bat script 
> and then loop on this list to call otbcli on each image.
>
> On windows I imagine that you can use the 'dir' command to list files in 
> specific directory and specific filenames and loop on  the ouptut list.
>
> Hope it helps.
>
> Don't hesitate if you've got any questions.
>
> manuel 
>
> 2017-12-14 21:08 GMT+01:00 <[email protected] <javascript:>>:
>
>> I am trying to write a batch file whereby I optically calibrate, 
>> pan-sharpen and orthorectify a series of images between 2002 - 2015 using 
>> images from Quickbird, GeoEye-1 and Pleiades 1A. Initially, I wrote it like 
>> this:
>>
>> :: batch file to be run in OSGeo4W command window to
>> :: optically calibrate, pan sharpen and orthorectify
>> :: satellite imagery
>>
>> :: Rob Watson; 12/12/17
>>
>> :: set variable to define year of the satellite image to be processed:
>>
>> SET year="2012"
>>
>> :: optically calibrate pixel values for sensor gain, spectral
>> :: response and solar illumination
>>
>> :: panchromatic image:
>>
>> call otbcli_OpticalCalibration -in 
>> GAH_Satellite_Images/"%year%"/PAN/*.TIF -level toa -out 
>> calibrated/OPT_CAL/"%year%"/PAN_OPT_CAL.tif
>>
>> :: multi-spectral image:
>>
>> call otbcli_OpticalCalibration -in 
>> GAH_Satellite_Images/"%year%"/MUL/*.TIF -level toa -out 
>> calibrated/OPT_CAL/"%year%"/MUL_OPT_CAL.tif
>>
>> :: pan-sharpen optically calibrated images by using 
>> BundleToPerfectSensor; 
>> :: performs RCS pan-sharpening algorithm
>>  
>> call otbcli_BundleToPerfectSensor -inp 
>> calibrated/OPT_CAL/"%year%"/PAN_OPT_CAL.tif -inxs 
>> calibrated/OPT_CAL/$year/MUL_OPT_CAL.tif^
>>  -elev.dem DEMs/SRTM/dem_otb -mode default -out 
>> calibrated/PANSHARPENED/"%year%"/OPT_CAL_PS.tif -ram 4096^
>>
>> :: orthorectify pan-sharpened image using SRTM digital elevation model:
>>
>> call otbcli_OrthoRectification -io.in 
>> calibrated/PANSHARPENED/"%year%"/OPT_CAL_PS.tif -io.out 
>> calibrated/ORTH0/"%year%"/OPT_CAL_PS_OR.tif^
>> -elev.dem DEMs/SRTM/dem_otb
>>
>> However, otbcli couldn't recognise the *.TIF as the file I was trying to 
>> load for the optical calibration stage, namely 
>> 12MAR05074213-P2AS-054825313070_01_P001.TIF.
>>
>> Is this syntax supported by otbcli?
>>
>> cheers, 
>> Rob
>>
>> -- 
>> -- 
>> Check the OTB FAQ at
>> http://www.orfeo-toolbox.org/FAQ.html
>>  
>> You received this message because you are subscribed to the Google
>> Groups "otb-users" group.
>> To post to this group, send email to [email protected] 
>> <javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/otb-users?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "otb-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Manuel Grizonnet
>

-- 
-- 
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to