2つのテキストファイルで異なる部分の行数をカウントするには
diffを取って,>で始まる行だけ抜き出して,その数を数えればいいのだろうか?
diff -bB FILE1.txt FILE2.txt | sed '/^[^>].*/d'
これで,> で始まる行だけ抜き出せるので,wc でカウントする.
imshow で表示しても waitKey を使わないとウィンドウは描画されない
ということを今まで知らずに使ってた.User Interface - OpenCV v2.4.2 documentation#waitKey によると:
This function is the only method in HighGUI that can fetch and handle events, so it needs to be called periodically for normal event processing ...