in reply to Re: need logic, police edited video
in thread need logic, police edited video

Had to track down one of my old professors.

Here is what we came up with

##This script is for use with rgb tuple files created through ImageJ.e +xe's xy coordinate extractor ##With RGB tuple files for each frame of a video, this script will ext +ract the RGB values for one pixel location. ##Each line of the new file has file name(= frame number), x, y, R, G, + B. $out_file="C:\\perl\\scripts\\bluetime.txt"; # out_file is the output file name, created by extracting the RGB valu +es from one coordinate unlink $out_file; # erased (deletes) the output file FIRST, otherwise it will continue t +o append to it! open ($output_file,">>",$out_file) or die "Could not open output_file! +!!"; #open file for append for ($i=1;$i<=60075;$i++) # files 00000.txt thru 60075.txt { $output_name = sprintf("%05d",$i); # first field in bluetime, 5 digits $input_file = sprintf("G:\\Frames_as_RGB_Tuples\\%05d.txt",$i); + # FQ input filename open ($infile, "<",$input_file) or die "Could not open input file +$input_file!!!"; ## "<" means read from, ">>" means append to, ">" means write to! # printf("G:\\Frames_as_RGB_Tuples\\%s.txt\n", $result); #For testing while(<$infile>) # read one line from infile, put in $_ { if($_ =~ /^390\t379/) #for each line, if "390(tab)379" is on the line then... { print $output_file sprintf("%s\t%s",$output_name,$_); #write to ouput_file #5 digits of filename plus the line where coordinate was f +ound } } close $infile; } close $output_file; ## by PK Birkmeyer and Ben Gregory one fine afternoon.

I would like if it gave me some feedback as to its progress, if anyone can help there.

This script worked, need help with next hurdle. Posted my pseudo code on this forum here.

http://www.perlmonks.org/?node_id=1072419