I am working with OpenCV with Visual "C++." I am new to OpenCV.
What I am hoping to find is an Image Viewer that works like a modeless dialog box so that I can display a continuous stream of images in it.
I was trying to use the OpenCV namedwindow function for this but it does not appear to be suitable for this task for the following reason:
Any viewer created with namedwindow goes out of scope when the invoking function exits and the user has to block with waitKey in order to prevent the viewer from closing immediately.
What would be really helpful is if there was a viewer window in OpenCV that persists until the user explicitly closes it and to which images can be streamed sequentially using imshow or a similar mechanism. Or perhaps, there is a way of using namedwindow like this that I have not discovered.
Just create the window in a scope that ends later.
Calling cv::waitKey(1) will give the window just enough time to update and continue running.
Related
I am using julius speech recognition for my application. I have one doubt regarding julius:
I have downloaded the latest version and was successful in using its lib and making it work. the problem I am facing is..once the app starts and I call the voice recognition function in my application...it takes the input from mic and displays whatever is said in the mic, but the function still continues to do so again and again. The control will never come out of that function. Here I am facing problem since the control is not returning back I am not able to proceed further. What I want is once the engine gets input from mic it should recognize and stop there.. which I tried to do by deleting the callback function but was unsuccessful.
Can anyone please guide me in this matter, what I need to do to get the desired output. It will be helpful for me.
As discussed in the same post on VoxForge:
You have a couple of choices: first to use the Julius -input control to get the sound data from a list of files (see the .jconf sample file), so that when the list (even if only length one) is exhausted then Julius stops. It is quite easy to record the voice input to a file and then feed the file into Julius. Second you can put a dialog manager in control. If you need more information on what a dialog manager does there are many posts on this forum on that subject accessible by a search.
The basic function of Julius is to start up and then keep on decoding input. When you get more experience you can run Julius as a server, and then tell the server to respond, not respond or shut down as required. It's more efficient than having Julius start and stop all the time.
When an avenue exists for a complex application to yield the required result by using an effective combination of options at run time, editing the application, while possible, might involve a lot of unnecessary work. The emphasis then shifts to passing the options correctly in whatever script is being used to access Julius.
I require my app to Scan barcode automatically , i have the barcodes, i have the app required, how can i make the App read physical bar codes using automation in appium,
In manual i can scan the code by pointing out the camera to an bar code.
I dont know how to do it while executing an test suite.
i got idea of placing Mobile device on an Stand, tripod and placing barcode in front of it.
But the problem is we can test only one barcode. i want to run for about 100-200 barcodes ans see app performance does not decrease, can any one suggest some ways?
This is a very interesting case. If you really want to test your app scanning the bar codes through camera then I think instead of looking for a solution through appium you have to look for a solution to exactly match your manual process.
You can click scan button using appium(I assume) - for example you can write a script to click on this button every 10 seconds.
Challenge is to point the camera to the next barcode as soon as first scan is complete. Possible solutions- I believe that all the bar codes can be captured in a file in a pc. Copy these bar code images in a ppt or using any other program so that these images can automatically displayed one by one.
Put your device in front of this pc as you are already planning to use tripod stand etc. Focus them on screen(may be first time you might need to do all these adjustments). Run your script. Do some trial runs. Synchronize the process with correct time outs. I think this should be feasible though really not the best way to automate this scenario.
I haven't tested it, but this blog post can be your answer http://www.mobileqazone.com/profiles/blogs/simulating-camera-in-android-emulator. If not, you can try bypass it by creating API to upload an image to your server instead of reading it from the camera. I think the impact on your QA will not change dramatically (besides, it's very easy and fast to check that part manually)
We do have an app that scans plenty of items such as bar codes plus tracking the dimensions of objects through the camera.
I read the idea of synchronizing images into a slideshow which is absolutely hilarious. The way I do it, is by using my own node server app with websockets that will toggle images through http requests. When this app is hosted in a laptop/ipad positioned exactly in front of the AUT, the test will have full control on which barcode to be shown at particular time frame.
No synchronization required at all and does the job.
It is a modified version of https://github.com/JangoSteve/websockets-demo
There's a Stackoverflow thread elsewhere that points out that Firemonkey has to display video through the primary thread. I am trying to use a DirectX camera to snag a series of images (in Win8.1 for now--other OS's can wait). So I use the SampleBufferReady and SampleBufferSync approaches in the Embarcadero example code (that just has a TImage on a form), but with enough changes that I never see anything. I need to do my display in a TImageViewer; pointing the tbitmap in the SampleBufferSync at that tbitmap is easy. But nothing displays. From a procedural viewpoint, pseudocode of what I want is
setup whatever
camera.startcapture
repeat
repeat until framecaptured {what SampleBufferReady should do -- only fire when ready}
Imageviewer.repaint {inside SampleBufferReady?}
inc(mycounter) {inside SampleBufferReady?}
until (mycounter>mylimit) or (user interrupts video input)
camera
One could add a ttimer to slow things down. What I don't "get" is
must I define my own TEvent to find out that the camera's snagged an image, or does this even already exist? I would have thought that SampleBufferReady would respond to the arrival of an image and I could process whatever inside that event.
to display an image in something other than a TImage, will I need to turn off the camera, paint the bitmap, then turn the camera back on? If so, will I need to have SampleBufferReady contain a command to turn the camera off? Boy, does that sound clunky!
Suggestions?
here is a complete code source that i test the c++ version that is same as pascal in term of function calls and mechanism, only the syntax differ:
download here the pascal version.
the code work fine for both android and desktop( i test the c++ version). so download, test and confirm for me the pascal code.
is it possible to use NetStream to publish the stage constantly to a FMS?
I have tried to attach a camera to the netstream which works perfectly. However I want to publish a stream showing the stage and all its elements / objects including the case where a user interacts with the elements and changes their position/appearance.
Thank you very much.
As I know it's not possible this way.
You can't use a custom input for the netstream to encode it.
You have to following options:
if you can reproduce the same elements on the other side, create an API, that only passes the interactions (i.e. drawLine(startX,startY,endX,endY), loadImage(url), etc). This way everything will be shown on both PC, with much less data traffic and CPU usage
if you have a very complex stage and somehow it's impossible to reproduce it on the other side, then you can create bitmap shots, and send them through FMS JPEGencode (not too nice)
use a webcam splitter that grabs the stage, and it can be a webcam source (not too nice)
Good afternoon all!
I'm experiencing a rather annoying issue with one of my current projects. I'm working with a hardware library (NVAPI Pascal header translation by Andreas Hausladen) in one of my current projects. This lib allows me to retrieve information from an NVIDIA GPU. I'm using it to retrieve temperatures, and with the help of Firemonkey's TAnimateFloat, i'm adjusting the angle on a custom-made dial to indicate the temperature.
As FMX defaults to Direct 2D on Windows, i can monitor the FPS with any of the various "gamer" tools out there (MSI Afterburner, FRAPS, etc).
The issue i'm having is that when i put the system into sleep mode (suspend to RAM/S3), and then start it up again, the interface on my application is blacked out (partially or completely), and nothing on the UI is visibly refreshing. I'm calling the initialization for the NVAPI library regularly and checking the result via a timer, but this doesn't fix the issue. I'm also running ProcessMessages and repaint on the parent dial and it's children controls (since i can't seem to find a repaint for the form or even an equivalent).
I tried various versions of the library, and each one presents the same issue. The next paragraph indicates that this was in fact NOT the issue, and that it's actually the renderer at fault.
I have one solution, but i want to know if there's something more... elegant, available. The solution i have involves adding FMX.Types.GlobalUseDirect2D := False; before Application.Initialize in my projects source. However, this forces FMX to use GDI+ rather than Direct2D. It works of course, but i'd like to keep D2D open as an option if i can. I can use FindCmdLineSwitch to toggle this on/off dependant on parameters, but this still requires me to restart the application to change from D2D to GDI+ or vice-versa.
What's weird about it is that the FPS counter (from FRAPS in my case) indicates that there's still activity happening in the UI (as the value changes as would be expected), but the UI itself isn't visibly refreshing.
Is this an issue related to Direct2D, or a bug with Firemonkey's implementation? More importantly, is there a better method to fixing it than disabling D2D? Lastly, also related, is it possible to "reinitialize" an application without terminating it first (so perhaps i can allow the user to switch between GDI+ and D2D without needing to restart the application)?
This is may be of the issues with FM prior to the update 4 hotfix - 26664/QC 104210
Fixes the issue of a FireMonkey HD form being unresponsive after user unlock - installing this might resolve the issue for you.
The update should be part of your registered user downloads from the EDN (direct link http://cc.embarcadero.com/item/28881).