C# Algorithm to generate image (2048x2048) from some images - bin-packing

What I would like to do is create an image (2048x2048 in my case)
The algorithm should work in this way:
-User select some images from a folder and tells my program "generate image"
-The program check if can put all images inside a single image (size problem), otherwise returns an error message
-The program find the correct way to put all images inside the image and then prompt the user to choose a savepath (obviusly old images shouldn't be resized/cut)
The problem is obviusly the last step, I don't have actually idea how to do it, also there is another thing the program should check, if an image filename is myimage_1 and there is a "myimage_2" those images should be put near eachother (obiusly same for 3,4 and so on)
Can someone help me with this?

it looks like a multi-dimensional knapsack problem to me.
More info here.
There may be of course simple solutions as I'm no expert on the domain and my algorithms classes are far behind me! It will perhaps help anyway to launch the thread :)
You could perhaps also solve this by adapting an easy greedy algorithm but it will of course not give the optimal solution and will then surely lead to some false negatives for your 2nd step.

Related

How to fix an "structurally singular" - error in a simple loop model (Dymola)?

My Problem is maybe a rather simple one. I want to build up a simple Model of a Flettner Rotor. So it is just a fixed SupportStructure with a Motor/Revolute (fixedBearing) on top, that spins a hollow cylinder around it. At the Bottom there should be a loose fit, which i am not able to model...
On the attached pictures you can see the built up model and an animation of it. It is possible to simulate it without the "RevolutePlanarLoopConstraint".
I have to connect both structures again to model a second loose bearing. Because you have to create a loop, i tried all joints and constraints like "RevolutePlanarloppConstraint". In my opinion it should work ;)
No matter in what combination, i wasnt able to built up this connection. There is always the same error...(picture)
I cannot use the Rotor1D or something else, because i want to replace the bodys with existing discretized beam models later.
I think it is a typical problem of a locational/loose bearing combination, and i hope one of you has maybe a simple solution for it:)
Sadly i dont have the reputation to post images...
Kind regards
Paul

Fastest way to capture what's on the screen in C

My goal is to write a program that would capture the screen in an efficient way.
Little twist, the screen will not be saved. My program will do various check on it (pixel's colors in some area.. etc).
The program will run in windows, and will need to take(and analyze) as many screenshot as possible per second, and will not be used in games. (That imply that I need the whole screen, like pressing prntscreen. It's not a problem if that fail in fullscreen game.)
All propositions are welcome, and I'd be glad to share any missing details.
Edit
As I wrote in the comment, capturing the screen for storing purpose is really common and easy to find.
I asked to be sure to not miss any method of capturing the screen without storing it at all.
The program will look the screen, take some decision then will quickly go to the next frame.
Perhaps look into SDL
A guick google returned this screenshot code for SDL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/2000-August/011387.html

Rapidminer Graph view suspected export bug?

As my question was remained unanswered in Rapidminer forum via this address :
my original question
I would like to propose it here again, please inform me if by any chance you know the answer.
I have noticed no matter what type of extensions we use for getting export (i.e. .pdf, .ps .jpg , etc), the export engine do like a screenshot of the current view instead of the whole output space, this has caused lots of issues for me exporting gigantic decision trees of my research.
Please someone advise me on this issue.
Best,
Amir
Use the log operator at the end of your process and configure it by the information you need. The log operator will save all results in a text file. Based on this file you can generate all your graphs at any time using rapidminer or gnuplot...
I find this way the best to save your time and memory space and also very easy to share in my opinion.

What preprocessing image techniques should I take in consideration before applying OpenCV's Viola-Jones method for face detection?

I am working for a project at school regarding face detection, based on a technique described by Viola and Jones 2001/2004.
I've read that the OpenCV has an implementation of this algorithm, and it works very good.
I was wondering if you have any advices regarding what techniques (pre-processing) to apply to the images before testing the existence of a face (eg. histogram equalization) ?
I basically used the code from this sample program from the OpenCV page and it worked very well for my masters thesis project. If you get bad results or your lighting is strange you can try a histogram equalization.
with a friend I did something similar too for an university project, and especially on low resolution video sequences it really helped to upsample the frame, doubling its size. It was my friends' idea, who had previously taken an image processing class. Although equivalent, things like decreasing initial scan window size, horizontal and vertical steps didn't produce the same result. In other words it may be better to work on larger images with larger scan windows than on smaller with smaller scan windows. Don't know exactly why.
Bye ;-)
I know its too late. But do go through this site as well.
It speaks of the common pre-proccessing required for the images. Equalising the image, Editing irrelevant content etc

How to find and tail the Oracle alert log

When you take your first look at an Oracle database, one of the first questions is often "where's the alert log?". Grid Control can tell you, but its often not available in the environment.
I posted some bash and Perl scripts to find and tail the alert log on my blog some time back, and I'm surprised to see that post still getting lots of hits.
The technique used is to lookup background_dump_dest from v$parameter. But I only tested this on Oracle Database 10g.
Is there a better approach than this? And does anyone know if this still works in 11g?
Am sure it will work in 11g, that parameter has been around for a long time.
Seems like the correct way to find it to me.
If the background_dump_dest parameter isn't set, the alert.log will be put in $ORACLE_HOME/RDBMS/trace
Once you've got the log open, I would consider using File::Tail or File::Tail::App to display it as it's being written, rather than sleeping and reading. File::Tail::App is particularly clever, because it will detect the file being rotated and switch, and will remember where you were up to between invocations of your program.
I'd also consider locking your cache file before using it. The race condition may not bother you, but having multiple people try to start your program at once could result in nasty fights over who gets to write to the cache file.
However both of these are nit-picks. My brief glance over your code doesn't reveal any glaring mistakes.

Resources