4 thoughts on “Homeworks 5 and 6: Image Processing”

In response to the question “For task 1, where is the SNR coming from? Are the Stat values relevant?”

We used an approximation for SNR in Homework 3, in which we selected a region that was approximately homogeneous and measured this region’s standard deviation. The idea is this: Let’s assume that we have Gaussian, zero-mean, additive noise. A histogram of the noise alone would show a Gaussian distribution around zero. Larger noise values would make the distribution appear broader. Therefore, we can quantify the noise component by its standard deviation. Let’s further assume, for the sake of having an example, that the standard deviation is 10, and we are looking at a completely flat region of the image whose mean value is 100. In the absence of any noise, the region’s standard deviation would be zero and its SNR infinity. If only a few pixels deviate a bit from 100, we’d still have a very low SD and a very large SNR. If we take the noise example from above (SD=10), we would see considerable “snow” with a SNR of 100/10 = 10.

Under these assumptions — we measure a homogeneous region, and we are dealing with additive, zero-mean noise — the approximation of SNR $\approx m/\sigma$ is fairly reasonable.

One student’s question prompted me to explain some cimage quirkiness.

Cimage is really intended for research, and as such it provides a lot of information — most of which you do not need. For example, looking at the corners of the ROI is a good idea (to match the ROI between images), but the area is completely without relevance. You also get mean and SD for all pixels that are not zero — this is often interesting for images that have been segmented, but is irrelevant for this work.

Really focus on those values that are relevant in this context (average, SD) and ignore the rest.

Color maps: An after-class discussion brought up a possible misunderstanding, which I think needs clarification.

In cimage, you can select color maps to manipulate contrast and brightness, or to display the image in false colors. It is important to know that the colormap adjustment does not change anything in the image — it merely changes how the image values are shown on the screen (their so-called photometric interpretation).

As such, adjusting the colormap is not really an image processing operation. It is a visual aid.

Side note: A half-exception to the rule is the “create” button, which clones the image as displayed. The cloned view is a 8-bit RGB image for use with charts or documents, and its image values have been rescaled from the original. However, the image values of the original image are still unchanged.

Since we have so little time remaining, I’ll show you the Fourier transform with enhanced contrast as I envision it. The diagonal peaks are analogous to what I showed you initially when I used sinusoidal intensity patterns as an example for the Fourier transform.

And another note: Dragging a rectangle is fine. You can also hover the mouse over a pixel and hit “c” to create a circular ROI (enlarge and shrink with subsequent “C” and “c”, respectively). This ROI can be fine-positioned with the arrow keys.

In response to the question “For task 1, where is the SNR coming from? Are the Stat values relevant?”

We used an approximation for SNR in Homework 3, in which we selected a region that was approximately homogeneous and measured this region’s standard deviation. The idea is this: Let’s assume that we have Gaussian, zero-mean, additive noise. A histogram of the noise alone would show a Gaussian distribution around zero. Larger noise values would make the distribution appear broader. Therefore, we can quantify the noise component by its standard deviation. Let’s further assume, for the sake of having an example, that the standard deviation is 10, and we are looking at a completely flat region of the image whose mean value is 100. In the absence of any noise, the region’s standard deviation would be zero and its SNR infinity. If only a few pixels deviate a bit from 100, we’d still have a very low SD and a very large SNR. If we take the noise example from above (SD=10), we would see considerable “snow” with a SNR of 100/10 = 10.

Under these assumptions — we measure a homogeneous region, and we are dealing with additive, zero-mean noise — the approximation of SNR $\approx m/\sigma$ is fairly reasonable.

One student’s question prompted me to explain some cimage quirkiness.

Cimage is really intended for research, and as such it provides a lot of information — most of which you do not need. For example, looking at the corners of the ROI is a good idea (to match the ROI between images), but the area is completely without relevance. You also get mean and SD for all pixels that are not zero — this is often interesting for images that have been segmented, but is irrelevant for this work.

Really focus on those values that are relevant in this context (average, SD) and ignore the rest.

Color maps: An after-class discussion brought up a possible misunderstanding, which I think needs clarification.

In cimage, you can select color maps to manipulate contrast and brightness, or to display the image in false colors. It is important to know that the colormap adjustment does not change anything in the image — it merely changes how the image values are shown on the screen (their so-called

photometric interpretation).As such, adjusting the colormap is not really an image processing operation. It is a visual aid.

Side note: A half-exception to the rule is the “create” button, which clones the image as displayed. The cloned view is a 8-bit RGB image for use with charts or documents, and its image values have been rescaled from the original. However, the image values of the original image are still unchanged.

More color maps: The color maps are helpful (if not essential) for Task 6 when it comes to visualizing the MoirĂ© patterns. Once you took the Fourier transform (Process -> FFT -> FFT), I recommend you chose “Log Abs Data” as log compression and then increase contrast. A good setting would be brightness 35 and contrast 20. I think it reveals a set of 4 diagonal peaks very nicely. At very high settings (brightness 63, contrast 44) you’ll even see harmonics close to the image corners. Those 4, or better 8, peaks need to be removed, because they contain the periodic artifact.

Since we have so little time remaining, I’ll show you the Fourier transform with enhanced contrast as I envision it. The diagonal peaks are analogous to what I showed you initially when I used sinusoidal intensity patterns as an example for the Fourier transform.

And another note: Dragging a rectangle is fine. You can also hover the mouse over a pixel and hit “c” to create a circular ROI (enlarge and shrink with subsequent “C” and “c”, respectively). This ROI can be fine-positioned with the arrow keys.