Commit 040988fb authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga

Merge branch 'master' of gitlab.geoint.mx:adan.salazar/GeoSentinel

parents f9ae2f28 3e9f8efc
No preview for this file type
......@@ -184,9 +184,9 @@ jas_matrix_t *imgData[nChannels];
{
for (unsigned int x = 0; x < width; ++x)
{
//int delta = max-min;
//jas_matrix_set(imgData[i], y, x, (unsigned char)(255* (data[nChannels*(y*width+x)+i]-min)/delta) );
jas_matrix_set(imgData[i], y, x, (unsigned char)(255*data[nChannels*(y*width+x)+i]/(pow(2,12))) );
float delta = max-min;
jas_matrix_set(imgData[i], y, x, (unsigned char)(255* ((float)data[nChannels*(y*width+x)+i]-min)/delta) );
//jas_matrix_set(imgData[i], y, x, (unsigned char)(255*data[nChannels*(y*width+x)+i]/(pow(2,12))) );
}
}
}
......
......@@ -7,28 +7,42 @@ ext=.jpg
cd $BASEDIR
for f in $(find . -type f -name '*.zip')
do
filename=$OUTDIR"/T"$(echo $f | cut -d"T" -f2-10 | cut -d"." -f1)"_B"
if [ ! -e $filename"02.jp2" || ! -e $filename"03.jp2" || ! -e $filename"04.jp2" ]; then
filepattern=$(echo $f | cut -d"_" -f6)"_"$(echo $f | cut -d"_" -f3)"_B"
filename=$OUTDIR$filepattern
echo $filename
if [ ! -e $filename"02.jp2" -o ! -e $filename"03.jp2" -o ! -e $filename"04.jp2" ]; then
unzip -j $f *B02.jp2 *B03.jp2 *B04.jp2 -d $OUTDIR
unzip -n -j $f *B02.jp2 *B03.jp2 *B04.jp2 -d $OUTDIR
else
echo PASS $f
fi
cd $OUTDIR
red=$(ls *B04.jp2 -t |head -1)
green=$(ls *B03.jp2 -t |head -1)
blue=$(ls *B02.jp2 -t |head -1)
red=$(ls $filepattern"04.jp2" -t |head -1)
green=$(ls $filepattern"03.jp2" -t |head -1)
blue=$(ls $filepattern"02.jp2" -t |head -1)
echo "red-"$red
echo "gre-"$green
echo "blu-"$blue
# m=$(pwd)
# red=$m/$red
# green=$m/$green
# blue=$m/$blue
# ./jp2ToJPGandStretch $red
# ./jp2ToJPGandStretch $green
# ./jp2ToJPGandStretch $blue
if [ ! -e $filepattern"04.jpg" ]; then
jp2ToJPGandStretch $red
fi
if [ ! -e $filepattern"03.jpg" ]; then
jp2ToJPGandStretch $green
fi
if [ ! -e $filepattern"02.jpg" ]; then
jp2ToJPGandStretch $blue
fi
# red=$(ls *B04.jpg -t |head -1)
# green=$(ls *B03.jpg -t |head -1)
# blue=$(ls *B02.jpg -t |head -1)
......@@ -36,12 +50,16 @@ do
# red=$m/$red
# green=$m/$green
# blue=$m/$blue
# convert $red $green $blue -combine $(OUTDIR)/$count$ext
if [ ! -d "video" ]; then
mkdir video
fi
fileout=$(echo $filepattern | cut -d"_" -f2)
convert $filepattern"04.jpg" $filepattern"02.jpg" $filepattern"02.jpg" -combine video/$fileout".jpg"
# rm *.jp2
# rm *B04.jpg
# rm *B03.jpg
# rm *B02.jpg
# count=$((count+1))
cd ..
done
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment