VisioForge

Last updated: 2026年1月

AForge.NETの代替:VisioForge .Net SDKへの移行ガイド

開発終了したAForge.NETをモダンなクロスプラットフォーム.NET SDKに置き換え

AForge.NET(AForge.Video、AForge.Vision、AForge.Imaging)からモダンな.NET 6-10代替へ移行するC#開発者向け

なぜAForge.NETを置き換えるべきか?

AForge.NETは2013年7月以降放棄されています — 12年以上アップデート、セキュリティパッチ、バグ修正がありません。.NET Framework 2.0を対象としており、品質が異なるコミュニティフォークなしではモダンな.NET 6-10で実行できません。

リスク影響
セキュリティパッチなしビデオ/画像処理の脆弱性が未修正のまま
.NET 6+サポートなしモダンな.NET機能、AOT、クロスプラットフォームデプロイメントが使用不可
新しいコーデックサポートなしH.265、AV1、VP9、モダンなコンテナ形式に非対応
コミュニティなしフォーラムは2012年4月に閉鎖、アクティブなメンテナーなし
DirectShow依存MicrosoftによりMedia Foundationに置き換えられ非推奨
WindowsのみmacOS、Linux、iOS、Androidをターゲットにできない

AForge.Video → VisioForge Video Capture SDK .Net

クラスマッピング

AForge.VideoコンポーネントVisioForge代替
VideoCaptureDeviceVideoCaptureCoreX + VideoCaptureDeviceSourceSettings
MJPEGStreamVideoCaptureCoreX + RTSPSourceSettings or UniversalSourceBlock
JPEGStreamVideoCaptureCoreX + IPCameraSourceSettings
ScreenCaptureStreamVideoCaptureCoreX + ScreenCaptureSourceSettings
FileVideoSourceMediaPlayerCoreX(再生)またはVideoEditCoreX(処理)
AsyncVideoSource組み込み — すべてのVisioForgeソースはデフォルトで非同期
NewFrameEventArgsOnVideoFrameBufferイベント

C# Webカメラキャプチャ

AForge.NET — Webカメラキャプチャ(移行前)

C#
// AForge: Manual device enumeration, callback-based, no recording
var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
var videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);
videoSource.NewFrame += (sender, eventArgs) =>
{
    Bitmap frame = (Bitmap)eventArgs.Frame.Clone();
    pictureBox.Image = frame;
    // Manual recording requires separate code
};
videoSource.Start();

// Cleanup
videoSource.SignalToStop();
videoSource.WaitForStop();

VisioForge — C# Webカメラキャプチャ(移行後)

C#
// VisioForge: Typed API, async, preview + recording built-in
var capture = new VideoCaptureCoreX(videoView);  // Preview automatic
var devices = await DeviceEnumerator.Shared.VideoSourcesAsync();
capture.Video_Source = new VideoCaptureDeviceSourceSettings(devices[0]);
capture.Outputs_Add(new MP4Output("recording.mp4"), true);
await capture.StartAsync();

// Stop
await capture.StopAsync();

C# IPカメラ RTSP / MJPEGストリーミング

AForge.NET — MJPEGストリーム(移行前)

C#
// AForge: MJPEG only, no RTSP, no reconnection
var stream = new MJPEGStream("http://camera-ip/mjpg/video.mjpg");
stream.NewFrame += (sender, eventArgs) =>
{
    pictureBox.Image = (Bitmap)eventArgs.Frame.Clone();
};
stream.Start();

VisioForge — C# RTSP IPカメラキャプチャ(移行後)

C#
// VisioForge: RTSP, RTMP, HLS, MJPEG — with auto-reconnection
var capture = new VideoCaptureCoreX(videoView);
capture.Video_Source = new RTSPSourceSettings(
    new Uri("rtsp://admin:pass@camera-ip/stream"));
capture.Outputs_Add(new MP4Output("recording.mp4"), true);
await capture.StartAsync();

C# 画面キャプチャと録画

AForge.NET — 画面キャプチャ(移行前)

C#
// AForge: Basic, CPU-intensive, no recording
var screenStream = new ScreenCaptureStream(Screen.PrimaryScreen.Bounds);
screenStream.NewFrame += (sender, eventArgs) =>
{
    pictureBox.Image = (Bitmap)eventArgs.Frame.Clone();
    // Must manually encode and write frames to create a recording
};
screenStream.Start();

VisioForge — C# スクリーンレコーダー(移行後)

C#
// VisioForge: Region selection, cursor capture, hardware encoding
var capture = new VideoCaptureCoreX(videoView);
capture.Video_Source = new ScreenCaptureSourceSettings();
capture.Outputs_Add(new MP4Output("screen.mp4", new H264EncoderSettings()), true);
await capture.StartAsync();

AForge.Vision → VisioForgeコンピュータビジョンブロック

クラスマッピング

