0

I need a video software that can make a picture every time when in the video (live, from camera for example) the picture is changed.

For example we have a scale so when there is nothing on it the picture is "frozen" but when we have something the picture will change to something so for the scale it needs about a second to get "stable" (the weight) so after that second I need that exact frame to be pictured and saved in some folder. So when the thing is taken of the scale the value will return 0 so another picture should be taken and so on...

I need a software that would take this pictures automatically. It is not important on what OS would be. If its for Windows fine. If Linux I will migrate but is also fine. I would be happy if its free but even if its paid I would like first to see that is the one I need (hopefully with trial or demo) and if so, then I will pay for it.

  • It occurs to me that if your example (the scale) is literally what you're trying to measure, a hard wait of exactly one second may be far less useful than you'd hope. If it takes me a bit longer to actually get the object on the scale than normal, or if I put it down more roughly than normal, it could take more than a second from the moment the object enters the frame to stabilize the weight. – CPerkins Sep 1 '16 at 13:18
  • So if one second is not enought that can be changed to two second for example if possible – Георги Даскалов Sep 1 '16 at 16:24
1

On Linux you should be able to code something yourself if you are using a simple webcam for the video. In a loop wait 1 second, then run a utility like fswebcam (usually a standard package in most Linux distributions), to take a single jpg or png picture, and then use ImageMagick to compare the last 2 images. Eg, if old.jpg and new.jpg are the 2 jpg files, then

compare -fuzz 10% -metric ae old.jpg new.jpg null:

will print a single number saying how many pixels differ between the images, ignoring small errors (eg 10%). When this number is sufficiently small your image is stable and you can use either of the images as the weight:

#!/bin/bash
rm -f new.jpg old.jpg
stable=0
while :
do    sleep 1
      fswebcam new.jpg
      if [ -s old.jpg ]
      then diff=$(compare -fuzz 10% -metric ae old.jpg new.jpg null:)
           if [ "$diff" -lt 100 ]
           then if [ $stable = 0 ]
                then echo "stable, first image"
                     stable=1
                fi
           else stable=0
           fi
      fi
      mv new.jpg old.jpg
done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.