Related Articles

Back to Latest Articles

Intensity Level Slicing With C# – Explore Image Processing

Andraz Krzisnik
Intensity Level Slicing With C# –...

In this tutorial we will be talking about intensity level slicing in image processing.

What is Intensity Level Slicing

It’s a process that highlights pixels in an arbitrary range of intensities. I created an example project that demonstrates this functionality.

There are two different themes this process can be applied. We could highlight our desired range of intensities and set those pixels to white and everything else to black. This way we would produce a binary image.

Another option is we highlight our range of intensities and leave everything else unchanged.

Intensity Level Slicing

Graph above shows intensities, horizontal axis show for input and vertical for output.

Left graph shows the first method we described, where we produce a binary image. As for the right graph we can see that only a certain range of intensities is changed in the output, while other intensity levels stay unchanged.

“a” and “b” represent the lowest and the highest intensity levels to be highlighted. Or in other words, they define the position and width of the intensity level band to be highlighted. We also need to define the highlighting intensity, to which our pixels will be changed to.

This process is applied in various different fields, such as satellite imagery and x-ray imagery.

Intensity Level Slicing Function

There are some things we need to provide for our function to work. We need to set intensity range by providing the lowest and the highest intensity to be highlighted. And lastly we need to set the highlighting intensity.

This code works for colored images too. Intensities are highlighted across all channels. Project also includes a function to convert color images into grayscale.

Entire project is available for download

Download Project

If you liked this project, let me know in the comments.

Is there anything you might add?

I’m always open for your suggestions.


Show Comments (0)


Related Articles

C# Tutorial

C# Tutorial: Contrast Stretching with Normalization

This post is a short revision of Contrast Stretch post we already worked on in the past. Where we talked about histogram equalization, which is a little more complex method than...

Posted on by Andraz Krzisnik
C# Basics

C# Basics – Exception Handling Statements – Part 9

Exception Handling Statements Sometimes, there comes a situation that where our code might crash. We can handle these kind of situations with exception handling statements. By...

Posted on by Andraz Krzisnik