PDA

View Full Version : Host for image algorithms: any ideas?



herman.tulleken
06-04-2010, 10:52 AM
Hi All,

I am busy with a tool set for automatically removing certain types of artefacts from images to be used for game textures (such as caused by inconsistent lighting when taking photographs, for instance).

All the algorithms are implemented in C++, for speed and above all, to have a small standalone app that does not require a big run-time environment.

The problem is now with a usable interface... I looked at making the tool into a Photoshop or Gimp plug-in. This is surely the ideal, but I cannot find enough information to get going on either these directions.

If possible, I want to avoid having to implement a GUI from scratch.

So I was wondering whether anyone has any ideas of some other solution...perhaps there are other image tools for which it is easier to write plug-ins, or some magic GUI library for C++ that is just as painless as a GUI in Java or C#. (Or perhaps you know how to write a Photoshop plug-in and can point me in the right direction).

Thanks!

ht

Necrolis
06-04-2010, 02:58 PM
Use QT for the gui, its free, open source, and best of all, its not platform specific, so you can build it for win/lin/mac etc. it also has a visual designer tool if you desire plus the VS intergration plugin is free now, which makes development easier under VS. or, you can jsut use C# for the gui, using p/invoke to interface with the C++ code compiled as a dll, and you can multiplatform it using mono(dunno if its supports p/invoke yet, iirc it does)

as for making the a PS plugin, the SDK's come with some examples last I looked, but this means people need PS to use the tool(and not many people have legal versions of PS, or even have PS).,its way better as a standalone tool imo(or even a lib, so other people can interagte it into their tools), but if your going to make it a plugin, try make it a gimp plugin, cause atleast thats free and open source, plus its not too bad as a tool.

nice tool idea btw, will be nice too see it when its done :> or you could post some screenies now (yes i'm a tool freak :P)

herman.tulleken
07-04-2010, 09:47 AM
Thanks for your reply. I did not know QT is now also free to use with windows; I will definitely check it out, especially if it has a visual designer.

The main reason a plug-in for PS or Gimp is preferable is because all the pre- and post-processing can then be done in one place. I looked at the examples, (which I could not compile, even though I have everything I supposedly need), but they are not as helpful...

In any case, I am downloading Qt now; I think it will do for now.

I'll post something on my blog soon, in the mean-time, here are some before and afters:

Defective image:
http://www.code-spot.co.za/images/hair2.jpg

Image with restored mean:
http://www.code-spot.co.za/images/hair_mean_91.png

The image above has some loss of detail in the highlights and shadows. Below is the first attempt to address this issue.

Image with adaptively intensified variance:
http://www.code-spot.co.za/images/hair_meanrange_99.png

As you can see, it compensates for loss of detail, but the variance of the entire image is increased beyond an acceptable level. I am still tweaking this.

Thanks again for your response!

Necrolis
07-04-2010, 02:46 PM
Thanks for your reply. I did not know QT is now also free to use with windows; I will definitely check it out, especially if it has a visual designer.

The main reason a plug-in for PS or Gimp is preferable is because all the pre- and post-processing can then be done in one place. I looked at the examples, (which I could not compile, even though I have everything I supposedly need), but they are not as helpful...

In any case, I am downloading Qt now; I think it will do for now.what sort of errors are you getting from the PS SDK?, QT has been free for a long time, so long as you don't profit off of it, but for most people that fine, and since nokia took it over its gotten even better(with the pay to use plugins becoming free) and the really good visual designer, the docs & examples are also the best you'll ever find, its just annoying to have to use qmake, but the VS plugin takes care of that :)


As you can see, it compensates for loss of detail, but the variance of the entire image is increased beyond an acceptable level. I am still tweaking this.

Thanks again for your response!looking really good, esp the stripping of what looks like glare/reflection of the light source :D

herman.tulleken
08-04-2010, 07:06 AM
Last time I used QT was for a varsity project a million years ago; then it was still free only on Linux, so I did not even really consider it now.

I can't remember which errors I got exactly when trying to compile the PS examples...some obscure thing that looked like it was not linking properly. I would have spend more time trying to solve it if I thought it would be worth it; at this stage I don't think it is.

herman.tulleken
16-04-2010, 07:30 PM
Necrolis, thanks again for pointing me to Qt; it looks like it's going to work fine.

It's taking much longer to implement the GUI though. One part is technical (I am still figuring out how to make all the C++ code compile, link and deploy together properly); the other is making it a usable tool---what algorithms to provide, what parameters to expose, etc.

In the mean time, there are some more examples of what the tool can do here (http://code-spot.co.za/2010/04/15/experimental-tool-for-removing-unwanted-artefacts-in-textures/), and the brave can also check out the command line version so long. It is still a bit mathy, and not very robust against bad input.

Any feedback is welcome, especially suggestions for features that you would find useful in a tool like this.

ht