Quantcast
Channel: FFmpeg | ニコラボ
Viewing all articles
Browse latest Browse all 311

エッジ検出フィルタ sobel, prewitt

$
0
0

ffmpeg 3.2 でリリース予定のビデオフィルタ。エッジ検出フィルタに単体では edgedetectfrei0rsobel があり、カーネルを指定する convolution でもエッジ検出ができるが、今回のこれらのフィルタは手軽でエッジ部分の線が太いのでマスクするのにも便利。sobelprewitt はカーネルが少し異なるがオプションは同じである。

ffmpeg でエッジ検出をする edgedetect
ffmpeg で使える frei0r フィルタの使い方
先鋭化やぼかし、エンボス処理などができる convolution
ffmpeg でエッジマスク

基本コマンド

既定値のオプションを当てる
ffmpeg -i input -vf sobel=planes=15:scale=1:delta=0 output
ffmpeg -i input -vf sobel=15:1:0 output
ffplay -i input -vf sobel=15:1:0

公式ドキュメント:FFmpeg Filters Documentation : sobel
公式ドキュメント:FFmpeg Filters Documentation : prewitt

オプション

sobelprewitt のオプションは同じ。

  • planes[int]
    フィルタを当てるチャンネル指定
    背景黒とエッジに色をつけるには Y だけに当てる 1 を指定する
    詳しくは ffmpeg について | チャンネルの順番と注意点 を参照
    既定値:15(すべてのチャンネル)
    範囲:0 から 15 まで
  • scale[float]
    フィルタを当てる乗算値の指定
    既定値:1
    範囲:0 から 65535 まで
  • delta[float]
    フィルタを当てる加算値の指定
    既定値:0
    範囲:-65535 から 65535 まで

サンプル画像

アニメ画像

アニメ「艦隊これくしょん~艦これ~」の11話の大和出撃のシーン


アニメ画像 sobel=1


アニメ画像 prewitt=1


実写画像

実物大の戦艦大和


実写画像 sobel=1


実写画像 prewitt=1



Viewing all articles
Browse latest Browse all 311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>