Showing text messages in augmented reality applications with ARToolkit - opengl

I would like to implement a simple AR desktop application. This application should first recognize a marker out of a set of pre-registered ones, and then, show on screen some particular information related to the detected marker.
I was thinking on using ARToolkit, even if it is quite old and not anymore supported.
Do you think ARToolkit is a good solution?
How can I show text messages on screen using ARToolkit?

I found an interesting article here http://mycodelog.com/2010/03/23/printw/.
It easily explains how to implement a "printw" function that works exactly like printf.

osgART could be helpful http://osgart.org/wiki/index.php/Main_Page

Related

Making a fancy looking window with messages stack

I try to make fancy looking messages viewer, where messages divided by formatting, other background of smth. similar. They need to looks like this - http://pastebin.com/GU1Lq087. What I found in wxWidgets to solve this problem, and why I can't use it:
wxHtmlWindow
Supports minimal HTML (a few tags). But big problem with this - html representation doesnt fill parent window. So element with width=100% will have 100% width only on standard window size. And even p tag doesnt have word wrapping (long long paragraph goes in one line with vertical scroolbar).
wxWebWiew
I need to have the ability to set generated HTML to it, but IE must to load some page first and I can rely only on IE background. It has some time to load page, even if I set HTML-string.
wxRichText
Most suitable for me. But I can't draw line like HTML's hr, or change background for the entire message block (to distinguish it from common background)
I need to show messages like this. But i didn't know how and which tool is better.
One way of achieving this would be using wxWebView with WebKit backend but I am afraid that Windows can only use IE's engine. However, there is project which allows you to use Gecko engine. I use WebKit for rendering chat in my application and it works really good (although I am using Qt). (http://www.kirix.com/labs/wxwebconnect.html)
You can always do it regular way - just create separate widget (I think it is called "frame" in wxWidgets) for single message. This way you get almost infinite possibilities. E.g. you can make "AbstractMessage" with virtual methods and then things like "AdministratorMessage", "MOTD" etc. will be a breeze.
wxRichText Most suitable for me. But I can't draw line like HTML's hr
Really? Have you looked at the docs?
( http://docs.wxwidgets.org/trunk/overview_richtextctrl.html )
Here's a couple simple ideas:
a. Write a line of blanks, underlined.
http://docs.wxwidgets.org/trunk/classwx_rich_text_ctrl.html#a333b2e675617ed2299cf91e7c0dbd0d8
b. Create an image of a horizontal line, display it using WriteImage
http://docs.wxwidgets.org/trunk/classwx_rich_text_ctrl.html#a1315611c0741d03e852ee26eba3a9d94
The funny thing is that what you want can be done using any of the 3 controls you mention. With wxHtmlWindow you just need to set its size correctly, with wxWebView I don't understand what your problem with it is at all and with wxRichTextCtrl you could just use separate controls for the areas with different backgrounds (you could almost certainly use a single control with different styles but using several controls seems simpler).

Launching external editor in GTKmm

i am writing (using C++ and GTKmm) a simple photo browser that is available on GitHub:
https://github.com/jjkrol/ZPR
Currently i am working on creating a button, which will allow user to open currently displayed photo in external editor (for example GIMP). Because of this, i have two questions:
Are there any examples of using Gtk::AppChooserDialog class? I couldn't find any and it's hard to start working on choosing the editor without them.
Most important question - i am thinking about a way to launch an application with photo in command line. The only solution that comes to my mind is using system() call to do something like this: system("gimp /path/to/current/photo.jpg"); , but it is probably not the best way of doing this. Anybody knows a better way? I would like to port my application to Windows someday and a more portable way would be great.
Thank you very much in advance.
Instead of system, you might want to use Glib::spawn_command_line_async. There are other similar functions that gives more control if you need it.
For examples, you might want to look the source code of an application like glom.
Thank you very much for answers, gpoo and ergosys! In the end i decided to use Gio::Appinfo as it looks more OOP-like. If anyone would face the same problem - this is what i have end up with:
Glib::RefPtr<Gio::AppInfo> editor = Gio::AppInfo::create_from_commandline("gimp",
"GIMP", Gio::APP_INFO_CREATE_SUPPORTS_URIS);
Glib::RefPtr<Gio::File> photo = Gio::File::create_for_path(
(*currentPhoto)->getPath().string());
editor->launch(photo);
Of course choosing the editor with Gtk::AppChooserDialog is not yet implemented.

How do I find a pattern on the screen?

I thought I would try out making a bot to play a game on a website for me. How can I read the pixels of the screen? My best idea so far is basically:
Take screenshot
Scan screenshot for other images (bit comparison of one row in image?)
Click somewhere on the screen depending on what image was found.
Loop a few times per second
If this is the best/easiest way to do this: How do I do these things? I know some c++ but I've only worked with CLI programs and text/file IO so far. If you can think of a better way please tell me.
Using something like C# you can take screenshots of the screen and convert the resulting image to a Bitmap to do this, but it seems to me that you'd be better off looking at the HTML page on the wire (lookup a tutorial on how HTTP works or run wireshark to see how the page is transmitted on the wire). This will almost certainly be easier for you.

help with type of window dialog resource needed

I am writing a windows program (no mfc) and need to output a status line to the operator every few seconds or so. I tried using rich text boxes but after so many hours it seems to hang up. Does anybody have an suggestions on what I can use instead?
People mentioned that my buffers might have been exhausted. I thought I had planned for that. After I had about 1000 lines displayed I would take the first 500 and remove them using the select and cut options in rich text boxes. I still ran into the same problem.
This question appears relevant, and this one too. But they don't give any concrete recommendations for an alternative to rich text boxes.
You might try the Scintilla control (scintilla.org) which does not appear to have any hard limitations on text size. It has a permissive license. It is used by many text editors such as Notepad++, Notepad2, Code::Blocks, FlashDevelop. I haven't tried it personally but there from the documentation it looks easy to use it in a Windows API application. Of course, it might be overkill for your purposes.
If you keep appending to the text in the control every few seconds for hours then you are probably running into some memory constraint on the control or the process. I think you would have this problem with any control you choose given update frequence and how long you're running the program.
Have you considered implementing a simple circular buffer for the content of the text box? Say only keep the last hour's messages. You could maintain a separate log file for history if the operator needed to go back in time for hours.
I ended up writing my own control to do this, essentially duplicating the Output window in Visual Studio. It was a success, but it ended up being much more code than I thought it would be when I started - I insisted on features such as auto-scrolling when the cursor was on the last line, select/copy, bold text, etc. It was backed by a std::deque so I could limit the number of lines stored for the window.
Unfortunately the code belongs to a former employer so I can't share it here.

Video mixer filter

I need to find a video filter in order to mix multiple video streams (let's say, maximum 4).
I've found a video mixer filter from MediaLooks and is ok, but the problem is that i'm trying to use it in a school project (for the entire semester) and so the 30 days trial is kind of unacceptable.
So my question to you is that: are you aware of a free direct show filter that could help. If this is not working then it means i must write one. The problem here is that i don't know from where to start.
If you need output to the display, you can use the VMR. If you need output to file, then I think you will need to write something. The standard solution to this is to write an allocator/presenter plugin for the VMR that allows you to get back the mixed video and then save it somewhere. This is more efficient that a fully software-only mixer filter.
G
I finally ended up by implementing my own filter.
The VideoMixerRender9 (and 7) will do the trick for you. You can set the opacity and area each video going into the VMR9. I suggest playing with it from within graphedit.
I would also like to suggest skipping that all together. If you use WPF, you will get far more media capabilities, much easier.
If you want low level DirectShow support, you can try my project, WPF Mediakit. I have a control called MediaUriElement that is similar to WPF's MediaElement.