mirror of
https://github.com/unclshura/splitter.git
synced 2026-06-22 00:22:01 +00:00
24 lines
499 B
C#
24 lines
499 B
C#
using OpenCvSharp;
|
|
|
|
namespace Splitter_UI.Services;
|
|
|
|
public class SingleThreadedDetector<T>(IObjectDetector _detector) : IObjectDetector
|
|
where T : IObjectDetector
|
|
{
|
|
private Lock _lock = new();
|
|
|
|
public List<(Rect box, splitter.Point2f center)> DetectAll(Mat frameCont)
|
|
{
|
|
lock (_lock)
|
|
{
|
|
return _detector.DetectAll(frameCont);
|
|
}
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
if ( _detector is IDisposable d )
|
|
d.Dispose();
|
|
}
|
|
}
|