infuanfu / study-0

Study on possible palette to genre correlations in anime trailers
1 stars 0 forks source link

Extract difference metrics from image pairs #5

Open hdznrrd opened 10 years ago

hdznrrd commented 10 years ago

Image differences for consecutive pairs are extract to later be used as a means to detect change in frame content and or denote scene change

hdznrrd commented 10 years ago

Extract data

compare -metric MAE IMAGE1 IMAGE2 null: 2>&1

Extract data and keep information about input files

compare -metric MAE IMAGE1 IMAGE2 -format "%[d]/%[f] %[o]" null: 2>&1
hdznrrd commented 10 years ago

Feed pairs parameter file to compare and creatively pack/unpack compare output so that difference metric as well input parameters are displayed on the same line

xargs -0 -I '{}' -n 1 sh -c 'compare -metric MAE $1 -format "%[d]/%[f] %[o]" null: 2>&1 | tr "\n" "\t"' -- {} < <(tr \\n \\0 <pairs) | sed "s/\t\t/\n/g"