Opencv java vs C++ in video capture
I'm creating a project that needs to capture live camera video feeds continuously all the time and does processing on each frame. Processing involves locating a particular object of interest when it is moving. i have done this project using Opencv java wrappers videocapture,BackgroundSubtracterMOG etc. I was successful in doing this and happy about it.
I have tested my application using 4 threads and each thread reading a different video and processing frames. my machine configuration is 4.00 GB RAM and 64 bit OS and Intel Core i5 . The results were not bad. i have not tested it yet on real time camera feeds though. In future we may have to increase number of threads based on no of cameras we use.
Recently i was questioned about speed overhead of reading videos using java compared C++.
i know there would be slight speed overhead while using Java wrappers compared to C++ calls.
1) but I want to understand how big is the impact and need a suggestion if i really need to switch to c++ esp for continuous capture of video frames as explained above and re-implement the same code in C++? . I'm completely new to c++ and i have to learn c++ and re-implement it again.
2) if i have to switch to C++, then why the video capture wrappers were provided in java ?.
3) And also I observed in java version that when i reduce the frame size of video captured the speed got improved significantly. so what is it really that impacts the performance in video capture?
This is very important for me right now. It would be very helpful if i could get answer ASAP . Thanks in Advance.
imho, unless you're doing something obviously stupid (like a lot of get() put() calls) you should not worry about the java wrappers being slower than c++
3) - sure, less pixels -> faster. but again, unrelated to java vs c++
I have this problem too. When i grab image from camera in 1280x720 size by c++, i take about 25fps. But by java, i can take only 9fps. This is very important for me to resolve rightly and quickly, low speed in java. thanks a lot. and I am waiting for a solution.
We moved to C++ due to different reasons. not using Java anymore. please see the above answer given by berak. I'm not from support team.im just user here..