AForge.VisionコンポーネントVisioForge代替
MotionDetectorCVMotionCellsBlock — MOG2背景差分によるオブジェクトトラッキングとID割り当て
TwoFramesDifferenceDetectorCVMotionCellsBlock — MOG2 (history: 500 frames, variance threshold: 40)
SimpleBackgroundModelingDetectorCVMotionCellsBlock — 輪郭ベースの検出による自動背景モデル
CustomFrameDifferenceDetector設定可能なCVMotionCellsSettings
MotionAreaHighlightingCVMotionCellsBlock(DrawEnabled = true)— オブジェクトIDを含むバウンディングボックスを描画
GridMotionAreaProcessingVideo Capture SDKイベントによるゾーンベースのモーション検出
BlobCounterCVMotionCellsBlock — ブロブトラッキング、輪郭検出、トラッキングラインを横切る車両カウント

C# モーションおよびオブジェクト検出

AForge.NET — モーション検出(移行前)

C#
// AForge: Manual frame processing, no recording integration
var detector = new MotionDetector(
    new TwoFramesDifferenceDetector(),
    new MotionAreaHighlighting());

videoSource.NewFrame += (sender, eventArgs) =>
{
    float motionLevel = detector.ProcessFrame((Bitmap)eventArgs.Frame.Clone());
    if (motionLevel > 0.02f)
        Console.WriteLine($"Motion: {motionLevel * 100:F1}%");
};

VisioForge — イベントベースのモーション検出(Video Capture SDK)

C#
// Integrated detection during capture + recording
var capture = new VideoCaptureCoreX(videoView);
capture.Video_Source = new VideoCaptureDeviceSourceSettings(devices[0]);
capture.Outputs_Add(new MP4Output("recording.mp4"), true);

capture.OnMotionDetection += (s, e) =>
{
    if (e.Level > 30)
        Console.WriteLine($"Motion: {e.Level}%");
};

await capture.StartAsync();

VisioForge — CVMotionCellsBlock(MediaBlocksパイプライン)

C#
// MOG2 background subtraction with automatic object tracking and IDs
var settings = new CVMotionCellsSettings
{
    DrawEnabled = true
};
var detector = new CVMotionCellsBlock(settings);
// Tracks objects with unique IDs using Euclidean distance matching

C# 顔検出と歩行者検出(AForgeでは利用不可)

クラスマッピング

機能VisioForgeブロック
Haarカスケード顔検出CVFaceDetectBlock — 正面/プロファイル顔、目、鼻、口の検出
DNN顔検出CVFaceDetectBlock — Caffe SSDモデル、信頼度フィルタリング、GPU高速化
DLib顔検出CVFaceDetectBlock (CVD) — DLib HOG+SVM正面顔検出器
歩行者検出CVFaceDetectBlock — 組み込みHOG+SVM人物検出器
レンズ遮蔽検出CameraCoveredDetectorBlock — Cannyエッジ検出

C# 顔検出

AForge.NET(移行前)

C#
// AForge had no built-in face detection — required manual Haar cascade code
// or using Accord.NET's HaarObjectDetector on top of AForge frames

VisioForge — Haarカスケード顔検出

C#
var settings = new CVFaceDetectSettings
{
    DetectFrontalFace = true,
    DetectProfileFace = true,
    DetectEyes = true,
    DetectNose = true,
    DetectMouth = true,
    MinFaceSize = new Size(30, 30),
    ScaleFactor = 1.1,
    DrawEnabled = true,
    BlurFaces = false,    // set true for privacy blur
    PixelateFaces = false // set true for privacy pixelation
};
var detector = new CVFaceDetectBlock(settings);

VisioForge — DNN顔検出器(高精度、GPUサポート)

C#
var settings = new CVFaceDetectSettings
{
    Confidence = 0.25,
    DrawEnabled = true,
    BlurFaces = true  // built-in privacy blur
};
var detector = new CVFaceDetectBlock(settings);

VisioForge — DLib顔検出器

C#
var settings = new CVFaceDetectSettings
{
    DrawEnabled = true,
    MinFaceSize = new Size(30, 30)
};
var detector = new CVFaceDetectBlock(settings);

C# 歩行者検出

AForge.NET(移行前)

C#
// AForge had no pedestrian detection — required manual HOG+SVM implementation

VisioForge — 歩行者検出(移行後)

C#
var settings = new CVFaceDetectSettings
{
    DrawEnabled = true,
    VideoScale = 1.0,
    FramesToSkip = 2
};
var detector = new CVFaceDetectBlock(settings);
// Built-in HOG descriptors + SVM classifier, multi-scale detection

AForge.Imaging → VisioForge CV + OpenCvSharp

クラスマッピング

