GUI for computer vision app [closed] - java

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'd like some opinions please on a GUI for my computer vision application. I have written an application in C++ using OpenCV which captures video from a high speed camera, carries out some image processing on the images and displays the results to a HighGUI window. I find myself tweaking variables on a regular basis and have therefore decided it would be easier and quicker to tweak those variables using a GUI on the fly. I have a few options:
Create a Java GUI that can talk to my C++ computer vision app using sockets
Integrate my application within a QT GUI
Use native Windows calls (e.g. MFC)
Which do you you guys think is my best option, bearing in mind that the GUI or sockets must not detract from the performance of the image processing part of the application?
(My target OS is Windows)
Many thanks in advance everyone for your inputs.

I would consider option 1 or 2, 3 seams definitely the worst, because you have to write all related to gui code on your own and it will be not portable.
1. Instead of this option i would consider creating GUI in Java and putting whole c++ code into library and using it in Java or even using native c++ code in Java. This solution should be faster than sending data via sockets.
2. QT seams the best option - it has big community, lot of tutorials and partially is integrated with OpenCV(http://opencv.willowgarage.com/documentation/cpp/highgui_qt_new_functions.html). Another advantage is that application created with QT and OpenCV should run on many operation systems. Also you may use Qt Creator or visual studio qt plugin to create gui.

You really don't want to deal with platform native code on Windows. The API is archaic, just like MFC is.
I don't think there's any benefit to isolating the GUI in a separate process.
I'd suggest using Qt Quick. You can very efficiently display images from OpenCV by binding them to a texture on a trivial scene graph item. You get a fluid, modern user interface and performant integration with OpenCV at the same time. It all blends, so to speak.
The easiest way to integrate your variables with QML is by using model-view paradigm. You can expose the variables form C++ by reimplementing a QAbstractListModel. The variable's value could be bound to the edit and display roles. The variable's name can be exposed as an additional role, called for example name. It's then a simple matter to use a ListView in Qt Quick to display the variable list and allow it to be tweaked at runtime. You can easily have "fancy" delegates for your items, say sliders.

Related

What are the disadvantages of developing android using cross platform languages? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I started to learn android development in Java and followed that path up to now.
Nowadays there are many cross platforms development languages such as Xamarin, React Native and etc.
I know that I can develop for both iOS and Android in cross platform languages which is usually requested by customers to develop mobile app in these two platforms.
Now my question is what is the benefit for developing in native android and iOS platforms over using cross platform languages?
I think if I have not enough reason to stuck to native development, I could not satisfy my customer to develop their app in native languages and I need to migrate to cross-platform languages.
So I want to know are there any bold benefits for native development or not?
This is one of those endless debates in development. There are so many reasons to go either way.
Native Benefits:
Best possible user experience
Access to all the features of the os and hardware
Smaller and faster applications (especially UI responsiveness)
Often easier to maintain (no need to deal with platform bugs)
Quicker response to o.s. changes
Cross-platform Benefits
Faster development to access the larger user base
Easier development - no need to learn as much about each native system
Powerful integration options (Cloud, Security, Game Engines, etc.)
For involved UI, I suggest that building your UI to target the native platform and everything else to be cross-platform. It is important to understand how important the user experience is to the success of the app you are making. Something simple like accessing some data from the web and showing a chart will look fine in a cross-platform app. Doing advanced image manipulation will likely require native UI to feel right.
The bottom line is "it depends on the project"
It depends on your project requirement to develop native app or hybrid app.
Choose native development if
High performance
You want a fluid, high responsive user interface
The user interface should feel familiar to users on each platform
Your application needs full access to all device hardware and functionality.
Choose cross-platform development if
You want to develop a quick prototype to test and validate a simple concept
Your application has a simple user interface and has limited user interaction, such as listing and showing news content
Your user interface has limited scrolling and swiping and users will not be affected by a sluggish screen response
Your application does not process complex data or work with audio or video
Cross-platform development is not a silver bullet.
Taking decisions about changing from native development to hip frameworks and cross-platform tools, you need to understand specifics of implementing same features in terms of this cross-platform tools. And this can be a problem in itself, because you will need experience with cross-platforming.
Cross-platform tools are cool as in "it will be a single codebase", but in some cases they are not. Different OS means different UI / UX, services and underlining implementations, as they form according APIs. It is baffling to see a React Native project with different set of modules written for specifics of Android and iOS, just to understand that this exact project should have been written as separate native applications all along.
So, before developing, take a quick dive into specific cross-platform tooling you think will be the best and you will understand implications of using this tooling for your project.
So just use Kotlin. Kotlin is interoperable with Java and working with JVM, but also has native compiler for iOS. Of course development for both platforms makes some limits, but if you want to create cross platform application it may be useful for you.

Linux Deamon in C++ or Java? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have a Windows service written by another developer who no longer works with me. It was written in C# with .NET 4.5 requirements. Our solution is making the move to Linux and the daemon naturally needs to be converted.
My dilemma is what to rewrite it in? C++ or Java? The daemon is not complicated. It's simply a controller for our other applications to ensure if they crash or are killed they are restarted. Aside from that it performs health checks through a named pipe and is controlled via a password protected web socket via a separate management Tomcat web interface and writes all of it to logs.
Please put aside any suggestions of "write in what you're most comfortable with" I have a fair amount of experience and knowledge in both languages, and I'll learn whatever else I need to as I go. My concern is the feasibility and effort to accomplish everything I need. I don't have any particular time constraints, but if one language is a fraction of the time of the other then maybe that's a better solution.
Writing it in Java looks like the easiest solution currently, but writing it in C++ has the advantage of being native no-frills code. However, I haven't ever written any web interface or socket code in C++ before, so I do not know the effort involved with that.
To break down my requirements:
Linux
Web interface for control
Named pipe for communicating with client applications
Existing code needs to be heavily refactored
Is C++ or Java more appropriate?
Edit: added more info
Edit2: I guess I should have mentioned that the code needs to be heavily refactored anyways. It was originally written in such a way that renders it difficult to make changes and additions. So rewriting is a cleaner solution at this point. As I mentioned, it's not a large program. Just a controller service.
Porting the solution to .Net Core may the way to go. It will run on Linux (and Mac for all intents and purposes...) and most of your codebase may need minimal refactoring. The only concern is if .Net Core currently has the features you would need supported in the app. And, .Net Core is still in preview.

How to use other language libraries/frameworks with lua? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I really like Lua. It's like javascript without so many warts.
One thing I hate about Lua is the 3rd party support. Good luck finding any industrial-grade libraries or frameworks with Lua scripting - Unity 3d has javascript, but no Lua. Qt the same.
I'm wondering if there is a way to "bridge" an arbirtary Lua & some other application. Say, I want 2 programs running - Lua interpreter which handles all the fun stuff, and Java VM which recieves GUI information from Lua (and displays a Swing GUI) and sends user input to Lua.
EDIT: For clarification what I really really want.
From what I remember from CS101, every program has a standard input and output. Is it possible to have:
- Two programs running, 1st in the foreground (java VM), 2nd in background (lua interpreter). I mean, the 2nd one doesn't appear in the task bar. I'm not sure if that's possible, I'm no systems programmer :).
- Java stdin: gui description data + say, glCanvas or some other graphics data. Stdout: user input. Lua's stdin is joined with Java's stdout and vice versa.
I would thank for a code sample if possible.
EDIT: Nevermind, what I looked for was Inter Process Communication.
You can embed, for example, LuaJ in your Java app. Then you will be able to write any logic on Lua and some other things on Java.
Also, you can take a look on projects like kahlua and mochalua (both hosts on googlecode).

