|
이미지 프로세싱(image processing)
이미지 프로세싱으로 많은 것을 할 수 있습니다.
그러나 이미지 프로세싱으로 할 수 없는 것도 있습니다.
이미지 프로세싱으로 할 수 있는 것.
고해상도 이미지를 처리하는 데 있어서, offset이나 dark correction, flat correction과 같은 일반적으로 사용하는 처리 기술을 제외하면, 이미지 프로세싱의 역할은 크게 두 가지로 나누어 볼 수 있습니다.
하나는 행성 이미지의 디테일에 대한 콘트라스트를 증가시키는 것이고, 다른 하나는 노이즈를 감소시키는 것입니다.
== 역주 ==
offset - 이미지의 위치를 이동시키는 필터.
dark correction - 셔터를 닫고 찍어서 만든 다크 프레임을 이용하여 다크 노이즈를 보정하는 것.
flat correction - 균일한 빛을 CCD 칩에 쬐여 만든 플렛 프레임을 이용하여 각 픽셀의 서로 다른 감도에 대한 보정 하는 것.
일반적으로 다음과 같이 계산하여 보정합니다.
(Raw frame-Dark frame)/Flat frame
행성 이미지의 디테일에 대한 콘트라스트의 증가
행성의 디테일은 일반적으로 행성의 밝기와 비교하였을 때 아주 작은 콘트라스트를 가집니다.
따라서 컴퓨터 화면에 나타나는 행성의 로이미지(raw image, 역주 : 아무런 가공도 하지 않은 원본 그대로의 이미지.)의 디테일들은 단지 하나의 회색으로 표시되게 되어, 거의 보이지 않습니다.
이것을 보다 선명하게 볼 수 있도록 하기 위해서는, 이러한 디테일의 콘트라스트를 증가시켜야 합니다.
여러가지 이미지 프로세싱의 알고리즘은 디테일의 콘트라스트를 증가시키기 위하여 모두 같은 방법을 사용합니다.
바로 이미지에서 높은 주파수 성분을 증폭하는 것입니다.
이것이 바로 이러한 목적의 알고리즘을 하이패스 필터라 부르는 이유입니다.
그리고 아마도 하이패스 필터 중에서 가장 유명한 것은 언샵마스크일 것입니다.
이 기술은 잘 알려져 있지만, 천체 사진에 이용하기에는 어렵습니다.
디지털 이미지 프로세싱에서 언샵마스크의 일반적인 원리는 다음과 같습니다. (MTF곡선이란? 참조)
- 처음의 이미지(빨간 곡선)에 적당한 정도의 로우패스 필터(가우시안)를 이용하여 흐린 이미지(파란 곡선)을 만듭니다.
이렇게 하여 높은 주파수 성분이 억제되었습니다.
- 이 흐려진 이미지를 처음 이미지에서 뺍니다.
결과(녹색 곡선)는 자잘한 디테일(높은 주파수)만을 포함하고 있지만, 매우 이상하게 보입니다.
그리고 이 이미지는 노이즈를 포함하고 있습니다.
- 이 마지막 이미지에 알맞는 계수(일반적으로 2와 10 사이)를 곱한 후, 처음의 이미지에 더합니다.
결과(검은 곡선)는 정상적으로 보이고, 또한 디테일(높은 주파수)이 증폭되었습니다.
이런 종류의 필터는 콘트라스트를 증가시키는 데 매우 효과적이지만, 몇 가지 부작용이 있습니다.
첫번째 : 기브의 효과
행성의 경계, 목성에서 위성의 그림자, 카시니 간극 등의 밝기가 급격히 변화하는 부분에서 문제가 발생합니다.
이러한 부분에서는 밝은 부분을 둘러싼 어두운 고리나, 어두운 부분을 둘러싼 밝은 고리가 나타납니다.
목성의 위성의 경우 이 효과에 의해, 위성의 그림자를 둘러싼 밝은 링을 쉽게 볼 수 있습니다.
그러나 복잡한 디테일에서는 이러한 효과가 잘 나타나지 않습니다.
이 효과는 잘못된 디테일이지만 실제의 디테일과 잘 분리되지 않습니다.
따라서 이는 이 필터가 적용된 이미지라면 언제나 나타나게 됩니다.
이러한 효과를 줄이는 유일한 방법은 이미지 프로세싱 필터의 사용을 최대한 줄이고, 가능한 한 높은 콘트라스트의 로이미지를 얻어내는 수 밖에 없습니다.
하이패스 필터의 또 다른 문제점은 노이즈때문에 발생합니다.
로이미지에서 노이즈는 주로 높은 주파수 영역에 위치합니다.
그리고 디테일과 마찬가지로 노이즈도 또한 하이패스 필터에 의하여 증폭됩니다.
신호에서 노이즈를 분리하는 것은 불가능하기 때문에, 둘은 똑같이 증폭이 되고, 결국 이를 구별해내는 것이 불가능해질 수 있습니다.
때때로 이러한 이미지가 더 자세하게 보인다고 생각될 수도 있겠지만, 더 나은 이미지(허블 이미지)와 비교해보면, 그것은 디테일이 아닌 노이즈였다는 것을 알 수 있게 됩니다.
따라서 노이즈를 감소시키는 작업은 다른 이미지 처리보다 먼저 해야만 합니다.
노이즈의 감소
행성이나 달은 대단히 밝기 때문에, 이들의 이미지에서 주로 보이는 노이즈는 대부분 양자 노이즈입니다. (다른 노이즈는 무시할 수 있습니다.)
양자노이즈는 대상 자체의 빛(신호)에 의해서 나타나고, 빛의 불연속한 성질에 기인합니다.
통계학적으로 로이미지에서의 노이즈의 평균 수준은 신호의 제곱근에 비례합니다.
그러므로 신호대잡음비 또한 신호의 제곱근에 비례합니다.
예: A/D 컨버터 포화수준(역주 : CCD가 취할 수 있는 최대 전자 수. A/D 컨버터의 비트 수에, CCD에서 한 번에 표출되는 전자 수, 즉 gain을 곱한 값으로 구해짐.)이 전자 50000개인 카메라로 찍은 행성 이미지에서, 행성 표면의 평균적인 밝기가 약 전자 30000개 정도라고 합니다.
이 이미지에서 노이즈의 평균 양은 약 전자 170개(역주 : 30000의 제곱근) 정도입니다.
따라서 신호대잡음비는 170(역주 : 30000/170)입니다.
64가지의 회색을 표현할 수 있는 모니터에서, 로이미지의 노이즈는 일반적으로 나타나지 않습니다.
노이즈의 크기가 한 단계의 회색의 차이보다 작기 때문입니다. (신호대잡음비 100이상)
그러나 위에서 언급했듯이, 노이즈는 하이패스필터에 의해서 증폭되어 확실하게 나타나기 시작합니다.
위의 예제에서, 만약 언샵마스크의 확대계수가 8이라면, 신호대 잡음비는 약 20으로 떨어지고, 노이즈는 모니터에서 여러가지의 회색으로 나타날 것입니다.
이제 노이즈는 뚜렷히 보이게 되고, 행성의 디테일과 섞이게 됩니다.
안타깝게도 하나의 이미지만으로는, 노이즈와 신호를 분리할 수 없기 때문에 노이즈를 줄일 수 없습니다.
그러나 양자 노이즈는 랜덤한 특성을 가지기 때문에, 이미지마다 서로 다릅니다.
따라서 네 개의 이미지를 합성하는 것은 신호를 4배로 증폭시키지만, 노이즈는 단지 2배로 증폭시킬 뿐입니다.
이제 신호대 잡음비는 2배로 증가하였습니다.
위의 예제에서, 10개의 이미지를 합성하면 이 비율은 3.3으로 증가합니다.
따라서 신호대잡음비는 합성된 이미지에서 560이 되고, 최종적으로 처리된 이미지에서 70이 됩니다.
결과적으로 이미지는 부드러워지고, 디테일은 더 잘 보이게 됩니다.
(그러나 과도한 이미지 프로세싱은 부작용을 초래합니다.)
아래의 이미지로 시험해 보겠습니다.
첫번째 이미지(위 왼쪽)는 목성에 대한 한 장의 로이미지입니다.
그리고 두 번째 이미지(위 오른쪽)는 15장의 로이미지를 합성한 것입니다.
모두 이미지가 부드럽고, 둘 사이의 다른점은 보이지 않습니다.
그러나 언샵마스크를 한 후(아래), 차이점은 확실하게 드러납니다.
두 번째 이미지가 첫 번째 이미지에 비하여 더 부드럽고, 노이즈가 없어서 디테일을 더욱 세세하게 볼 수 있습니다.
한 장의 로이미지 |
|
|
15장의 로이미지 합성 |
한 장의 로이미지 |
|
|
15장의 로이미지 합성 |
딥스카이 촬영에서는 언샵마스크나 이미지 복원(Ridcharson-Lucy, maximum entropy 등.)을 사용하기가 훨씬 더 까다롭습니다.
위에서 언급했던 부작용이 더 심하게 나타나기 때문입니다.
신호대 잡음비가 행성 이미지에서보다 낮아서 노이즈는 엄청나게 확대되고, 특히 별의 주변에 나타나는 어두운 링 때문에 이미지는 더욱 보기에 안좋아집니다.
다시 한 번 강조하지만, 이러한 문제를 피하는 가장 좋은 방법은 양질의 로이미지를 얻는 것입니다.
== 역주 ==
이미지 복원(Image restoration) :
어떤 대상에 대한 이미지의 질이 외부의 요인에 의하여 저하될 때, 그 원인을 이용하여 원래의 대상에 가장 근접한 이미지로 복원하는 기술.
Ridcharson-Lucy Method, Maximum Entropy Method :
이미지 복원 알고리즘 중의 둘.
일반적으로 Maximum Entropy Method가 Ridcharson-Lucy Method보다 더 강력한 효과를 발하지만, 안정성은 Ridcharson-Lucy Method이 더 높습니다.
즉 어떤 경우에는 Maximum Entropy Method를 사용할 경우 해가 수렴하지 않는 경우도 있다고 합니다.
이미지 프로세싱으로 할 수 없는 것
이미지 프로세싱이 영화의 특수효과와 비슷할 것이라고 생각하는 사람들은, 이를 천체 사진에 사용할 경우 안좋은 시잉이나, 광축이 틀어진 광학계, 안좋은 포커싱, 안좋은 가이드 등의 발생할 수 있는 여러가지 문제점을 모두 바로잡을 수 있을 것으로 생각합니다.
그러나 그것은 말도 안됩니다.
이미지 프로세싱으로는 망원경에서 보이지 않는 디테일을 만들어낼 수 없습니다.
이미지 프로세싱은 단지 이미지 안에 존재하는 디테일을 더 잘 보이게 하기 위하여 이미지를 변화시키는 것입니다.
필름 사진에서 안좋은 결과를 가지고 있는 네가티브 필름으로 좋은 사진을 얻는 것이 불가능한 것과 마찬가지로, 아무리 이미지 처리를 잘 하더라도 안좋은 로이미지에서 좋은 이미지를 얻는 것은 불가능합니다.
물론, 행성의 로이미지에서는 디테일들이 쉽게 보이지 않기 때문에, 그것만 봐서는 잘 찍혔는지의 여부를 눈으로만 구별해내기는 어려울 수도 있습니다.
그러나 처리 후에 이들의 차이는 매우 커집니다. (아래 그림 참조)
왜냐하면 이미지 프로세싱은 이미지로부터 디테일을 창조해낼 수 없기 때문입니다.
이미지 프로세싱에 아무리 노력을 기울여도, 망원경에 조금 기울인 노력만 못합니다.
대상으로부터 나온 양자가 CCD에 도달했을 때, 이미 주사위는 던져진 것입니다.
이미지 프로세싱을 사용하면 많은 것들을 할 수 있지만..
그러나 기적을 일으킬 수는 없습니다.
로이미지 |
|
|
로이미지 |
처리한 이미지 |
|
|
처리한 이미지 |
게다가 천체 이미지는 매우 민감해서, 강한 이미지 처리는 오히려 이미지를 망가뜨릴 수도 있습니다.
이미지 처리는 가능한 한 조금만 하는 것이 좋습니다.
이미지 처리를 하는 데 있어서, 아마추어에게 가장 필요한 것은 절제입니다.
허블망원경의 행성 이미지를 보면 이들에는 세세한 디테일까지도 자세히 나타나 있지만 매우 부드럽고 자연스럽습니다.
많은 아마추어 사진들을 망치는 요인중의 하나인, 과다한 처리의 흔적이 없습니다.
로이미지가 좋다면, 이미지 처리는 아주 살짝만 하는 것으로 충분합니다.
그러나 이미지 프로세싱 후에도 이미지의 상태가 별로 좋지 않으면, 그것은 처리 방법의 문제가 아니고 로이미지 자체에 문제가 있는 것입니다.
==역첨==
번역에 필요한 CCD에 대한 정보를 찾기 위해 제가 참고한 사이트 링크입니다.
CCD University
잡음과 CCD영상의 종류
이미지 복원
디지털 카메라 용어 설명
영상 처리 및 실습
동서대 영상 공학 강의 자료
몇 가지 기본적인 용어 설명
WHAT IS THE FUNCTION
OF IMAGE PROCESSING ?
There are many things that image processing can do...and some things that it cannot !
What image processing can do
In high resolution field, in addition to the usual preprocessing functions (offset, dark and flat corrections), the usefulness of image processing can be divided into two main functions: increasing the contrast of planetary details and reducing the noise.
Increasing the contrast of planetary details
On a planet, the contrast of details is generally small compared to the brightness of the disk. Then, a raw planetary image directly displayed on a computer display shows few details because close details occupy only one grey level. We need to increase the contrast of the details to make them clearly visible on the screen.
Increasing the contrast of small details is the aim of many processing algorithms which all act in the same way: they amplify the high frequencies in the image. This is the reason why they are called high-pass filters, and probably the most famous of them is unsharp masking. This technique is well-known but hard to use in astrophotography. In digital image processing the general principle of unsharp masking is (figure below, see What is a MTF curve ?):
- a fuzzy image (blue curve) is made from the initial image (red curve) by application of a low-pass filter (gaussian) whose strenght is adjustable; the high frequencies are suppressed,
- this fuzzy image is substracted from the initial image; the result (green curve) contains only the small details (high frequencies) but its appearance is very strange and unaesthetic (unfortunately, this image also contains noise),
- this last image is multiplied by an adjustable coefficient (usually between 2 and 10), and added to the initial image. The result (black curve) is an image whose appearance is "normal" but where small-scale details (high frequencies) have been amplified.
This kind of filter is very efficient but unfortunately it is not without its drawbacks.
First, the Gibbs effect: artefacts can appear in some areas of the processed image, specially where there are sharp variations of brightness: the edge of a planet, the shadow of a satellite on Jupiter, the Cassini division, etc...On these places, this effect can be seen as dark rings around bright areas or bright rings around dark areas. On details like the shadow of a satellite on Jupiter, the effect is easily recognizable by a bright ring around the shadow. But on more complex details this effect can be very difficult to detect. Nevertheless it can be present and create "false" details that are very difficult to separate from the "true" details. Unfortunately, since they are associated with real details, these artefacts appear in a same way on every processed image. The only way to reduce the risk of such an effect is to limit as much as we can the strenght of the processing, and it is possible only if the contrast is high enough in the raw image.
The other annoying consequence of high-pass filters concerns the noise. In a raw image the noise is mainly located in the high frequencies. Just like details that are amplified by high-pass filters ! Since it is impossible to separate signal from noise, both are amplified in the same way, and the result can be an image where noise and details are so mixed up that it is impossible to distinguish between them. Sometimes the image seems to be very detailed but a comparison with better images (like HST ones) show that actually it is dominated by noise ! This is the reason why noise must be reduced before applying any processing.
Reducing the noise
Considering the high levels brightness, in a raw planetary (or lunar) image the noise is widely dominated by the photon noise (in most of the cases other noises are negligible). The photon noise comes from the light of the object itself (the signal) and is due to the discrete nature of the light. In a raw image, statistical laws say that the average level of noise is proportional to the square root of the signal. Therefore the signal-to-noise ratio is itself proportional to the square root of the signal.
Example: on a planetary image made with a camera whose A/D converter saturation level is 50000 electrons, the average level of brightness on a planetary surface is about 30000 electrons. The average amount of noise in such an image is about 170 electrons. Then the signal-to-noise ratio is 170.
On a computer display with 64 grey levels, the noise is generally invisible in the raw image because its average level is less than one grey level (signal-to-noise ratio over 100). But, as seen before, the noise is amplified by high-pass filters and becomes obvious after such a processing. In the previous example, if the amplification coefficient of the unsharp mask is 8, the signal-to-noise ration falls to about 20, and the noise occupies several grey levels on the screen. Now the noise is clearly visible and it is mixed up with details.
Unfortunately, in a single image, noise cannot be reduced because it is not separable from the signal. But, thanks to its ramdom nature, the noise is different from one image to the next. Adding four images multiplies the signal by a factor of 4 and the noise by a factor of only 2. Then the signal-to-noise ratio has been multiplied by a factor of 2. In the previous example, combining 10 images multiplies this ratio by 3.3: its value becomes 560 in the composite image, and 70 in the final processed image. The image is very smooth on the screen, and the true details are more easily visible (again, beware of processing artefacts !).
Examine the images below. The first image (top left) is an single raw image of Jupiter. The second image (top right) is a composition of 15 raw images. Both are smooth, the difference between them is invisible. But after unsharp masking (bottom), the difference becomes clear: the second image is smoother than the other, and we can see more details because they emerge from the noise.
1 raw image |
|
|
15 raw images |
1 raw image |
|
|
15 raw images |
In deep-sky imaging it is even more difficult to use processings like unsharp masking or restorations (Ridcharson-Lucy, maximum entropy, etc...) because the undesirable effects described before are stronger. The signal-to-noise ratio is lower than in planetary images, so the noise is tremendously amplified, and the artefacts, specially dark rings aroud stars, give to the image an unpleasant appearance. Again, the best way to avoid these problems is to obtain good quality raw images.
What image processing cannot do
Some people, probably by analogy with special effects in movies, think that astronomical image processing is so efficient that it can correct problems at the telescope like bad seeing, bad or misaligned optics, bad focusing, bad guiding, etc... It is a legend. The role of image processing is not to invent the details that have disappeared at the telescope, it is to transform an image in the aim of seeing better the details inside...if there are details ! It is impossible to obtain a good processed image from a poor raw image, just like in astrophotography it is impossible to transform a bad negative into a good printing. Of course, because details are not easily visible in a raw planetary image, the visual difference between a good raw image and a bad raw image may be difficult to see. But after processing the difference between them becomes enormous because image processing cannot create details from scratch (see images below). The largest efforts of processing are not worth the smallest improvement at the telescope : when the photons reach the CCD, the die is cast ! Image processing can do admirable things...but no miracles !
Raw image |
|
|
Raw image |
Processed image |
|
|
Processed image |
Furthermore, an astronomical image is something fragile, and it is dangerous (and unuseful) to torture it to extract details. Image processing softwares are now so powerful that they look like Ferraris...but don"t drive them like Ayrton Senna ! Actually the best is to process an image as little as possible: the first quality of an amateur in this field is its moderation. Just take a look at the planetary images of the HST: they are detailed but very smooth and natural, no trace of the over-processing that damages so many amateur images. If a raw image is good, a slight processing must be sufficient for showing its contents. And if a processed image shows too few details, it is not a problem of processing but a problem of acquisition.