Code for making image pairs for BOS


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Code for making image pairs for BOS
# 1  
Old 02-22-2011
Code for making image pairs for BOS

Hi guys,

Those who work with Background Oriented Schlieren (BOS) might wonder how to create image pairs suitable for a PIV image processing software.
Here is the code :

Code:
#!/bin/bash

# This is a program to read *.jpg  files and save them in pairs for postprocessing

nfiles=`ls -1 bild* | wc -l`;
f=`expr $nfiles `
filename=background.JPG;
i=1;
while [ $i -le $f ]
do
cp $filename b$i.JPG
i=$((i+1))
done
echo "Base pictures created !"

for i in bild*; do
   mv $i `echo $i| sed 's/^[a-zA-Z]\+0*/c/g'`
done
echo "Cross pictures created !"

This code copies the image "background.JPG" as many number of times as the occurrence of "bild*.JPG" and renames them as b1.JPG, b2.JPG etc.
Then it looks for the bild*.JPG files and renames them as c1.JPG,c2.JPG etc.

Hope it helps many Smilie
Cheers,

CJ

Moderator's Comments:
Mod Comment Please use code tags for listings

Last edited by pludi; 02-22-2011 at 09:47 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Making a script secure to code injection

Heyas I've been told my scipts would be insecure, and to fix that. Figured i might rethink some parts of my coding style, meanwhile i tried to write an additional catcher. After reading: fail : Security Issues - didnt help too much, infact - it confused me even more. n/a:... (8 Replies)
Discussion started by: sea
8 Replies

2. Shell Programming and Scripting

Code for count the frequency of interacting pairs

Hi all, I am trying to analyze my data, and I will need your experience. I have some files with the below format: res1 = TYR res2 = ASN res1 = ASP res2 = SER res1 = TYR res2 = ASN res1 = THR res2 = LYS res1 = THR res2 = TYR etc (many lines) I am... (3 Replies)
Discussion started by: Tzole
3 Replies

3. Shell Programming and Scripting

Making use of PWD command in the code

Hi all, Need some help in the following code. (Running this code at cygwin in windows vista) cat /home/ebanpan/Input_Logs/*.log > /home/ebanpan/Input_Logs/input.log sed '/^Total/d;/^Bye/d;/^Output has been logged/d' /home/ebanpan/Input_Logs/input.log > /home/ebanpan/output.log this code... (6 Replies)
Discussion started by: bansalpankaj88
6 Replies

4. UNIX for Dummies Questions & Answers

awk code to process column pairs and find those with more than 1 set of possible values

Hi, I have a very wide dataset with pairs of columns starting from column 7 onwards (see example below). 0 123456 -1 0 0 -9 0 0 1 2 2 2 1 1 1 1 2 2... 0 123457 -1 0 0 -9 1 2 1 1 2 2 0 0 0 0 2 2... 0 123458 -1 0 0 -9 0 0 1 2 2 2 1 1 2 2 1 2... 0 123459 -1 0 0 -9 1 2 0 0 2 2 1 1 1 2 1 1...... (2 Replies)
Discussion started by: kasan0
2 Replies

5. Shell Programming and Scripting

making code compatible to previous bash versions

First let me explain the scenario I have tywo files as usual file1.txt (it has n rows and 8 columns) $1 $2 $3 $4 $5 $6 $7 $8 Code: 1234567|iufgt|iuoy|iout|white |black |red |90879 1234567|iufgt|iuoy|iout|green |pink |blue |90879... (3 Replies)
Discussion started by: s.deepak
3 Replies

6. Programming

Making FORTRAN code more efficient

Hi, I have a very large, very old FORTRAN code that I work with. The code is quite messy and I was wondering if I can speed up execution time by finding subroutines that code execution spends the most time in. Is there any kind of software I can use to see where the code spends most of the... (1 Reply)
Discussion started by: rks171
1 Replies

7. UNIX for Advanced & Expert Users

Making one binary image containing boot loader and linux

Hi, I want to have one binary image that contains both my boot loader as well as the OS(linux) image at pre defined offsets which i can use to program flash . Can anyone help in this direction? Regards Subrata (0 Replies)
Discussion started by: subratasaharia
0 Replies

8. UNIX for Advanced & Expert Users

Create an Ignite image on tape from Online IgniteUX image

Hi, (HP-UX 11.11) I need to create a tape image of an igniteUX image created on our igniteUX server. That is to say. I have a "Online" image of the igniteUX of the targeted system but I now need to copy it to a useable TAPE (igniteUX) image so i can build an other server from it that is not... (3 Replies)
Discussion started by: Andrek
3 Replies
Login or Register to Ask a Question