m8ta
You are not authenticated, login. |
|
{1471} | ||||||
Edited Terrence Eden's script to average multiple frames when producing a time-lapse video from a continuous video. Frames are averaged together before decimation, rather than pure decimation, as with ffmpeg. Produces appealing results on subjects like water. Also, outputs a video directly, without having to write individual images. python #!/usr/bin/python import cv2 import sys # Video to read print str(sys.argv[1]) vidcap = cv2.VideoCapture(sys.argv[1]) # Which frame to start from, how many frames to go through start_frame = 0 frames = 61000 # Counters count = 0 save_seq = 0 decimate = 10 rolling = 16 # average over N output frames transpose = False if(transpose): h = vidcap.get(3) w = vidcap.get(4) else: w = vidcap.get(3) h = vidcap.get(4) fourcc = cv2.VideoWriter_fourcc(*'mp4v') writer = cv2.VideoWriter("timelapse.mp4", fourcc, 30, (int(w), int(h)), True) avglist = [] while True: # Read a frame success,image = vidcap.read() if not success: break if count > start_frame+frames: break if count >= start_frame: if (count % decimate == 0): # Extract the frame and convert to float avg = image.astype('uint16') # max 255 frames averaged. if (count % decimate > 0 and count % decimate <= (decimate-1)): avg = avg + image.astype('uint16') if (count % decimate == (decimate-1)): # Every 100 frames (3 seconds @ 30fps) avg = avg / decimate if(transpose): avg = cv2.transpose(avg) avg = cv2.flip(avg, 1) avg2 = avg; for a in avglist: avg2 = avg2 + a avg2 = avg2 / rolling; avglist.append(avg); if len(avglist) >= rolling: avglist.pop(0) # remove the first item. avg2 = avg2.astype('uint8') print("saving "+str(save_seq)) # Save Image # cv2.imwrite(filename+str('{0:03d}'.format(save_seq))+".png", avg) save_seq += 1 writer.write(avg2) if count == frames + start_frame: break count += 1 writer.release() | ||||||
{1268} | ||||||
Simple perl scrip for removing duplicate files within sub-directories of a known depth: #!/usr/bin/perl -w @files = <*>; foreach $file (@files) { @files2 = <$file/*>; foreach $file2 (@files2) { print $file2 . "\n"; `rm -rf $file2/*_1.jpg`; `rm -rf $file2/*_2.jpg`; } } | ||||||
{992} | ||||||
IEEE-1634510 (pdf) Continuous shared control for stabilizing reaching and grasping with brain-machine interfaces.
____References____ Kim, H.K. and Biggs, J. and Schloerb, W. and Carmena, M. and Lebedev, M.A. and Nicolelis, M.A.L. and Srinivasan, M.A. Continuous shared control for stabilizing reaching and grasping with brain-machine interfaces Biomedical Engineering, IEEE Transactions on 53 6 1164 -1173 (2006) | ||||||
{885} |
ref: -0
tags: entropy life proteonomics transcription factors
date: 07-08-2011 22:42 gmt
revision:0
[head]
|
|||||
Reduction in Structural Disorder and Functional Complexity in the Thermal Adaptation of Prokaryotes -- read the article. These are my disordered, mesothermophylic notes.
| ||||||
{91} | ||||||
to remove lines beginning with a question mark (e.g. from subversion) svn status | perl -nle 'print if !/^?/' here's another example, for cleaning up the output of ldd: ldd kicadocaml.opt | perl -nle '$_ =~ /^(.*?)=>/; print $1 ;' and one for counting the lines of non-blank source code: cat *.ml | perl -e '$n = 0; while ($k = <STDIN>) {if($k =~ /\w+/){$n++;}} print $n . "\n";' By that metric, kicadocaml (check it out!), which I wrote in the course of learning Ocaml, has about 7500 lines of code. Here is one for resizing a number of .jpg files in a directory into a thumb/ subdirectory: ls -lah | perl -nle 'if( $_ =~ /(\w+)\.jpg/){ `convert $1.jpg -resize 25% thumb/$1.jpg`;}'or, even simpler: ls *.JPG | perl -nle '`convert $_ -resize 25% thumb/$_`;' Note that -e command line flag tells perl to evaluate the expression, -n causes the expression to be evaluated once per input line from standard input, and -l puts a line break after every print statement. reference For replacing charaters in a file, do something like: cat something | perl -nle '$_ =~ s/,/\t/g; print $_' | ||||||
{810} |
ref: -0
tags: circular polarized antenna microstrip ultrawideband
date: 02-03-2010 21:30 gmt
revision:1
[0] [head]
|
|||||
excellent! Ultra-wideband circular polarized microstrip archimedean spiral | ||||||
{735} |
ref: -0
tags: processing javascript vector graphics web
date: 05-03-2009 18:20 gmt
revision:0
[head]
|
|||||
http://www.mattryall.net/blog/2008/11/wiki-visualisations-with-javascript -- way cool!! | ||||||
{712} | ||||||
PMID-19245368[0] The influence of learning on sleep slow oscillations and associated spindles and ripples in humans and rats
____References____
| ||||||
{287} | ||||||
the organization of the human triphasic EMG control sequence:
____References____ | ||||||
{596} | ||||||
PMID-11081826 EMG activation patterns during force production in precision grip. III. Synchronisation of single motor units.
Dr. hepp-Raymond himself seems to be a prolific researcher, judging from his pubmed search results. e.g.:
| ||||||
{407} | ||||||
http://www.baconbutty.com/blog-entry.php?id=13 how to make a text area where tab key inserts 'tab' into the text (like here - for tables!) "
| ||||||
{384} | ||||||
notes on reading magstripe cards:
| ||||||
{286} | ||||||
PMID-8463818[0] Contribution of the monkey corticomotoneuronal system to the control of force in precision grip
____References____ | ||||||
{345} |
ref: HeppReymond-1999.09
tags: force motor control grip electrophysiology
date: 04-09-2007 20:20 gmt
revision:0
[head]
|
|||||
PMID-10473750[0] Context-dependent force coding in motor and premotor cortical areas.
____References____ | ||||||