Image enhancement
Scope
Although photoQuad was not designed as a full-featured image editing software, it ships with several image enhancement tools that correct color or brightness imbalances, and facilitate some advanced image processing operations. Should your source images do not need severe editing, photoQuad's image enhancement tools help minimize the need for an intermediate software between data acquisition and data processing.
The following image enhancement operations are currently supported by photoQuad:
Operation | Description |
Flip left-right | Flips the image about its vertical axis |
Flip up-down | Flips the image about its horizontal axis |
Rotate: 90o counter-clockwise | Corrects the orientation of the image by rotating it 90o counter-clockwise |
Rotate: 90o clockwise | Corrects the orientation of the image by rotating it 90o clockwise |
Rotate: custom | Allows the free rotation of the image by a user-defined number of degrees |
Brightness / Contrast | Corrects the exposure of the image by changing its brightness and contrast |
Color balance | Performs a global adjustment of the image's RGB color intensities |
Image decorrelation | Enhances color separation, thus making feature discrimination easier |
Reduce colors | Reduces the number of colors in the image |
Contrast equalization | Enhances the contrast in a uniform manner throughout the image |
Automatic image enhancement | Impoves image quality with a single click. Feeling lucky? |
Sharpen | Focuses the image and improves its clarity by increasing contrast between adjacent pixels |
Convert to negative | Produces a color-reversed image |
Convert to grayscale | Each color in the image is replaced with a grey that matches its lightness value |
Convert to black & white | Produces a binary (black & white) image via a user-defined lightness threshold |
Split channels | Splits the composite RGB image to its Red, Green, or Blue channel |
EXIF image properties | Shows image exposure information, time & date taken, camera details etc. |
Grab current state snapshot | Stores a snaphot of the image's current editing state; much like a "history" function |
Most of these options are available under photoQuad's "Image" menu.
Flipping is regarded as one of the basic image transforms, and what happens is that photoQuad produces a mirror-reversal of the source image about a horizontal axis.
Note: this operation only flips the image, not the analysis layers. Should the image requires flipping, flip it before drawing any layer-based analysis object.
Just like the "Flip left-right" operation, but the source image is flipped about a vertical axis.
Note: this operation only flips the image, not the analysis layers.
Rotates the source image by 90o counter-clockwise. Rocket science at its best.
Note: this operation only rotates the image, not the analysis layers.
Rotates the source image by 90o clockwise.
Note: this operation only rotates the image, not the analysis layers.
The source image is rotated by a custom amount of degrees in a clockwise or counter-clockwise manner, with a minimum resolution of 0.1 degrees.
Output image size
By default, free rotation maintains the original image canvas, which means that the rotated image is automatically cropped to the source image dimensions. Pixels that fall outside the boundaries of the original image are set to 0 (zero) and appear as a black background.
photoQuad's image rotation interface

rotated 20 degrees clockwise, cropped to original canvas

Output image quality
Whichever the case, photoQuad must perform some sort of interpolation in order to determine the final pixel values in the rotated image, which means that output quality depends on the interpolation's accuracy. Three interpolation options are provided, but all of them work in a fundamentally similar way: they find the point in the input image that the output (rotated) pixel corresponds to; they then assign a value to the output pixel by computing a weighted average of some set of pixels in the local vicinity. Options include:
Nearest-neighbor intepolation: the output pixel is assigned the value of the pixel that the point falls within. No other pixels are considered.
Bilinear intepolation: the output pixel value is a weighted average of pixels in the nearest 2-by-2 neighborhood.
Bicubic intepolation: the output pixel value is a weighted average of pixels in the nearest 4-by-4 neighborhood.
The number of pixels considered affects the complexity of the computation. Therefore the bilinear method takes longer than nearest-neighbor interpolation, and the bicubic method takes longer than bilinear. However, the greater the number of pixels considered, the more accurate the effect is, so there is a tradeoff between processing time and quality.
Note: this operation only rotates the image, not the analysis layers.
Frequently Asked Questions
Even with the crudest interpolation option (nearest-neighbor) is the output quality that bad?
No. Chances are that you won't even notice the difference.
This is a basic image brightness and contrast manual adjustment tool that allows under- or over-exposed images to be improved.
Adjusts the image's color balance to remove unwanted color casts, or to correct oversaturated or undersaturated colors. In simple words, it changes the overall color mixture.
An additional option is provided to maintain the original tonal balance, i.e. not change image luminosity while changing color proportions.
original image

