Turns out it was as simple as creating a public void PreviewImageUpdate() outside of the bg worker
private void t_processFrame_Tick(object sender, EventArgs e) {
// UpdateMotionDetectionPreviiw();
if (!_bw_frameProcessor.IsBusy) {
_bw_frameProcessor.RunWorkerAsync();
}
}
private void _bw_frameProcessor_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {
_bw_frameProcessor.Dispose();
}
private void _bw_frameProcessor_DoWork(object sender, DoWorkEventArgs e) {
UpdateMotionDetectionPreview();
}
public void UpdateMotionDetectionPreview() {
try {
GetImage = new Bitmap(screen.Bounds.Width, screen.Bounds.Height);
g = Graphics.FromImage(GetImage);
g.CopyFromScreen(screen.Bounds.X, 0, 0, 0, GetImage.Size);
if (motionDetector.ProcessFrame(GetImage) > 1.02 f)
pbDesktopFeed.Image = GetImage;
else
pbDesktopFeed.Image = GetImage;
} catch (Exception ex) {}
}
However, I do plan to take consideration in using a ScreenCaptureScreen() to relay this image to AForge video player to improve the over performance of the framerate since the PB update is too slow.