Bug -- Virtual Camera Watch Folder

  • I created a virtual camera (WATCH) using a watch folder. I chose WATCH as the cameraID in my Image Source. My app runs fine as long as there are image files in WATCH. However, if there are no image files in WATCH and I am running my app, the analysis engine crashes.

    I am using this folder as my way of choosing the images to run through my application. One use case is that the watch folder can be empty. I would expect that either no image is displayed or a message or icon is displayed in the image window indicating there is no image. The application engine should not crash regardless.

  • First, I'd like to make sure what you mean by "crash". The software should definitely not crash, and if it does, this is a serious bug. We were however unable to reproduce the problem without additional information.

    If you mean that the analysis engine stops, this is planned behavior. In the AB, you are single-stepping the program, which makes all image sources essentially software-triggered. If you click "next" or activate the continuous play mode, the AB is forcing all data sources to fetch the next item. If there are no images in your virtual camera folder, all the tool can do is to fail. In this case, the designed behavior is to stop en engine and show an error message.

    The way single-stepping is handled by the AB will change in VisionAppster 3.0. Meanwhile, you need to live with the fact that the AB doesn't allow data sources to produce data asynchronously.

  • If the analysis engine stops and needs to be restarted, for me that is a crash. In Builder, it is just an annoyance, but in Manager, when there is no image file in the watch folder, the application stops. Even if I put a new image in the watch folder, it does not recover. In that situation, I need to stop the application and restart it. It does not seem like a desired behavior, rather a lack of error handling.

  • In the help for Image Source, it states...

    triggerTimeout - The number of milliseconds the tool will wait for an image after a software trigger. If no image is received from the camera within triggerTimeout milliseconds, a run-time error will be generated. Setting triggerTimeout to zero makes the tool to wait forever.

    Even if the triggerTimeout is set to 0, when the watch folder is empty, the analysis engine stops, when it should wait for a new image. In Launcher, when the watch folder is empty, the engine appears to stop also. New images copied to the watch folder do not get displayed.

  • Thanks for the clarification. When handling bug reports, it is important that we understand exactly what happened. In our parlance, a "crash" means that the software goes down in flames. If makes a difference if the processing graph stops because of an internal error. Furthermore, it is important to know the exact steps you took so that we can reproduce the bug. Since you were posting this on the Application Builder forum, I thought this applied to it only.

    We agree that the stepping feature in the Builder needs to be improved, and we are working on that. When it comes to watching folder contents while running the app in the Engine, we need more details about the configuration of the virtual camera. Can you post a screenshot of camera settings in the camera configurator? This feature is automatically tested and we believe it works in general.

    The triggerTimeout parameter has no effect on this. If you are triggering the image source with another tool, the camera will be put to software trigger mode and folder watching won't work. Maybe you haven't changed the default frame rate of the virtual camera? If the frame rate is non-zero, the virtual camera will loop though images that exist in the folder at start-up.

    Edit: Actually, new images will be added to the loop, but if the folder is empty at start-up, no images can be found and the first timed trigger fails, causing a run-time error.

    To change the default frame rate, open the virtual camera in the camera configurator and change the frame rate to zero. Then save the settings and assign the saved parameter set to the camera.

  • I set the frame rate to 0 and this has solved the problem in Launcher. The engine no longer stops and images appear when I place them in the watch folder. The application even starts when no images are in the watch folder. This is exactly the behavior I was expecting.

  • Great 🙂
    We may consider making zero the default frame rate in a future release. It could be the least surprising value after all.

  • Can I used this code on my newly business website? I want to integrate it.

Log in to reply