Motion detection

Amoeba proteus (Pallas, 1766) Leidy, 1878
Magnification: 100x


Paramecium caudatum Ehrenberg, 1834
Magnification: 400x


Stentor coeruleus Ehrenberg, 1830
Magnification: 100x


ffmpeg -y -i VID.mp4 -r 10 out%04d.ppm


▸ ./imagexd convert.run


//!imagexd

color.map.volume1 5

procedure go
  	image.rgb
  	image.use one
  	filename := oldnumber ".ppm"
  	image.load filename
  	image.setadjust.percentage.weak 0.05 0.01
  	image.unsharpmasking 1
	
  	image.use two
  	filename := number ".ppm"
  	image.load filename
  	image.setadjust.percentage.weak 0.05 0.01
  	image.unsharpmasking 1
	
  	new := image.sub.abs one two
  	image.use new	
  	image.smooth 3
  	image.setadjust <0,127>	
  	image.colorize
  	plain := image.ifplain
  	if plain
  	then    
            	image.use oldimage
  	end
  	else
            	oldimage := image.copy
  	end
	
  	filename := "n" number ".ppm"
  	image.save filename
end

procedure full_go
  	io.files "out*.ppm" // load all files into a file list
  	io.files.sort

  	oldnumber := io.files.getname
  	io.files.next
	
  	for 2 io.files.length // for all files -1
    		print io.workdir / io.files.getdir / io.files.getfile
    		number := io.files.getname
    		go
    		oldnumber := number
    		io.files.next
  	end 
end

full_go


ffmpeg -y -i nout%04d.ppm -r 10 nout.mp4