output image feeling the blues

The primary purpose of decorrelation stretch is visual enhancement but not in terms of "looking nice". Decorrelation stretching enhances the color separation of an image with significant band-to-band (RGB channel) correlation, so that the exaggerated colors improve visual interpretation and make feature discrimination easier.
What happens
In a highly correlated image, i.e. in an image where objects have the same tone throughout (they all look look blue, gray, etc.) a 3D scatterplot of R,G,B values would look like a line. After decorrelation the scatterplot looks more like a cloud, i.e. the original RGB values are mapped to a new set of color values with a wider range. It's a technique adapted from satellite multispectral composite imagery where band-to-band correlation is often an issue, and works quite well in (problematic) underwater images too.
An example is given in the pictures below, where algae coverage is significant, however difficult to discriminate due to the overall blueish colors.
photoQuad's image decorrelation interface (original image)

output image at the lowest decorrelation level

strongly decorrelated image, where algae patches clearly stand out

Frequently Asked Questions
Do I loose image quality?
Yes, but not due to the decorrelation process per se. The procedure is demanding in system and memory resources, so photoQuad must temporarily downsample the source image, decorrelate it, and upsample it back to its original dimensions. Some information is always lost bothways (while downsizing and the inverse), so output image is lower quality than the input image.
Even if I do loose image quality, is it that bad?
No, or else this process wouldn't be implemented in photoQuad to begin with. The idea is to get an "artificial" image with exaggerated colors that makes object selection easier (e.g. for segmentation). Loosing a pixel or two here and there won't really affect the overall photoquadrat processing effort or the output descriptors.
Reduces the number of colors in the source image by mapping the original colors to a new (reduced) colormap.
Enhances the contrast of the image by transforming its pixels' values using contrast-limited adaptive histogram equalization. In English, it's an effective way to enhance the contrast in a uniform manner throughout the image.
What happens
The process operates on small regions in the image, called tiles, rather than the entire image. Each tile's contrast is enhanced, so that the histogram of the output region approximately matches the histogram specified by the "Distribution" parameter. The neighboring tiles are then combined using bilinear interpolation to eliminate artificially induced boundaries. The contrast, especially in homogeneous areas, can be limited to avoid amplifying any noise that might be present in the image.
contrast equalization interface

Impoves image quality (contrast and saturation) with a single click.
original image

auto-enhanced

Focuses the image and improves its clarity by increasing contrast between adjacent pixels.
original image

sharpened

Produces the negative of the original image, in which light areas appear dark and vice versa. The output is also color reversed, i.e. red areas become cyan, greens become magenta, and blues appear as yellow.
Produces the grayscale version of the source image, where each original color is replaced with a grey that matches its lightness value.
Produces a binary image via a user-defined lightness threshold. Pixels with lightness lower than the threshold are set to zero and appear black, the rest are set to one and appear white.
Splits the composite RGB image to its Red, Green, and Blue channel.
original image

red channel

green channel

blue channel

The Exchangeable Image File Format (EXIF) standard is used by various digital camera manufacturers to embed metadata information in the source image file, including tags about the camera model, date and time, image resolution, exposure time, focal length, etc. There are several problems related to this (not-very-standard) standard, but photoQuad does its best to meet the challenge. For more information about EXIF metadata attributes, see http://www.exif.org/.
image properties window

This is pretty much like a "history" function, but in its manual counterpart. During image editing, the user can store a snaphot of the image's current editing state, so that several states are simultaneously available during processing. The most recent snapshot appears at the bottom of the list, and snapshots can be added or deleted at will.
It only takes a click on the snapshot list to modify the main image accordingly, leaving the analysis layers intact.

Frequently Asked Questions
Does this function apply to analysis layers also?
No. Snapshots grab the color values of the image, not the superimposed layers. The idea is that some quadrat analyses may be easier to perform over different image states.
If I switch to a particular snaphot, are analysis layers affected?
No, they are two different things.
When clicking on a snaphot, the corresponding image enhancement action is applied instantly, much faster than the initial computation. Why?
Because a snapshot is not the particular settings you used to perform an image enhancement action, but rather the resulting pixel values themselves stored in the computer's memory. Thus, photoQuad does not have to perform the computations again, it only changes the pixel values accordingly.
Does this function affect system memory?
Yes. The bigger the image, the higher the memory drain. Consider that for a high-resolution color image of 4000x3000 pixels, each color component (R,G,B) is 12000000 numbers, which have to be somehow stored in memory.