Launch action when object is detected
Hello, great app!
I've been adding message boxes and recently a blinking LED when the object is detected. Everything works great when GUI mode is on, but when using --console my actions seem to be ignored?
Where can I insert my action so it would not be ignored in console mode?
Edit : I can't get autoScreenshot to work either in console mode
Hi,
In console mode, you may connect to FindObject::objectsFound() signal. For example here, we could connect the signal to a custom slot:
find_object::FindObject * findObject = new find_object::FindObject(guiMode || imagesSaved);
QObject::connect(findObject, SIGNAL(objectsFound(const find_object::DetectionInfo &)), myHandler, SLOT(blinkLED(const find_object::DetectionInfo &)));
Note that in console mode, a QCoreApplication is created instead of a QApplication. If you want to show QMessageBox, you would have to replace QCoreApplication by QApplication here.
To add custom code for console mode inside the code, this should be done in FindObject class, as MainWindow class is not used in console mode.
cheers, Mathieu
Awesome app!
Im not a good coder.. Any hints to add MP3 sound played when the object is detected?
Thanks in advance!
Well, with Qt 5 it seems possible to play a MP3: http://doc.qt.io/qt-5/audiooverview.html