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