Mike Chambers has posted a comparison between the performance of AS3 arrays and the new Vectors available in Flash Player 10. The results look good: he managed a 60% speedup. This is very exciting for us at CleVR, because of the potential impact it has on the Stitcher in particular. This uses massive Arrays and lots of nested loops which seem to be just the kind of thing that would benefit from this. I haven’t had a chance to do any benchmarking of my own (hard at work on CleVR Pro) but when I do I’ll post another entry.
Archive for the 'graphics' Category
I’ve had a few people contact me to ask about how to use clevrlib to resize images with bicubic or bilinear interpolation in Flash or Flex, so I’ll give an overview of how to do this.
The InterpolatedBitmapData class adds the methods
getPixelBilinear to the BitmapData class, which allows you to fetch the colour of a point that’s not on a pixel boundary. We use this when reprojecting the source images in the CleVR Stitcher, but it can work just as well for resizing an image. Bear in mind that bicubic is a lot slower than bilinear, and the quality improvement isn’t usually worthwhile. However, you’re welcome to switch to getPixelBicubic if you need to.
The basic method I’m using here for resizing is to loop through the pixels of the output image, getting the equivalent pixels in the source image. As these are found by multiplying by the ratio between the source and output sizes, the coordinates probably won’t be integers. Using regular getPixel would require rounding, and therefore give a jagged (aliased) output. The getPixelXxx methods let you pass them a Number, which needn’t be an integer, giving a much smoother result.
The sample code below shows a way of resizing an image using this method. The InterpolatedBitmapData should be created in the same way as a BitmapData, such as by
draw()ing a loader onto it. The example I’ve shown below is an Event.COMPLETE handler for a Loader. Code below the cut.
The CleVR Stitcher uses EXIF tags embedded in the source images to calculate how the images should be warped before stitching. There is a hopeless lack of standardisation in these tags, so we have to use several different techniques to support photos from different camera manufacturers. Sony is the worst, as they do not provide enough information to enable us to make the calculation. This means that we have to use a different method to make an educated guess. However, a bug in the previous version of the Stitcher meant that Sony images would not stitch at all. Thanks to a bug report by user benbreeze this is now fixed. I have also fixed another bug in the self-updater. You can upgrade to the new version here.
It’s been a while since the CleVR Stitcher was updated as I’ve been working on some other important projects. I also had a much needed holiday! Today I have released a new version that fixes lots of bugs which have been reported over the past month or so. It also makes some hopefully significant improvements to the stitching algorithms. If you had problems with poor stitches in the past, then give it another try as it should do better. The improvements are mostly related to common problems in panoramas that have been shot by hand without a tripod.
Thank you everyone who submitted bug reports. They have bee very helpful. This release should fix all of the most commonly reported problems. See below for a list of updates, and important information on installing the update.
On Monday, Adobe AIR was officially launched. Of course, we’ve been using the beta version of AIR for the CleVR Stitcher for over six months now, but it’s good to see it go 1.0. This means that we’ve also released a new version of the Stitcher, which uses the latest version of AIR. You can install it below, using the shiny new installer badge. It will update or install AIR for you if needed.
I’ve put up the CleVR AS3 libraries on RIAForge, where you can download them as a zip file, or use the svn repository.
The library includes a number of classes that we developed as part of the CleVR Stitcher. They include a set of matrix algebra classes, ported from the Java JAMA library. These let you do standard matrix algebra stuff, and includes support for singular value decomposition and QR decomposition.
There’s also some graphics classes. One is a subclass of BitmapData that adds bicubic and bilinear interpolation. Another is a class for calculating the histogram of an image, with methods to do histogram stretching. This gives results similar to “Auto levels” in Photoshop, or “Enhance” in iPhoto.
You will find them here. They’re released under the Creative Commons attribution licence, which basically lets you do anything with them, so long as you give credit somewhere. A link to clevr.com would usually suffice. Let me know if you have any comments, patches, or if you’re using it.
For the second release of utility code from CleVR Stitcher, the Adobe AIR panoramic photo stitcher, I’m offering our InterpolatedBitmapData class.
The class adds support for bicubic and bilinear interpolation to the Actionscript BitmapData class. It adds two public methods – getPixelBilinear and getPixelBicubic. You can call these with sub-pixel coordinates and it will interpolate the RGB value for that point. This should be useful for anyone doing more complex transformations than those offered by the Matrix class. I hope it will be useful to someone. Do let me know if you’re using it. As ever, a link back to clevr.com is appreciated but not required.
Download it as part of the CleVR Actionscript Library
Ramblings about CleVR, panoramic photography, Adobe AIR and Flex and other stuff related to CleVR.
Install the CleVR Stitcher to create panoramic photos for free.
You are currently browsing the archives for the graphics category.
- @font-face (1)
- Actionscript (13)
- Adobe (16)
- Adobe AIR (16)
- AIR (13)
- Ajax (2)
- Amazon S3 (3)
- Amazon Web Services (3)
- Apollo (7)
- AS3 (3)
- bugs (6)
- CleVR (32)
- clevrlib (2)
- CSS (1)
- design (1)
- downloadable fonts (1)
- Flash (13)
- Flex (10)
- fonts (1)
- graphics (9)
- hardware (2)
- Hotspot Editor (6)
- image processing (10)
- Java (3)
- math (6)
- maths (6)
- Microsoft (2)
- MXML (1)
- panoramas (29)
- photography (10)
- real estate (1)
- screencasts (1)
- Stitcher (24)
- Stitching software (23)
- support (2)
- tips (2)
- tutorials (3)
- video (2)
- Viewer (8)
- Webstart (2)