Content Aware Image Resizer / News: Recent posts

Speed Demon

Well, well, well. CAIR v2.16 managed to pull a rabbit out of the hat. I reworked my threading so that things remain persistent instead of destroying them after each seam. On smaller images, I found a speed increase of just over 50%. The larger the images, the less the poor threading hurt it, but its still above 20%. If I would have known that was such a serious issue it would have been dealt with long ago. Oh well.... read more

Posted by Brain_ReCall 2008-10-17

Not dead yet

I'm still around and still poking at CAIR. Speed increases will be coming, as well as a few changes, and possibly a few new features.

Hopeful wishlist:
* Put all internal maps into one, reducing memmove() overhead. This gave about a 5% speed boost.
* Make the number of threads a complier option (including energy map threads).
* Make the threads persistent to reduce OS overhead in creating and destroying threads over and over.
* Add a new averaging technique to also allow pixels above and below the pixels on the seem to be utilized.
* Make separate source and destination weight matrices parameters, rather than using the input as also the output as it is now.... read more

Posted by Brain_ReCall 2008-05-09

New developer and CVS

I would first like to welcome Jib to the developers staff. He provided a lot of the changes into v2.11. He also has an idea on how to optimize Energy_Map(), so those changes will be going into the next release.

The code is now available under CVS. This will make it far easier for me and Jib to collaborate on these upcoming changes, and it allows everyone to grab the latest-n-greatest.

Posted by Brain_ReCall 2007-12-01

Fixed it

I had a major slowdown going to v2.7 while enlarging. The problem was a function called Add_Weights(), which I didn't yet optimize. The function previously ran best with column-major layout, and switching over to row-major sent the cache misses through the roof. Fixed it, and did a little multi-threading to it for a minor boost.

I'm stuck at implementing Poisson image reconstruction, the last feature in the paper that I haven't implemented. If you're a math nut, and are willing to sacrifice some brain power, read this: read more

Posted by Brain_ReCall 2007-11-15

Something happened

The new version 2.7 I touted as about 25% faster than v2.6.2. Apparently, that isn't the case.
I have been performing all of my speed tests with the same image performing the same action. Just today I noticed that I lost some performance during enlarging, which for the most part I never pay attention to since I assumed performance boosts seen for removal will be seen for adding as well.

Right now I noticed a 20% speed reduction from v2.6.2 to v2.7. How going row-major has caused this I'm uncertain at this point. I noticed on my dual-core machine that one core seems to be stalling at about 50% CPU usage with v2.7, but under v2.6.2 they both are at full. ... read more

Posted by Brain_ReCall 2007-11-06

Compiling Tips and a Plea For Help

I did a little more performance analyzing, and on the tip from a friend I went and tried the Intel C++ compiler. Sure enough, after kicking on all of the fancy optimization switches to their max, I managed to get an additional speed improvement. Resizing with my standard test scenario (1024x678 image down to 800x600) I found about a 10% improvement with quality == 0 (from the 11-10 second range down to the 10-9 second range), and about a 20% improvement with quality == 1 (15 seconds down to the 12 second range). ... read more

Posted by Brain_ReCall 2007-11-03

Halloween Surprise

The new v2.6 release gives about a 15% speed boost. This, I believe, solidly locks it to one of the fastest seam carvers. Please let me know if this isn't the case. Resizing a 1024x678 image down to 800x600 now takes 11 seconds with quality == 0, and just about 15 seconds with quality == 1. CML now actually resizes logically.

Unfortunately, this release might mark a milestone. I'm running out of areas to optimize. As of right now, Energy_Map() consumes about 70% of the processing time. I will obviously devote most of my time in that area, but I'm not sure on how to squeeze out more performance as of right now.
My latest tirade involved using some SSE instructions, and although they work, I didn't receive any noticeable advantage. I was using a packed minimum operation, to perform four min_of_three() operations simultaneously. But, that operation works on floats, so another SSE instruction was need to convert the integers to floats and back again. SSE4 has an integer minimum, but that’s so new no one has a processor that supports it yet. Also, unaligned memory movement (or, conversely, no standardized byte-boundary declarations between compilers) pretty much shoots it down. I may look into it again, but I don’t expect the vast improvements I was hoping for.... read more

Posted by Brain_ReCall 2007-11-01

Latest and Greatest

A bunch of changes went through version 2.5. The biggest change was reworking how the CML worked internally, which gave speed improvements throughout. CAIR is now one of the fastest implementations that I can find, and with very low quality (such as just 5%, or 0.05), its still extremely fast but produces great results. It's almost becoming practical.

I also added a new feature, CAIR_Removal(), which attempts to automatically remove areas marked for removal and then return the image to its original size. From some of my simple tests it seems to work pretty well, but let me know how it goes for you.... read more

Posted by Brain_ReCall 2007-10-27

Seam Carving GUI

Gabe Rudy informed me that he has got a working GUI that now uses CAIR. See:

All that it needs is a faster CAIR backend, which the next release will be.

Posted by Brain_ReCall 2007-10-25

Version 2.0

CAIR has undergone a substantial remake. Internally, it no longer depends on the EasyBMP library. In fact, I only use EasyBMP to read and write files in my sample program. I'm now using an custom made template class for all internal matrices. This means, though, that a translator function will probably have to be written from whatever image system your using to the internal one CAIR uses.

BUT, CAIR has gained a 50% performance boost across the board. With quality == 1 and resizing a 1024x678 image down to 800x600 now takes about 41 seconds compared to the old 81 seconds. With quality == 0, thats down to 21 seconds from the old 38.

Posted by Brain_ReCall 2007-10-21

Just got here

This is a first time using SourceForge, so as time goes on I hope to get using the more advanced features such as CVS and the Wiki.

For now, version 1.2 is loaded up. I'm looking for a great GUI designer, so if you're willing, please contact me. I'd be more than willing to help get something to show the more flexible features that CAIR supports.

Posted by Brain_ReCall 2007-10-19

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks