OpenCV C++ simple object tracking - c++

I am completely new to OpenCV, OpenFrameworks, etc. My task is to trace a simple object (a drawing of a circle or a color bottlecap) and display a marker of any kind over the object in the video. I have searched very long and looked through many sites but there is no concise tutorial for a complete beginner, how to build, how to run, what to write and how to configure. Could someone please help me? I'm using Linux Ubuntu.

For setup opencv in eclipse refer this link:
http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_eclipse/linux_eclipse.html.
And for object detection first you need to train data for what you want to detect.For that refer these links,
http://docs.opencv.org/3.1.0/dc/d88/tutorial_traincascade.html#gsc.tab=0
http://docs.opencv.org/2.4/doc/user_guide/ug_traincascade.html
http://docs.opencv.org/2.4/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html#cascade-classifier
Hope this will help.

Related

C++ ImGui - Display a Gif or Video?

I am currently coding a winrate statistics menu for League of Legends (which got approved) using ImGui and I wonder if it is possible to display a GIF or MP4 on the Menu as a Preview or Usage Tutorial not from File/Memory but from an URL as I want to keep the File as small as possible for now.
You probably would have to use a filestream, downloading the file to tmp and then displaying it as a Texture?
I found a similar question, and I wonder if something since then has changed:
https://github.com/ocornut/imgui/issues/2680
Is it still required to use an additional GIF loader?
Are there any easy ways now to achieve that?
I am a bit (new) to ImGui and would be very happy about any reference source code (not to copy paste, just to learn it).
Thanks for any help :).

Using OpenCV in ARToolkit5 (Linux)

I wanted to know if anyone has managed to use OpenCV in the example codes given by ARToolKit5. I was wishing to use it mainly in the nftSimple example. But since the artoolkit5 code is written in C and using opencv in C is not easy, was wondering if anyone has any ideas, or could give me some sample code to start off with. Thanks in advance!
Check out https://github.com/artoolkitx/artoolkitx/tree/master/Source/ARX/OCVT this is the newer image tracker based on OpenCV and using jpeg image files.

C++: Writing images to video file independent of installed codecs

I'm trying to save a series of images (16 bit grayscale pgm) as video. The video has to be compressed. My program has to be independent of the codecs installed in the system.
My initial idea was to use OpenCV for this, unfortunately it depends on codecs installed in the system (unless I'm missing something).
I feel like there should be a way to compile an encoder (H264 or similar would be perfect) into the program or redistribute it as a dll with my program. I just can't find any good up to date guidance/examples.
I've been swimming in the deep vast ocean of AV encoding for a couple of days and would really appreciate it if someone could point me to a right direction.
Thanks.
As Ben suggests, it would be a good idea to use an established library in your code.
FFMPEG is probably the most used at the moment - it can be used on the command line, with a 'wrapper' program or the libraries it is built with can be used directly.
I think the last case sounds like the one you want - you can find documentation here:
https://trac.ffmpeg.org/wiki/Using%20libav*
Note the comment about disambiguation at the start - this is important to understand as the project lib and the library (which is what you want) are different things.
and there is some notes in this answer on how to build it into a program:
FFMpeg sample program

How to debug image processing projects on eclipse?

Here at work we have plenty of experience developing image processing applications for the TI DSP platform using an old version of code composer (CC 3.3). We are transitioning to the ARM platform using Eclipse (flavored and distributed by Xilinx).
In the old code composer, a feature we used a lot was to look was an IDE widget that could display a certain area of memory as a bitmap image. It had a properties grid where you would define things like size, pixel format and stride orientation to properly interpret the blob of memory as a picture. The tool also had some nice features like zooming, a grayscale counter, line profile, histogram and etc.
Is there something similar for eclipse? If not, how difficult would it be to create one? I mean, how difficult it is to create a barebones plugin for eclipse that draws information from a location of memory in a jtag interface?
Gdb can call python script. If gdb is used for debugging then please use this. You can use OpenCV or PIL or any image library to show the image.
Updated on 2 Apr 2014:
Let 'data' be the pointer to the image.
Inside gdb run "python data = gdb.parse_and_eval("data")". This will give access to inferior's memory pointed by data.
e.g., "python print(data[35])" will show the 35th element of 'data'.
As the image data can be read in python, it can be displayed or analysed.
Following links will help in getting things done:
http://www.cinsk.org/wiki/Debugging_with_GDB:_How_to_create_GDB_Commands_in_Python
https://sourceware.org/gdb/onlinedocs/gdb/Python.html#Python
Note: Please ignore the comment I added. Hit enter key before writing the actual info.
Hope this helps.
Eclipse has no such feature; personally, I work in a similar environment (image processing on a DaVinci architecture + Eclipse IDE). Writing a Eclipse plugin is not a overly complicated task - there a loads of tutorials(like this one). But maintaining it may become one. We have referece Code in QT so we don't need such features. but if you really want something similar I guess you can always do a memdump in a binary file and interpret hat as an image. As long as the format isn't anything spacial (e.g. you are dumping jpeg format) it should be fine.
That is a great idea for static objects but what if your memory is created temporarily on the heap or on the stack? Is isn’t it easier in dynamic environments (using openCV) just to put a three lines of code whenever you need to see some buf content as an image and use Qt to do image scaling and histogramming?
Mat I(h, w, CV_8U, buf);
imshow(“winname”, buf);
waitKey(-1);
I heard that the latest version of openCV highgui module has the options you talked about but I personally see only very limited use of it in a dynamic programming environment. And yet I visualize data all the time. Moreover, I like to interact with my images, for example, rotate them in 3D, click and get values, or to mark a certain segment. I guess it will be hard to do this with a specific plug-ins.
I just found this; haven't tried it yet:
https://github.com/cuekoo/GDB-ImageWatch
If eclipse is calling gdb, maybe there is a way...

OpenCV with uEye Cameras

I need to use OpenCV with uEye Ethernet Camera. The problem is that I wasn't finding some useful tips regarding some example codes.
The source code provided with the installation is really linked to MFC stuff which is not what I want. It's really complicated to get rid of that, it was causing me so much problems (CWnd, Afx, Dialogs...)
I would like to read some frames from the camera and record some snapshots.
You can find the whole SDK description here: https://en.ids-imaging.com/manuals-ueye-software.html
Just simply make and account and you can access it. The documentation is really good.
I found this document in the internet
http://master-ivi.univ-lille1.fr/fichiers/Cours/uEye_SDK_manual_enu.pdf