AForge.Imaging機能VisioForge組み込みスタンドアロンOpenCvSharp
GaussianBlurCVProcess.BlurRegion() (kernel 23x23)Cv2.GaussianBlur()
PixellateCVProcess.PixelateRegion()カスタムダウンスケール/アップスケール
CannyEdgeDetectorCameraCoveredDetector (thresholds 100/200)Cv2.Canny()
Erosion / DilationCVMotionCellsBlockで内部使用(5x5構造要素)Cv2.Erode() / Cv2.Dilate()
BlobCounterCVMotionCellsBlock — 輪郭検出、面積/アスペクト比フィルタリング、凸包Cv2.FindContours()
Grayscaleすべての検出器に組み込みのBGR→Gray変換Cv2.CvtColor()
Thresholdモーションパイプラインに組み込みの二値化閾値処理Cv2.Threshold()
ResizeBilinearすべての検出器設定に組み込みのビデオスケーリングCv2.Resize()
HistogramEqualizationCVFaceDetectで検出精度向上に使用Cv2.EqualizeHist()
HSLFiltering / カラーフィルターCv2.InRange() / Cv2.CvtColor()
HoughLineTransformationCv2.HoughLinesP()
SobelEdgeDetectorCv2.Sobel()
テンプレートマッチングCv2.MatchTemplate()

移行チェックリスト

  • AForge参照のインベントリ — プロジェクト内のすべての`using AForge.*`を検索
  • VisioForge NuGetパッケージをインストール
  • ビデオソースクラスを置き換え
  • モーション検出を置き換え
  • 顔検出を置き換え
  • ブロブ/オブジェクト検出を置き換え
  • 手動フレームループを削除
  • 録画/ストリーミングを追加
  • モダンな.NETをターゲット — .NET 6-10
  • クロスプラットフォームテスト
  • 画像処理について — VisioForge CVはぼかし、ピクセル化、Canny、モルフォロジーをカバー;追加フィルターにはOpenCvSharpを使用

移行後に得られるもの

機能AForge.NET移行後
フレームワーク.NET Framework 2.0.NET 6-10
プラットフォームWindowsのみWindows、macOS、Linux、iOS、Android
ビデオキャプチャ基本的なDirectShow非同期APIを備えたプロフェッショナルSDK
録画手動実装組み込み(MP4、MKV、AVI、WebM)
ハードウェアエンコーディングなしNVENC、QSV、AMF、VideoToolbox
ストリーミングなしRTMP、HLS、SRT、NDI
オーディオエフェクトなし40以上(EQ、リバーブ、コーラス、3D)
ビデオエフェクトなしGPU + CPUパイプライン
顔検出なしHaar + DNN (Caffe SSD) + DLib HOG、ぼかし/ピクセル化付き
モーション検出基本的なフレーム差分MOG2背景差分 + IDによるオブジェクトトラッキング
歩行者検出なし組み込みHOG+SVM人物検出器
IPカメラMJPEGのみRTSP、RTMP、HLS、ONVIF
仮想カメラなしZoom/Teams/OBSへの出力
メンテナンス放棄(2013年)活発な開発
セキュリティ未パッチ定期的なアップデート

Frequently Asked Questions

AForge.NETはまだメンテナンスされていますか?
いいえ。AForge.NETは2013年7月以降、アップデート、セキュリティパッチ、.NET 6+サポートなしで放棄されています。コミュニティフォークは存在しますが、品質とメンテナンスにばらつきがあります。モダンなAForge.NET代替としてVisioForge .Net SDKをご使用ください。
C#ビデオキャプチャに最適なAForge.NET代替は何ですか?
VisioForge Video Capture SDK .NetはAForge.Videoを、Webカメラ、IPカメラ(RTSP/ONVIF)、画面キャプチャ、MP4、WebMなどの形式への出力をサポートするモダンな非同期APIで置き換えます(.NET 6-10対応)。
VisioForgeはAForge.Imagingフィルターを置き換えますか?
部分的に。VisioForge CVにはぼかし、ピクセル化、Cannyエッジ検出、モルフォロジー演算、グレースケール変換、ヒストグラム均等化が含まれています。画像フィルターの全範囲(Sobel、Hough、カラーフィルタリング、テンプレートマッチング)については、VisioForgeと併用してOpenCvSharpを使用してください。
AForgeなしでVisioForgeをC#顔検出に使用できますか?
はい。VisioForge .Net SDKには3つの組み込み顔検出エンジン — Haarカスケード、DNNベース、DLibベース — が含まれており、プライバシーぼかしとピクセル化も組み込まれています。AForgeやAccord.NETへの依存は不要です。
VisioForgeは.NET 6、.NET 8、.NET 9、.NET 10をサポートしていますか?
はい。すべてのVisioForge .Net SDKパッケージは.NET 6から.NET 10をサポートしており、Windows、macOS、Linux、iOS、Androidでのクロスプラットフォームデプロイメントが可能です。
AForge.NETから段階的に移行できますか?
はい。VisioForge SDKは移行中にAForge.NETパッケージと共存できます。一度に1つのコンポーネントを置き換えてください — まずビデオキャプチャ、次に検出、そして画像処理 — 各ステップの完了後にAForge NuGetパッケージを削除してください。

移行を開始する

関連する移行ガイド