Image Tools - Maple Help

Home : Support : Online Help : Applications and Example Worksheets : Applications : applications/ImageProcessing

Image Tools

 In this application we test the effectiveness of the image processing algorithms, manipulate the pixel intensities, and construct an edge detector using a convolution mask using the image shown.

Input Image

To test the effectiveness of the image processing algorithms, we use the following image. To view the image, click the View Image button. To use a different image, click the Load Image button.

$\mathrm{img}≔\mathrm{ToGrayscale}\left(\mathrm{Read}\left(\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/images/ship.jpg"\right)\right)\right):$

 $\mathrm{Embed}\left(\mathrm{img}\right)$

Histogram Manipulation

With the enhancements to the ImageTools package, we can easily manipulate the pixel intensities of the images. Starting with the already loaded image, we can plot the histogram of the pixels.

$\mathrm{PlotHistogram}\left(\mathrm{img}\right)$

By applying the $\sqrt{}$ function to all the pixels in the image, we adjust the histogram of the image. Note that by applying this operator, the pixel intensities no longer fit between 0 and 1. We must therefore also use the FitIntensity command to rescale the pixel intensities to fit between 0 and 1.





 Click the button above to see the effect of the transformation. The original, as well as the transformed image is shown.

We can plot the histogram of the original image and the modified image.

${}$

Similarly, we can apply the exponential operator. To intensify the effect of the exponential operators, we multiply the pixel intensity by 5 before applying the operator.



 Click the button above to see the effect of both transformations. The original as well as the two transformed images are shown.

We would like to take the image modified by the exponential operator and adjust the histogram so that the occurrence of all intensity levels are equally likely. First, we create a cumulative histogram of the image.

Now we want to use this cumulative histogram as a function that maps the intensity levels. We use the Spline version of the CurveFitting command to build a function from the histogram points.



Then we apply the function to the image and plot the histogram for both the distorted image and the equalized image.



Execute the command below to view the altered image.

 Click the button above to see the effect of the histogram equalization.

Edge Detection

Using a convolution mask, we construct an edge detector. First, we construct a Gaussian mask that will be used to smooth the image and reduce the effect of noise on the edges. Then, using one of several edge masks, we extract the horizontal and vertical edges. These edges are combined and a threshold operation is applied to extract the edges from the image.



 The convolution mask parameters can be set with the following controls. Surface Plot of the Convolution Mask Mask size Variance (${\mathbf{σ}}^{\mathbf{2}}$) Select the operator