CAIR - Content Aware Image Resizer is a high performance, multi-threaded C++ library that performs image retargeting by seam carving. Please see http://brain.recall.googlepages.com/cair for more information.
Be the first to post a text review of Content Aware Image Resizer. Rate and review a project by clicking thumbs up or thumbs down in the right column.
//CAIR v2.19 Changelog: // - Single-threaded Energy_Map(), which surprisingly gave a 35% speed boost. My attempts at multithreading this function became a bottleneck. // If anyone has any idea on how to successfully multithread this algorithm, please let me know.
//CAIR v2.17 Changelog: // - Ditched vectors for dynamic arrays, for about a 15% performance boost. // - Added some headers into CAIR_CML.h to fix some compiler errors with new versions of g++. (Special thanks to Alexandre Prokoudine) // - Added CAIR_Threads(), which allows the ability to dynamically change the number of threads CAIR will use. // NOTE: Don't ever call CAIR_Threads() while CAIR() is processing an image, unless you're a masochist. // - Added CAIR_callback parameters to CAIR(), CAIR_Removal(), and CAIR_HD(). This function pointer will be called every cycle, // passing the function the percent complete (0 to 1). If the function returns false, then the resize is canceled. // Then, CAIR(), CAIR_Removal(), and CAIR_HD() would also return a false, leaving the destination image/weights in an unknown state. // Set to NULL if this does not need to be used.
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. On a related note, I'm probably going to be shelving CAIR for awhile. I'm going to try to start CAVR - Content Aware Video Retargeting. CAVR will hopefully implement a few ideas from the doctors and bring seam carving to videos. I already have quite a few ideas for it. Perhaps the biggest challenge is finding a suitable video library that I can use for testing purposes (much in the same way I just use EasyBMP for CAIR). My requirements for a video library would be: - Open source C++ - Cross-platform - The ability to grab a pixel value from a frame - Read and write SOME kind of video format (I really don't care which, would prefer uncompressed AVI) - Easy to use If you have any suggestions, please email me at brain.recall@gmail.com
//CAIR v2.16 Changelog: // - A long overdue overhaul of the threading system yielded about a 40% performance boost. All threads, semaphores, and mutexes are kept around for // as long as possible, instead of destroying them every step. // - I stumbled across a bug in CAIR_Add() where some parts of the artificial weight matrix weren't being updated, creating slightly incorrect images. // - Comment overhauls to reflect the new threading.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?