- public void newCameraFrameAvailable(byte[] latestFrame, long timeStamp) {
+ //public void newCameraFrameAvailable(byte[] latestFrame, long timeStamp) {
+ public void newCameraFrameAvailable(CameraSmart _camera) {
// calculate the percentage of the image that was in motion
double percentMotion = (countMotion / count) * 100.0;
// calculate the percentage of the image that was in motion
double percentMotion = (countMotion / count) * 100.0;
// Check if a high enough percentage of the image was in motion to say that there was motion in this frame of data
if (percentMotion > MOTION_DETECTED_THRESHOLD_PERCENTAGE) {
// Motion detected so save timestamp of this frame to another buffer
timestampWriteLock.lock();
// Check if a high enough percentage of the image was in motion to say that there was motion in this frame of data
if (percentMotion > MOTION_DETECTED_THRESHOLD_PERCENTAGE) {
// Motion detected so save timestamp of this frame to another buffer
timestampWriteLock.lock();
timestampWriteLock.unlock();
System.out.println("Motion Detected (with percentage: " + Double.toString(percentMotion) + "%)");
timestampWriteLock.unlock();
System.out.println("Motion Detected (with percentage: " + Double.toString(percentMotion) + "%)");