Commit 321b95df authored by geoint's avatar geoint

video

parent 589a6302
No preview for this file type
...@@ -184,9 +184,9 @@ jas_matrix_t *imgData[nChannels]; ...@@ -184,9 +184,9 @@ jas_matrix_t *imgData[nChannels];
{ {
for (unsigned int x = 0; x < width; ++x) for (unsigned int x = 0; x < width; ++x)
{ {
//int delta = max-min; float 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* ((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))) ); //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 ...@@ -7,28 +7,42 @@ ext=.jpg
cd $BASEDIR cd $BASEDIR
for f in $(find . -type f -name '*.zip') for f in $(find . -type f -name '*.zip')
do 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 else
echo PASS $f echo PASS $f
fi fi
cd $OUTDIR cd $OUTDIR
red=$(ls *B04.jp2 -t |head -1) red=$(ls $filepattern"04.jp2" -t |head -1)
green=$(ls *B03.jp2 -t |head -1) green=$(ls $filepattern"03.jp2" -t |head -1)
blue=$(ls *B02.jp2 -t |head -1) blue=$(ls $filepattern"02.jp2" -t |head -1)
echo "red-"$red
echo "gre-"$green
echo "blu-"$blue
# m=$(pwd) # m=$(pwd)
# red=$m/$red # red=$m/$red
# green=$m/$green # green=$m/$green
# blue=$m/$blue # blue=$m/$blue
# ./jp2ToJPGandStretch $red if [ ! -e $filepattern"04.jpg" ]; then
# ./jp2ToJPGandStretch $green jp2ToJPGandStretch $red
# ./jp2ToJPGandStretch $blue 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) # red=$(ls *B04.jpg -t |head -1)
# green=$(ls *B03.jpg -t |head -1) # green=$(ls *B03.jpg -t |head -1)
# blue=$(ls *B02.jpg -t |head -1) # blue=$(ls *B02.jpg -t |head -1)
...@@ -36,12 +50,16 @@ do ...@@ -36,12 +50,16 @@ do
# red=$m/$red # red=$m/$red
# green=$m/$green # green=$m/$green
# blue=$m/$blue # 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 *.jp2
# rm *B04.jpg # rm *B04.jpg
# rm *B03.jpg # rm *B03.jpg
# rm *B02.jpg # rm *B02.jpg
# count=$((count+1)) # count=$((count+1))
cd .. 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