Assuming the camera is stationary and the images are very good, you can find the differences between the two images using elemental subtraction. Using the OpenCV C ++ API, it will look something like this (note: this code has not been verified):
void FindDifference(cv::Mat src1, cv::Mat src2, cv::Mat &dst, int threshold) {
dst = cv::abs(src2 - src1);
cv::threshold(dst, dst, threshold, 255, cv::THRESH_BINARY);
}
threshold, , . , .
API- EmuCV, API .