I am using a 290MM and a 290MC together as a multispectral imaging setup for agriculture ( a bit off from what they are made for) and I need to have a window (or 2) open showing a live feed from the cameras. I have managed to set up the code to open the cameras, take a picture and save it but is there a way to get a live feed from the camera?
1) Write the stuff yourself. I once did that using Qt, worked quite well but cost me a lot of nerves. You create some display widget and draw an image within that. If you want interactive control over the program you probably have to work with signals and slots and possibly several threads, a main thread, a capturing thread and a display thread. You can look at the source code of various projects, but think of the licensing terms.
You could of course use some other GUI-Toolkit like GTK or TK, or work with opencv like you do, but there I'm completely lost.
2) If you know python, there is a python wrapper for the SDK. This might make the visualization easier.
3) If you like to live dangerously, you can try the julia wrapper which I wrote for the ZWO SDK:
You have to install julia, add the Makie package, my package and follow the given example. This runs at 20fps@1280x960 with my old USB2 cam and reaches about 200fps for small regions of interest. Currently there is no support for the raspberry (because I have none), but with your help I could add it in some minutes. Windows *should* work, but I haven"t tested it properly. If you are willing to invest a few hours, feel free to test
Then use openCV, it support to add to video stream to a new stream and show it in one window.
The attachment is a small example of my search, using opencv to display two videos in the same window. Hope it is useful.
- (2.9 KiB) Downloaded 48 times
From what I Understand of the example you sent me the two video files are read in here
CvCapture * pCapture1 = cvCaptureFromAVI ("First video address");
CvCapture * pCapture2 = cvCaptureFromAVI ("second video address");
How do I get from ASIGetVideoData to a video address. Do I have to temporarily save it to a file or can I use the pBuffer instead of the video address?
Mat frame(Height,Width, CV_16UC1);
long iBuffSize = frame.total() * frame.elemSize();
int iWaitms = ASI_EXPOSURE*2;
bool cap = true;
ASIGetVideoData(camID, frame.data, iBuffSize, iWaitms);
All videos are composed of continuous single-frame images.
So if you can get a continuous single frame images, then you will get the video stream.