클래스의 기능 : 어글리 클래스 인터페이스 정의
- 이미지 프레임들의 시퀀스를 수신은 서열 무한이다.
- 프레임에 움직임이 있는지 감지합니다.
- 특정 알고리즘에 따라 모션 프레임을 그룹화합니다.
지금까지 디자인은 (꽤 바보)입니다 :
class MotionDetector
{
//detect motion in the frame, return true if the group is captured.
//frameToDispose is the frame that need be dispose, or for further process.
public bool ProcessFrame(Frame in, out frameToDispose);
}
소비자 (조각) :
: 이public void Foo()
{
bool groupCaptured = motionDetector.ProcessFrame(nextFrame, out lastFrame);
if (IsStaticFrame(lastFrame)) { lastFrame.Dispose(); }
else { imagesArray.Add(lastFrame); }
if(groupCaptured) { processImageGroup(imagesArray); }
}
나는 다음의 MotionDetector의 디자인으로 불편
- 이미지 그룹을 얻는 방법.
- 움직이지 않는 프레임을 처리하는 방법.
- 캡처 된 그룹을 클라이언트에 알리는 방법.
클라이언트가이 클래스를 사용하는 것이 더 쉽고 쉽도록 클래스의 인터페이스 디자인에 대한 조언을 해줄 수 있습니까?
당신이 불편 함을 느끼는 것은 정확히 무엇입니까? – AxelEckenberger
@Obalix, 내가 편하지 않은 것을 추가하기 위해 편집 됨. – Benny