WebCam Capture Performance in Java - java

I had implemented these solution for webcam capture in java (Sarxos API, JavaCv, Lti-Civil, OpenIMAJ, JMF) and tested on various processors i3 ( 4 GB RAM), i5 (4 GB RAM) , Core 2 Duo and Atom with different webcams.
I had noticed that in every system FPS as well as Refresh rate gets changed
I had been trying with Logitech C920 webcam as external cam.
I don't get why these changes happens. When I test Webcam with Logitech WebCam software It's performance of webcam preview remains constant in all systems even with high resolutions. On low resolution above mentioned Java API works well but when i try with high resolution such as 1920x1080 or 1600x1200 webcam preview comes with huge amount of lagging in low processors such as core 2 duo and atom processors.
Please provide your suggestion on this issue ?
Thanks

Related

Can I change java application heap size on my android smartphone?

I'm currently using a Samsung Galaxy A20s with a total of 2790MB ram.
the phone was originally developed for Android 9.0 Pie and it has been getting upgrades and I'm currently on Android 11 Honeycomb which is a good thing but the hardware on the phone can't keep up. my ram is always almost full and according to Droid Info app my Java Heap size is 192MB !!!. that's way too much!!
is there any way to reduce the heap size on my smartphone?
One way is you can root your smartphone and get almost full access for example remove factory installed apps, overclock your CPU, increase RAM etc. But rooting will void the warranty and also if your smartphone is uncommon, do it at your own risk !
Read more about it here
https://www.xda-developers.com/root/

Different CPU usage in Java VisualVM

In a game I'm making, I went to check why my FPS was throttling on my laptop in Java VisualVM. (I develop on my computer, which has better specs). What I noticed was that the function 'render()' in my Tiles class was hogging up most of my CPU time on my laptop. (See this picture for laptop CPU times)
Next, I went to check if this was the case on my desktop as well, since there is no FPS throttle there. The results on my desktop were as follows: (Desktop CPU times)
What struck me as odd, was that on my laptop, rendering the tiles seems to hog most of the CPU time, whereas on my desktop, the game loop itself takes up most CPU time.
I'm struggling to find an explanation for this. Could it be a hardware difference? And how is it that the render() method takes up more CPU time than the actual game loop (which it is a part of)?
Laptop specs:
CPU: Intel i7-7500U (4 core 2.70Ghz)
GPU: Intel HD Graphics 620 (Display) NVidia GeForce 940MX (Render)
RAM: 8GB
Desktop specs:
CPU: Intel i5-4460 (4 core 3.2Ghz)
GPU: NVidia GeForce GTX 760
RAM: 8GB

Simulate low RAM on android phone

does anyone knows how to simulate low ram on an android device?
I want to test my app with low RAM, but the emulator is too slow and i'd like to be able to test it on my HTC one running it only with 512 MB of ram.
Is it possible?
Thanks in advance
The android emulator can run really smooth if you have an Intel CPU on your machine. In order to use to create a smooth emulator, you'll need the following:
1 Install Intel HAXM on your computer. Available here
http://software.intel.com/en-us/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-microsoft
2 Create a new AVD in AVD Manager, and for CPU select Intel Atom (x86)
3 Make sure you check Use Host GPU option
4 Start the emulator. If everything is ok, you should see a message like this
One option would be create a non-swappable application that dynamically uses up main memory to maintain average available free memory ~= 512 Mb. By non-swappable I mean that it should not be swapped out of main memory by the kernel memory-manager at any time. In Windows this is done using a VirtualLock (http://msdn.microsoft.com/en-us/library/aa366895%28VS.85%29.aspx) that prevents a memory region from being swapped out. Not sure how this can be done in Android though...

mulitple cameras at the same time openimaj

I am currently working on an image processing project using Java OpenIMAJ library. I need to grab frames from multiple cameras (using Logitech C270 USB Webcams right now) to perform manipulations on the grabbed frames.
I have hit a snag right now. I am able to add 2 cameras when both are running at 640X480 resolution and 3 cameras when the resolution is reduced to 320X240 for all three.
But I need to read the outputs from at least 5 cameras at reasonably good resolution to correctly perform my operations. Is this a limitation on the part of the hardware I am using or a software limitation?.. I have listed some details that I believe could help. Do let me know if you need any further information.
Windows 7 Professional 64bit
JDK 1.7
OpenIMAJ v1.1
Pentium Dual-Core E5700 # 3.00GHz
4GB RAM
No dedicated Graphics
Webcams are connected to USB 2.0 ports
(Windows Experience Index 4.1)
Exception thrown for 3rd camera at 640x480 resolution is
org.openimaj.video.capture.VideoCaptureException: An error occured opening the capture device
Any comments on why I am getting this limitation would be very helpful.
Thanks in advance
In all likelihood this is down to a hardware limitation; streaming from multiple cameras tends to saturate the USB bus. We managed 6 cameras on two separate busses at 320x240 resolution on a single laptop before: http://blog.soton.ac.uk/multimedia/2011/08/01/goggles/

Android Virtual Device super slow - pc too slow?

if I wanna work/test with my AVD, the Android emulator is super slow, barely usable. Im developing with eclipse and was just about testing a helloWorld app., but the whole thing runs too slow. Is it the hardware of my pc?
details:
AMD Athlon 64 3500+, 2.21 Ghz
2 GB RAM
Windows XP
I know its kinda running with coal, but actually, its just a phone emulator. What is your opinion?
I had the same problem. The emulator was slow as hell. You can significantly speed it up by changing the heap size allocated to it in AVD manager. Go to AVD Manager -> Select your device -> Click on "Details" button. The heap size will most probably be 24 or 48 (vm.heapSize: 24). Here's how you increase the heap size.
AVD Manager -> Select device -> Edit -> Hardware section (same window) -> Select "Max VM application heapsize" property -> Double click and edit the value to 512 or higher.
Restart the emulator (if already running).
It is just a very slow emulator. The best option is definately to test on a real phone.
I am using Intel Core2 Quad # 2.33HZ, 2.33Hz with 3GB of RAM. It take about 20 seconds to upload the app after making changes. You must upgrade your PC in order to test your apps on emulator. If you have android device, then good. Your PC will work fine.
Like cjk says, the emulator is incredibly slow. It fully emulates the core ARM architecture and can only be single threaded. Best you can do to help it is assign it to a lesser used core and increase the priority/niceness of the process.
I had the same type of specs on my computer while developing, indeed the emulator is too slow to work with. What is your screen resolution? In my case connecting to a monitor sped up the emulator, really lame..
My LCD's current screen resolution is 1600 * 900 and I am using Windows 7. Its working fine.
I have a macbook air (not very powerfull), the emulator was too slow. It was because the in the Emulation Options Use Host GPU was ticked. This might also help. its fine with:
Device: 3.2" QVGA
target: level 8
Memory Ram: 512
Heap: 128
Emulation options: not ticked.
hope it helps

Categories