5,693,062 members and growing! (18,258 online)
Email Password   helpLost your password?
Third Party Products » Product Showcase » Development Tools     Intermediate

"Hey! Is That My Car? How to Sharpen a QuickBird Satellite Image Using DotImage"

By Lou Franco

Atalasoft leverages their DotImage toolkit to manipulate color channels for the purpose of image enhancement, in this case satellite images. The article is a tutorial on image enhancement and it includes all source code and test images.
C++, C#, Windows, .NET, Visual Studio, ASP.NET, Dev

Posted: 13 Nov 2007
Updated: 12 Nov 2007
Views: 10,624
Bookmarked: 10 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
3 votes for this Article.
Popularity: 1.30 Rating: 2.71 out of 5
1 vote, 33.3%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
0 votes, 0.0%
4
2 votes, 66.7%
5
This article is in the Product Showcase section for our sponsors at The Code Project. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers.

This is a showcase review for our sponsors at The Code Project. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers.

Because the bandwidth to a satellite is limited, sometimes they send their imagery as a high-resolution grayscale image and a low-resolution color image of the same area. Pan Sharpening is a class of GIS image processing techniques that are used to combine these two images into a single color image. The resulting image will appear to be at a higher resolution than the original color one.

The general idea is to transform the color image so that one channel of the image is substitutable by the high-resolution grayscale image. Then after the substitution, perform the reverse transforms, if necessary, to obtain a high-resolution color image.

To make sure we're on the same page so far, let's talk about color and channels. In an 8-bit grayscale image, each pixel is given a value that represents the "brightness" of that point in the image. 0 represents black and 255 represents white. A color image is made up of multiple channels, each can be thought of as being a single grayscale image. The usual way this is done is to have three channels, one for Red, Blue and Green. To determine the color of a pixel, the three channel values for that pixel are combined.

Using image-processing software or toolkits, such as DotImage, it's easy to operate on channels directly. Replacing, splitting, re-combining, and individually shifting channels are basic image-processing commands.

To do Pan Sharpening, the idea is to find a channel in the color image that conceptually is the same as the high-resolution grayscale image that you have. Unfortunately, neither Red, Green or Blue channels are appropriate for this. So, before doing the channel substitution it's necessary to transform the color space so that the channels have a different meaning, with one of them being analogous to the high-resolution grayscale image.

A common alternative to RGB is the Hue, Saturation and Lightness representation of color. The Lightness channel is actually a pretty close match to what we'd find in a grayscale image. So if we transform the image to HSL color representation, and then substitute the L channel with the grayscale image, and then transform the result back to RGB, we should end up with a color image that has a higher resolution.

Here is some C# code using DotImage. First you need to load the color and grayscale image:

AtalaImage color = new AtalaImage("atalasoft-color.jpg");
AtalaImage gray = new AtalaImage("atalasoft-gray.jpg");

You need to make sure the color image is the same size as the gray:

if (color.Size != gray.Size) {
    ImageCommand cmdResample = new ResampleCommand(gray.Size);
    ImageResults res = cmdResample.Apply(color);
    color = res.Image;
}

Next you need to translate the image to HSL. To do this, I have created a command called HslConvertCommand to handle converting the image between RGB and HSL.

HslConvertCommand toHslCmd = new HslConvertCommand(true);
color = toHslCmd.Apply(color).Image;

Substitute the Lightness channel

AtalaImage[] channels = {null, null, gray};
ImageCommand replaceLCmd = new ReplaceChannelCommand(channels);
ImageResults res = replaceLCmd.Apply(color);
color = res.Image;

And convert back to RGB:

HslConvertCommand toRGBcmd = new HslConvertCommand(false);
color = toRGBcmd.Apply(color).Image;

Here is the original Color image (a satellite photo of Atalasoft World Headquarters in Easthampton, MA)

Screenshot - image001.jpg

And here is the higher resolution grayscale image

Screenshot - image002.jpg

After running this code, here is the resulting higher resolution color image

Screenshot - image003.jpg

Attached to this article is a basic channel editor written using DotImage and some images so that you can play around. All of the source for the project is also included.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Lou Franco


Lou Franco is the Director of Engineering at Atalasoft, a leading provider .NET ECM Imaging (ECMi) technologies.
Company: Atalasoft, Inc.
Location: United States United States

Other popular Product Showcase articles:

  • Getting Started With Silverlight
    This article explains a little of the history behind Silverlight, explores how it works, and uses inline XAML to reference content defined in an HTML file. It also talks about using VideoBrush and MediaElement to control the display of video content in Silverlight.
  • Optimizing Web Applications with AJAX and Spread
    FarPoint has developed leadership in the spreadsheet component marketplace with FarPoint Spread for Web Forms which is the high-end spreadsheet product for ASP.NET development. It is AJAX enabled and ATLAS tested.
  • Creating your first ASP.NET AJAX 1.0 Application
    This shows how to AJAX-enable an existing ASP.NET web page by using Microsoft’s ASP.NET AJAX Extensions. The UpdatePanel control provided by the framework makes it really easy to start with AJAX programming by defining the areas of the page you want to update independently without a full page reload
  • Tracing memory leaks in .NET applications with ANTS Profiler
    Mike Bloise, lead developer at Recognin Technologies recounts his experiences on a recent CRM project, built using C#, where he found himself facing severe memory leak issues and a very tight deadline.
  • PDF Forms and JavaScript - 100% .NET Class Library
    PDFKit.NET 2.0 is a 100% .NET component written entirely in C# for creating, manipulating and reading PDF documents and PDF forms. This article will focus on the form and JavaScript features of PDFKit.NET 2.0. I will show how to fill existing forms, create new forms and add client-side JavaScript.
Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 2 of 2 (Total in Forum: 2) (Refresh)FirstPrevNext
Generalimm....memberMichael Sync8:53 23 Feb '08  
GeneralArtifactsmemberWilli Deutschmann9:54 20 Dec '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 12 Nov 2007
Editor: Sean Ewington
Copyright 2007 by Lou Franco
Everything else Copyright © CodeProject, 1999-2008
Web15 | Advertise on the Code Project