Insight3D provides flexible image processing interfaces and built-in conditioners to dynamically perform many image processing tasks, such as adjusting brightness, contrast, and color levels, performing gamma correction, extracting and reordering components, and doing geometric transformations. More generic conditioners, such as the convolution conditioner, can be used to achieve a large number of effects, including sharpening and edge or gradient enhancement.
Insight3D supports reading several image formats: BMP, ECW, IMG, JP2, NTF, NITF, PNG, SID, TIF, TIFF, JPG, JPEG, PPM, PGM, CLDS, and TGA. Additionally, an image can be loaded directly from memory.
IAgGxImage image = new AgGxImage(); // The URI can be a file path, http or ftp location image.LoadFromURI(Program.uriLocalDataPath + "Imagery/ns3229b.jp2");
Once an image is loaded, a variety of information about the image is available from the Attributes member of AgGxImage.
Console.WriteLine(image.Attributes.ImageFormat); Console.WriteLine(image.Attributes.PixelFormat); Console.WriteLine(image.Attributes.Width); Console.WriteLine(image.Attributes.Height); Console.WriteLine(image.Attributes.BitsPerChannel); Console.WriteLine(image.Attributes.BitsPerPixel); Console.WriteLine(image.Attributes.RowStride);
Images can be conditioned and are commonly applied to primitives as textures. Both texture generation and caching, with synchronous and asynchronous reading of images from various sources, including FTP and HTTP, are supported.
IAgGxRendererTexture2D texture = sceneManager.Textures.LoadFromImage(image);
|
|
|
Satellite imagery before conditioning. Insight3D's built-in conditioners will be used to enhance the imagery. |
The AgGxConditionerSequence conditioner can be used to concatenate and efficiently apply conditioners sequentially to an image. Below, contrast, brightness, and gamma correction conditioners are configured and applied sequentially to the above image to improve its visibility. The ApplyInPlace method will apply a conditioner to an image directly. Alternatively, the Apply method will leave the original image intact and return a new image with the results of the conditioning.
// Add brightness, contrast, and gamma correction conditioners to sequence IAgGxConditionerBrightness brightnessConditioner = new AgGxConditionerBrightness(); IAgGxConditionerContrast contrastConditioner = new AgGxConditionerContrast(); IAgGxConditionerGammaCorrection gammaConditioner = new AgGxConditionerGammaCorrection(); brightnessConditioner.Adjustment = 0.3; contrastConditioner.Adjustment = 0.5; gammaConditioner.Gamma = 0.9; IAgGxConditionerSequence conditionerSequence = new AgGxConditionerSequence(); conditionerSequence.Add(brightnessConditioner); conditionerSequence.Add(contrastConditioner); conditionerSequence.Add(gammaConditioner); image.ApplyInPlace(conditionerSequence);
|
|
|
The initial satellite imagery after applying brightness, contrast, and gamma correction conditioners. |
Insight3D has a total of 16 built-in conditioners for a variety of image processing tasks. By providing generic conditioners such as AgGxConditionerConvolution, a much larger variety of effects can be achieved. Below, a convolution conditioner is applied to sharpen the color-corrected imagery above. Additionally, Insight3D allows a user to implement their own conditioners by implementing the IAgGxConditioner interface and utilizing the pointer and data operations provided by IAgGxImageData for working with a variety of image formats and types in a generic manner.
//Apply a convolution matrix to sharpen the image IAgGxConditionerConvolution convolutionConditioner = new AgGxConditionerConvolution(); convolutionConditioner.Divisor = 1.0; convolutionConditioner.SetKernel( 0, -1, 0, -1, 5, -1, 0, -1, 0); image.ApplyInPlace(convolutionConditioner);
|
|
|
The initial satellite imagery after applying the color correction and convolution conditioners above. |
See the HowTo for a variety of additional imaging and conditioning examples.