Making an executable with most Java code, but maybe another language added in [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have been looking everywhere, and being a novice at Java and lacking proper terminology it seems impossible to find this.
I assume the correct term is "wrapping", but looking at other Java applications, such as: Minecraft, and seeing how pretty the launcher is and custom buttons, it seems impossible to accomplish such a feat with JFrame.
Do they code their own sort of frame? I've heard that you can "wrap" Java code in like C++ to make the launcher, and after passing the screen is launches the game (minecraft.jar).
Also, how is the exe file created? That once it is run it checks for a patch from the server, that installs the necessary files in a given directory and checks there for save files?
Is it another language? if so which? Which do You recommend? A resource for learning all of this?
These are the main aspects that I've been struggling to learn as no one seems to ask a similar question as I.
Also, considering Java is cross-platform, my main targets are Windows > Mac, for now I can't be bothered to worry about Linux considering I'm already struggling so much here; so for now, how to create a Exe file, if need be, in C++ or any other language, then perhaps DMG for Mac.
You have a lot of things to consider. I would suggest that for now you use Java WebStart to launch your application. This gives you things like:
Easy distribution - put files on a web server somewhere and a JNLP file describing how to glue your files together.
No messing with EXE-wrappers and multiple distributions - this is in the standard Java installation.
Easy updates - just create a new set of files (don't update jars in place) and a new JNLP and thats it.
A sandbox without any effort. Full access to the machine needs code signing which these days is a moving target. Sandbox should be enough for quite a bit though.
Then when you find you have enough users to warrant platform-specific distributions, you can add these as needed instead of getting everything working up front, where you should be concentrating on your application instead.
If you do not want to go the JNLP route, there a number of tools which can do what you ask for.. my favorite is launch4j, which is easy to use via the launch4j-maven-plugin, see e.g. this launch4j-demo illustrating how to use it.
PS: Alternatives include http://sourceforge.net/projects/jsmooth/ or http://www.ej-technologies.com/products/exe4j/overview.html (.com). Note that similar Qs to this with more have been asked on How can I convert my Java program to an .exe file?, How Can I convert Java To Exe, Best free tool to build an exe from Java code?

Why java applets/javafx aren't widely used? (why I shouldn't use them for RIA) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Java is one of the best managed runtime technologies we have. It has very high performance VM which allows to achieve performance close to C. The amount of high quality open source libraries is incomparable to any other platform.
However, despite it was the first dynamic client side technology to appear in browsers (Applets), it isn't used widely now.
What are disadvantages of Java which make people use JavaScript + HTML5 or Flash/Flex instead of Java for RIA? Why should I use them despite they are not as pleasant for a programmer as Java?
"it isn't used widely now"
I disagree with this perception... some examples:
Mindterm is a Java based ssh freeware client supporting ssh2 can be run embedded as applet google for it
Mizu web phone is a Java and open standards based SIP VOIP client which can be embedded as an Applet -google for it-
OpenSignX is an opensource Java based document and form signing Java applet for PKI X.509 certificates. google for it
Coolsmile is a Java based IRC client that can be run as app or embedded Applet
-google for it-
JFTerm is a Java telnet client. Can be run as desktop app or applet. Supports telnet (23), ssl and ssh -google for it-
J3Dworkbench is a Java 3D game-design authoring tool. delivery via Webstart or as Applets
-google for it-
There´s also thevirtualheart dot org a Java based heart simulator
also an applet
or Geocaching browser (JavaFX) at canoo dot com
You cannot do everything in HTML5... for instance take a look at complex apps like JITSI (videocomerencing, voip app) or MuCommander -google it- or Sweet Home 3D, or Art of Illusion... all java-based. Java serves a purpose... and Microsoft and its friends have been trying to discredit it, replace it with something else, and it continues being relevant. ask yourself why. it´s because it serves a purpose and its level playing field software ecosystem is HUGE.
Do a seach of code dot google.com for Java-related projects... and see.
Plus, to the commenter above who says JavaFX has limited appeal let me remind you that Java is NOT ONLY a programming language but actually 3 things: a programming language, a runtime environment, and a level playing field software ecosystem. You can use Java libs without writing a single code of Java language ... using Jython (Python for Java), JRuby (Ruby on Java), NetRexx (open source Rexx on Java, see www.netrexx.org), xRuby (ruby to Java bytecode compiler) or Jabaco (Basic to java bytecode compiler)... just to name a few of the many JVM languages... http://en.wikipedia.org/wiki/List_of_JVM_languages
It can take a lot of work to create a high quality applet compared to the amount of time it takes someone to create a high quality flash application. Building a presentation layer can be tedious without the right tools.
Furthermore, Oracle/Sun gave up on applets a while ago. They still support them but are not actively trying to improve them. Oracle is currently putting all of its weight behind JavaFX. JavaFX is a technically viable solution and has the advantage of allowing you to leverage your Java knowledge. The problem is most web designers don't have much Java knowledge and don't want to bother with it so JavaFX has never been very popular. If a web language isn't popular it can annoy your users when they have to download plugins to use it.
Another thing to keep in mind is that Flash itself is also on the way out. If you're going to be developing and maintaining this project yourself then feel free to pick up JavaFX.
If you plan on hiring a web designer or you want to learn web design skills allowing you to get hired somewhere then your best bet these days seems to be learning a good javascript framework (e.g. JQuery) and picking up some solid HTML5 and CSS3 skills.
Google maps for mobile is a java applet "http://en.wikipedia.org/wiki/Google_Maps#cite_note-20"
I should think that says alot, the question is sort of a truism this prevents a constructive answer the question I'd try to answer is this "is java applets and javaFX widely used" as your question is based on a premise which we cant be sure of how you arrived at it. Java applets work on the web JavaFX on the other hand is more than just for building applets, a GUI isn't just an applet
I can just hope to add to your knowledge and help you re-assess your opinion
the below is from:
http://www.ibm.com/developerworks/web/library/wa-appmozx/
HTML is great for displaying hypertext documents, but terrible for displaying GUIs. Traditional Web-based applications use endless amounts of effort trying to shoehorn HTML into the look-and-feel of a traditional forms-and-menus application. That was never a purpose for which it was intended.
The addition of form elements to HTML (FORM) did little more than create a new way to implement thin-client block-mode applications in the style of the venerable 3270 terminal. Like the 3270, HTML provides batched-up form submission. Character-based applications ultimately gained efficient user-navigation systems, but that was all lost when GUI applications came along. Subsequently GUI applications added back their own navigation structures, using the mouse and widget feedback.
When HTML forms came on the scene, they copied the design of block-mode terminals, but without the tight navigation and without replacing it with a proper GUI equivalent. Under HTML, the user is left to guess which visual elements on a given page might be user controls and which are just decorations. Therefore, for GUI-driven applications, HTML isn't that great a starting point. That's the reason why Java applets were met with such positive market hysteria when they first appeared -- they presented an opportunity to provide a real GUI.

Categories

Resources