Qt Access Webcam on Linux OS without downloading any package - c++

I am looking for some Links/Tutorials/Examples to Access my Webcam on Linux OS without downloading any packages.
Actually, I am working on a very compact OS (with already removed unnecessary packages).We are space conscious for this project.
I tried OpenCv (on other machine with full OS version) and it worked fine for me but its package is more than 100 Mb and in my project i cant afford that much space. Also, since many packages are already removed from this OS (to make it compact), I am unable to install Opencv on my machine to test it(Because of its missing dependencies).
So I wonder, Is there any other way to access webcam without downloading any packages??
Adding headers/files would be fine in my case.
Any help, suggestion would be really appreciated.
Thanks in advance.

To capture image on linux, without downloading any heavy packages is possible through command line using "uvccapture".UVCCAPTURE is in Kb size. And The two line code can capture image.
for example:
QProcess process
process.execute(/usr/bin/uvccapture -v -m -o"test.jpg");

Related

Arduino Sublime Text 2. I can compile but can't upload. Error "The system cannot find the file specified"

I have seen several questions answered about similar problems, but none that completely solved my problem.
I'm trying to upload a sketch in Arduino using Sublime Text 2.
Initially had trouble compiling the file, which could resolve adding the ways: C:\WinAVR-20100110\avr\bin, C:\WinAVR-20100110\bin and C:\ WinAVR-20100110\utils\bin to the path.
My problem now is that I can compile, but I can not upload to the board. When I tried to upload, the following message was sent:
"Binary sketch size: 1094 bytes (of a 32256 byte maximum, 3.39 percent).
Estimated memory use: 11 bytes (of a 2048 byte maximum, 0.54 percent).
[Stino - Done compiling.]
Uploading...
The system cannot find the file specified.
[Stino - Error 1]"
I am seen in the answers to similar problems that the problem is the environment variables to be placed in the path, but have not seen any case like mine, where only the compilation problem is resolved.
My OS is Windows 7.
Thanks in advance.
The problem is that the Arduino plugin is 1) ancient, 2) (barely) ported from a TextMate .tmBundle, and 3) only works on OS X. All of the commands rely on programs stored in /Applications/Arduino.app, which you obviously don't have on your Windows system. So, instead of using this plugin, you have two options: you can run all your commands through the Windows Arduino tools, or you can uninstall your current plugin and instead install the plugin called Arduino-like IDE through Package Control. I haven't used it, but it is much more up-to-date than the old one, and is cross-platform, meaning it'll work on Windows.

Inno Setup - Setup.exe works locally, but not as a download

I compiled my first program this with Inno setup for a python 2.7 script with connections to opencv and numpy. The setup.exe works perfectly on my computer locally. It installs, it runs, there are no detectable errors.
When i go to make the setup.exe available through github:
https://github.com/bw4sz/OpenCV_HummingbirdsMotion/tree/master/Installer/Output
I can download the setup.exe, but on the SAME computer, it won't install: Error reads, the Windows version of the software is not compatible with the version you are running, check with the system if you need a x86 (64) or 32 bit version.
This is confusing to me, since the program was designed on this machine, and i just need to distribute it. Do i fundamentally not understand what Inno Setup does, i.e that a user needs to do more than download the setup.exe. I can provide scripts if needed.
Can someone point me in the right direction.
Thanks,
Ben
It depends on github. In a quick way I found this link, hope it help.

OpenCV haartraining: Mergevec error: Input file does not exist or not readable

Following this tutorial, I've created my positive samples but need to merge them now, using mergevec. I downloaded the mergevec.exe binary file provided and got the two required dlls cxcore100.dll and highgui100.dll. However, when I run it like so:
mergevec samples.txt samples.vec
it gives me the error:
ERROR: Input file <filename> does not exist or not readable.
What should I do to fix this? My vec files are fine, because I was able to view them using the opencv_createsamples utility. So I know they're fine.
I ran into this issue as well and made a python utility that combines .vec files to avoid installing openCV again: https://github.com/wulfebw/mergevec
Hope it helps.
I was in the same situation as you few days ago so i'll try to help you out =P.
First of all i am interested to know where you found the mergevec.exe, because it isn't available to download anymore if i recall. I ask because i think that you might have downloaded an exe compiled on Linux. I had the same error when i tried to execute the mergevec, i had compiled on Ubuntu, on my Windows computer. Even with the 2 dlls.
As i explained it here , The mergevec from Naotoshi was originally made for Unix distribution, so under windows you will encounter a lot of problems. I first tried to do it on windows but i abandonned because it was too complicated and even with a full Cygwin installation i could not compile the mergevec.cpp.
What i advise you to do is to create yourself an Ubuntu virtual machine and to compile your own mergevec.exe. Once done you can copy your vec files in your virtual machine and merge them under Ubuntu. After this you can bring back the merged vec file to Windows if you want (It is better to not run the training under a VM: less computation power).
Here is what i did:
Installed VMware player with Ubuntu 14.0.4 (although i don't recommend it, still some bugs)
Installed OpenCV from the sources with TBB. There are a lot of tutorials, but the only one that worked for me is the OPenCV website, they are the more accurate on the libraries you mandatorily need.
I downloaded the GitHub classifier training and then I followed the commands given and it worked well.
If you encounter any library problem or OpenCV Installation issue don't hesitate i went through them too.

How can I install Qt onto another computer but in different directories?

I used the online download of Qt to install it on my desktop but now I also want it on my laptop and I am unsure of how I can do that without having to re-download. My internet connection is crap and I don't even know if the Laptop will allow me to considering that it is one issued by my school and not all downloads work. Please help! I tried copying all the files over to the laptop but now all the settings are weird because the computer I am using doesnt have (or allow access) to the C drive.
I've looked at where does an installed version of Qt store the paths.
It seems that you need to change the following:
Qt5.2.1/5.2.1/[compiler]/mkspecs/modules/qt_lib_[module].pri
In each of those files, change the line that begins with QT.[module].rpath.

Capture MacBook Pro iSight video with C++

I'd like to grab a frame from my MacBook Pro iSight in C++ and do some elaborations on it.
I already know how to do that in ObjC with QTKit, but is there any way to do the same thing in C++?
NOTE:
I tried to install OpenCV with macports, but the framework doesn't seem to support iSight cameras.
You could do that using OpenCV ( http://opencv.willowgarage.com/wiki/ )
And here is a sample code you can copy/paste to try it : http://www.geckogeek.fr/lire-le-flux-dune-webcam-camera-video-avec-opencv.html (article in french but code is in english)
You can also use the Integrating Vision Toolkit (http://ivt.sourceforge.net), which supports Mac OS X and Quicktime.
Here are the steps:
Install the Quicktime SDK, if you haven't yet.
Download the current version of the IVT and unpack the archive.
Set the flag 'USE_QUICKTIME = 0' to 'USE_QUICKTIME = 1' in IVT/src/Makefile.base
Run 'make' in IVT/src
Run 'make' in IVT/examples/CaptureApp
Run '../../files/make_app.sh CaptureApp captureapp' in IVT/examples/CaptureApp
Run the application, either by double clicking on the generated icon, or by typing 'open CaptureApp.app'.
If you have any questions, let me know (you can find my contact information on the IVT homepage). I also answer questions in the IVT Sourceforge forum usually quite fast.