2013年10月10日 星期四

如何自動對焦 partⅡ所需要配備

說到天文攝影,最傷感情的就是花錢了!但花錢,通常也是解決問題最快的方法....就像人一出生就要花錢,睡覺也要花錢(吹電扇冷氣),上廁所也要花錢(除非你不沖水與擦屁股)....自動對焦要花多少錢?

最低消費一萬四至二萬多!還不包括給歪果仁的馬伕費(運費)與中華民國大哥的保護費(關稅)!如果你衷愛日本貨,那個β-SGR,合台幣約六萬多.....@@

有同好問我說:我現在有電動對焦了(DC MOTOR),但我想要來試試自動對焦,口以嗎?(裝可愛...)

我問說:「請問你用的是菜頭嗎?」(菜頭→蘿蔔的台語→ROBO→ROBO FOCUS)

他說不是,是一般的電動對焦。我就說那就沒辦法用FOCUSMAX了!因為FOCUSMAX它的原理是需要有步進馬達,可以顯示絕對位置,FOCUSMAX就用測得的星點大小與相對位置,來做成V-CURVE,由其中的斜率,找出最佳的焦點位置!

因而目前看來最便宜又實用的,就屬ROBOFOCUS!(以下簡稱菜頭)

不過選菜頭的話,第一個遇到的問題就是它的馬達好沈!會影響鏡筒的平衡。通常都得讓馬達朝上,這樣就調鏡筒前後就可以平衡。

第二個就是它的馬達固定架,也是它最讓人討厭的地方!原廠都是附一個軟趴趴又讓人傻眼的金屬片,中間車了幾個溝,讓你固定馬達!通常都還得要自己彎鐵片...遇到要彎90度的...我怎麼彎啊?

固定好後,馬達轉動時當然都會2266的亂跑。要向人買專用架子也不見得買得到,最後我就自己做了!

自製的原理也很簡單,通常都是從對焦座下方的螺絲,找兩個點,然後再用L型鐵片(固定椅子用的)延伸出來給馬達來固定。不了解的話就找網路上人家怎麼固定的圖片,自然就可以明白了。

再來就是要有對焦馬達與對焦座轉動軸的「轉接傳動環」,這個環其實並不難做,就拿馬達與對焦座(把手轉輪拆掉只剩軸心),拿去讓鐵工廠做一個鋁製的環就好,一個約三百元左右,兩端各二個沈牙內六角螺絲,就可以緊緊的固定方便傳動了!

硬體部分固定好後,你可以試轉看看,主要是前進與後退可以順利帶動調焦座,還有換方向時,馬達架不太會移動(會稍微扭曲一點點),當然,你可以用厚粗一點的架子,不過重量會相對增加。

最後,就是最頭痛的軟體相容性問題!很不幸地,菜頭能夠穩定的操作,需要英文版的作業系統!否則它不是會跑得很慢,就是亂跑,要不就是斷線!

有的人是說把系統語言區設為英文即可,我試過也沒有用...

目前我是用USB轉RS232+菜頭,系統很容易跳掉離線,所以要關掉控制盒開關+拔除USB轉RS232後,再重開重插一次讓它連線→趁此讓它對焦→20秒內對好搞定。

其實自動對焦也是和GOTO一樣,幾乎就是弄好了就沒有用可以關掉了!要對就是它可以幫我工作就好了!不像自動導星都得一直不斷的跑,這個就沒有斷線或跳掉的餘地了!

總之,選擇時,因現在的NB幾乎沒標準RS232介面了,所以最好選用:

一、與電腦連線是用USB介面
二、有支援ASCOM DRIVER
三、步進馬達+支援絕對位置
四、最好就有表明支援FOCUSMAX

就以這四樣為標準即可!

下一步,就是FOCUSMAX的操作,我早已翻譯好,原則上先以原版教學讓各位學習後,最後就是一些要注意的細節與實做。

如何自動對焦 partⅠ ε180ED的故事

我算也是命運不壞的人,高中時代得存便當錢,每次到立國書局買儀器時,都是拿一堆零錢去買個目鏡回來,連買底片的錢也有問題,雖然早就會天文攝影了,不過沒經濟能力的窮學生,實在是沒有辦法和人玩這個東西。

考上公職後有著穩定的收入,因而以前哈不到的夢幻儀器,全都可以買來一償這個遺憾。尤其是ε系列的鏡筒,以前好喜歡它又細緻又漂亮的十字星芒!想說不必到ε200、ε160,我有台ε130就好了!

後來有機會擁有ε160時,卻發現國外中古市場有一台ε200!ε160我也真沒良心,給人家殺到一台二萬元....只是當時鏡片品相不好,修正鏡又得重買,算了算估計得花六萬元才能全部搞定!

ε200要買回來,運費一定一萬五起跳,沒意外的話,就是二萬多的運費!這還不打緊,咱們中華民國大哥也要保護費的(關稅)......最後就打消念頭了!

後來國外ASTROMART中古市場有發現一台ε180ED,放了一段期間沒人要買,我問了問主人是否還要賣,他很樂意賣給我,並有附自動對焦座與箱子。信件交流了許久,當中較讓我驚訝的是他得開三個小時的車去寄這支望遠鏡,並和我爭議了許久的是我自己到台南市載,不能送到我家;還有保險金額要寫多少,我說不必保險,寄丟了或摔壞了就算了...

他一直說不要...我最後說你就寫就對了,我負全責,無論是寄丟了或是我得去載都沒關係,他才把鏡筒寄出。

等了一個星期,終於送到了!我打開時看品相十分好。但是裡面的鏡子....原來原主人已經二年沒有清理鏡子了!因為他不敢拆下來清洗!一直撐到沒辦法撐了,所以才賣掉的!

原本想買中古貨,就是要有這樣的心理準備:這東西,一定有原主人很在意或是沒有辦法克服的地方,你得功課做足了,可以接受或是處理這樣的問題後,買下去才不會有什麼怨言!

ε系列最大的問題,莫過於它的光軸與對焦問題!這支鏡筒的特殊處,就是你得用工具來對,而且對的方式很特殊,與一般牛反不一樣,因為它的偏心量是偏得很誇張。我也吃了點苦頭,後來才看懂說明書所寫的調法。

克服光軸問題後,我就開始拆解ε180ED,順利學會拆解清洗後,就開始開拍了!我對於對焦其實也是很有信心的!因為我一開始進入數位化後,困擾我最大的是一台中古的350D嚴重移焦(與底片時代不同的是觀景窗所見與實際焦點差很大!),讓我整整為了對焦,也花了半年的時間研究各種對焦法!

剛開始覺得還好,後來最怕的問題來了:反射鏡受溫度的改變很敏感,會有明顯的移焦。後來我漸漸發現:這一台鏡子真的是怪物!它的星點可以對到非常非常的細!已經沒有辦法用我自豪的一面看即時影像,一面看數據來對了!

怎麼說呢?很多高手都這樣對焦啊!不是...我所謂的「準焦」,就是你曝光長時間後,那很暗的星點還是「紮實」的,一點也不會糊!一般PO在網路上的都縮圖了,用500mm鏡頭+縮星點大法和ε180拍的星點,都「一樣細」啊!

也只有瘋子才會PO原圖給人看的!說這是瘋子一點也不過份,為了這個準焦,看數據對好後,還得拍張長曝光時間,確定星點是否全是「紮實的」,有時候明明數據已經很漂亮了,拍出來放大後,焦點還是「差那麼一點點」!就再「按一下」電動對焦,然後再拍一張長時間的,再看一下有沒有準焦。

如果不幸猜錯方向,就再按二至三下回來,按到「這麼多下」,是因為要克服對焦座的「逆向回差」。因此若要對好一張完全準焦的照片,說至少要四十分鐘至一小時,就不會是很誇張的事了吧!

一小時?....還好啦!反正天色也沒那麼快暗下來,就好好對焦就好了!可是,在我貪圖ε180ED的大光圈與廣視野平坦像場後,皮癢的買了STL-1100,就面臨了可能對焦座得要換掉,還有更要命的對焦問題!

這台相機它傳輸速度是USB1.0,傳個全幅1X1要26秒!....雖然有用SUBFRAME的功能,但還是很慢!因此又加上了個構圖的問題,構圖我有時得花掉四十分鐘!再加上對焦....然後構好圖後,因為11K是做大頭鬼不對稱的重心,一轉動平衡就跑掉了!又得重新調平衡,然後再GOTO重新構圖,差別只是不用再轉動相機而已!

這樣搞下來......能夠開拍一個天體,有時要搞到二個小時!我就再也受不了,這樣根本不必玩了啊!人家早就都弄好拍二個天體了,我才剛開拍....

原本我這一台的原主人,就是配STL-1100M的組合,所以他就分開賣,而那個接環就順便給我。再度還原這樣的組合時(差別是他的赤道儀是AP1200),我才明白原來我原主人,就是這樣被搞瘋了,所以才又全部賣掉的!

最後我想到的就是:我得用自動對焦了!自動對焦聽說20秒就可以搞定,對得又快又準。

以上是聽說的!我又做了很多的評估:啊!濾鏡不是有不齊焦的問題?這樣用LRGB我就不用怕移焦的問題了,用不同牌子的濾鏡也沒關係!

喔!窄頻那個暗到靠北很難對的S2與Hα,應該也不是問題吧?要不然用一面看星點數據一面對的方式,LRGB還可以,到Hα與S2,每顆星點都很細啊,只有到拍完之後才知道焦點沒有對準...

還有還有!就是反射鏡開拍後,會因著溫度的問題而移焦,我如果有自動對焦,我每拍一個濾鏡後,就再花20秒重新對焦,再用下一個濾鏡,我就完全不怕溫差的改變了!

評估後,我就覺得我非得學自動對焦不可了!要不然我會浪費非常多的時間在對焦上,尤其FSQ106ED也是這樣的情形,都是星點非常細緻,可以說要「完全準焦」,是已經超乎人手與人眼的能力,只有「電腦有辦法」做得到的地步!

要發揮這種鏡子的威力,第一步就是光軸要準,第二步就是焦距要準!第三步就是赤道儀+導星要神準!這也就這種鏡子會讓很多同好卻步的原因!

前言會這麼多廢話,只是因為讓各位了解用自動對焦的好處與必要性而已!接下來,就是開始介紹如何進入自動對焦的世界了!

2013年10月2日 星期三


AdaptiveStretch自適性拉伸




Adaptive nonlinear intensity transformation based on existing pixel-to-pixel relations. [more]基於現存像素對像素關係性的自適性非線性拉伸強度轉化。

Categories種類: IntensityTransformations強度轉化

Keywords關鍵字: adaptive nonlinear intensity transformation, contrast manipulation自適性 非線性 強度 轉化,對比 操作

Contents內容



Description說明

AdaptiveStretch is a general contrast and brightness manipulation tool in PixInsight. It implements a nonlinear intensity transformation computed from existing pairwise pixel relations in the target image. The process is mainly controlled through a single noise threshold parameter. Basically, brightness differences below the noise threshold are regarded as due to the noise and other spurious variations, and are thus attenuated or not enhanced. Brightness differences above the noise threshold are interpreted as significant changes in the image, so the process tends to enhance them.自適性拉伸是在PixInsight中的一個對比與亮度的操作工具。它實現了來自於目標影像中的現存成雙關係所計算非線性強度轉化。這個處理主要是透過一個單一雜訊門檻參數來控制。基本上,藉由低於雜訊門檻的亮度差異,會被認為是因著雜訊與其它偽造的(寄生的)差異,且因此而被衰減或是沒有被加強。高於雜訊門檻的亮度差異會被解釋為一個在影像中重要的改變,因此處理傾向於加強它們。
Our implementation is based on the algorithm described by Maria and Costas Petrou. [1] All brightness differences between adjacent pairs of pixels are first computed and classified to form two disjoint sets: positive forces, due to significant variations, and negative forces, or variations due to the noise. Positive forces tend to increase the contrast of the image, while negative forces act in the opposite direction, protecting the image. The process uses these two forces to compute a nonlinear mapping curve, which is then used to transform the image by interpolation.我們的供給供具是基於由Maria 與Costas Petrou所描述的演算法。所有在鄰近的像素對間的差異會首先被計算並分類,以便形成兩個分離組:正力,肇於重要的差異。負力或是差異,肁於雜訊。正力傾向增加影像的對比,而負力則是在反向動作,是保護影像。這個處理使用這兩個力來計算一個非線性映射曲線,之後會被用來藉由內插來轉化影像。
The following list summarizes the main features and advantages of the AdaptiveStretch tool:以下的列表總結了自動拉伸工作的主要功能與優點
  • It is essentially a one-parameter process (a second contrast-limiting parameter is optional).它本質上是一個單一參數處理(第二個對比限制參數是可選的)
  • The computed transformation curve is optimal, in the sense that it maximizes contrast without intensifying spurious data.已計算的轉化曲線是最佳的,在這個意義上,在沒有強化偽造資料下最大化對比
  • It allows to find an optimal curve very easily in a completely objective and unbiased way. The same curve can be very difficult to find using manual adjustments.它允許在一個完全客觀與不偏移的方式,很容易的找到一個最佳曲線。使用手動調整的話,相同的曲線就很難找到最佳曲線。
  • The transformation guarantees that no pixel will be clipped, neither at the shadows nor at the highlights. Initially clipped pixels, or pixels that are either black or white in the original image, will be preserved in the transformed image.這個轉化保證無論是在陰影或是在高光中,沒有像素會被剪裁掉。初始已剪裁掉的像素,或是在原始影像中黑或白的像素,將會被保存在已轉化的影像中。
  • Provides full real-time preview functionality, including real-time generation of curve graphs.提供完全的即時預覽功能,包含即時產生曲線圖形
  • In difficult cases, a region of interest (ROI) can be defined to restrict analysis of pairwise pixel variations to a significant area of the image.在艱難的事例中,一個感興趣的區域(ROI)可以被定義為:對影像有意義區域的成對像素差異之限制分析。
  • The computed mapping curve can be converted into a CurvesTransformation instance automatically.這個已計算的映射曲線可以自動轉換為一個曲線轉化樣品。
  • Can be used to stretch linear raw CCD monochrome and OSC CCD / DSLR color data.可以用來拉伸線性生單色CCD與彩色CCD/DSLR彩色資料。
  • Provides excellent results with both astronomical and daylight raw images.可以提供天文與日間生影像優異的結果。
The two main tools for nonlinear intensity transformations in PixInsight are HistogramTransformation and CurvesTransformation. With AdaptiveStretch we don't intend to replace those fundamental tools, but to provide an alternative way to perform brightness/contrast manipulations, including the initial nonlinear stretching step of raw data. The most interesting feature of AdaptiveStretch is that it works by analyzing the true contents of the image. Other tools require purely manual work, and hence their results depend more on the knowledge and ability of the user to understand the image. Understanding subtle relations between different image structures can be difficult, and in this sense AdaptiveStretch can be seen as a powerful tool for objective analysys.在PixInsight中,兩個主要用來做非線性強度轉化的工具為分市圖轉化與曲線轉化。以著自適性拉伸,我們並不傾向取代這些基礎工具,不過為了提供一個可替換式的方式來執從亮度/對比操作,包含了生資料的初始非線性拉伸步驟。非線性拉伸最有趣的功能,是它藉由分析影像的真實內容。其餘工具需要純粹的手動工作,且因此它們的結果,更多是根據使用者的知識與能力來了解影像。

Parameters參數


Noise threshold雜訊門檻

The AdaptiveStretch process computes a nonlinear curve to enhance existing brightness differences above the noise threshold parameter. Brightness differences smaller than the noise threshold will be diminished or not enhanced in the processed image. Decrease this parameter to apply a more aggressive nonlinear transformation. In general, you should fine tune this parameter along with contrast protection to find an optimal combination.在雜訊門檻參數以上時,自適性拉伸處理計算一個非線性區線,來加強一個現存的亮度差異。亮度差異小於雜訊門檻時,在已處理影像將會減少或是不會被加強。減少這個參數來套用一個更攻擊性的非線性轉化。一般說來,你應該與對比保護一起微調這個參數,以便找到一個最佳的組合。
A comparison of different results obtained by varying the noise threshold parameter of AdaptiveStretch. The original image is a 16-bit raw DSLR image taken with a Canon EOS 450D camera.變化自適性拉伸的雜訊門檻參數所獲得的不同結果之比較。原始影像是一個16位元的生DSLR影像,由Canon 450D相機所拍攝。
(a) Top left左上: De-Bayered linear image.去拜耳化的線性影像
(b) Top right右上: Noise threshold雜訊門檻 = 1×10-2 (c) Bottom left左下: Noise threshold雜訊門檻 = 3×10-3 (d) Bottom right右下: Noise threshold雜訊門檻 = 5×10-4

Contrast protection對比保護

The contrast protection parameter limits the increase of contrast on very bright and dark areas. Increasing this parameter can help control excessive intensification of highlights and darkening of shadows. Irrespective of its value, this parameter can be disabled or enabled; it is disabled by default. This feature allows for quick comparisons between the results with and without contrast protection applied.對比保護參數限制了在十分亮與十分亮區域對比度增加。增加這個參數可以幫助控制高光過度加強與陰影的暗化。與它的值無關,這個參數可以取消或是開啟。它內定是取消。這個功能允許在有著對比保護加強與沒有對比保護加強結果間的快速比較
An example of use of the contrast protection parameter of AdaptiveStretch. As in the preceding example, the original is a 16-bit raw image shot with a Canon EOS 450D camera.使用自適性拉伸對比保護參數的例子。如在之前的例子,原始檔是16位元生影像,由Canon EOS 450D相機所拍攝。
(a) Top left左上: De-Bayered linear image.去拜耳化線性影像
(b) Top right右上: Noise threshold雜訊門檻 = 1×10-3, no contrast protection.沒有對比保護
(c) Bottom left左下: Noise threshold雜訊門檻 = 5×10-3, no contrast protection.沒有對比保護
(d) Bottom right右下: Noise threshold雜訊門檻 = 1×10-4, contrast protection對比保護 = 8×10-2

Maximum curve points最大曲線點

This is the maximum number of points computed to build the transformation curve. The default value is 106 points. For 8-bit and 16-bit integer images, AdaptiveStretch can compute a maximum of 256 and 65536 curve points. Note that in these cases computing more curve points would make no sense because the minimum possible nonzero difference between two pixels is one discrete unit. For 32-bit integer images the theoretical limit is 232 curve points, which is impractical for obvious reasons.這是計算點的最大值,以建立轉化曲線。內定值是 106點。對一個8位元與16位元積分影像而言,自適性拉伸可以計算256與65536值點的最大值。注意在這些情況下,計算更多曲線點將會沒有意義,因為在兩個像數間的差異最小可能的非0差異是一個離散單元。
For 32-bit and 64-bit floating point images a maximum of 107 and 108 curve points can be calculated, respectively. Note that lowering the number of curve points can limit the ability of the algorithm to detect very small brightness changes between adjacent pixels, which are essential to account for variations due to the noise in the image. In practice, however, the default limit of 106 discrete values is more than sufficient for most 32-bit floating point images. Increasing this parameter can improve the result for very rich floating point and 32-bit integer images, usually resulting from deep HDR compositions. Keep in mind that large curves will increase computation times considerably, so they should only be used when actually required. In most cases, the default value of this parameter is quite appropriate.對一個32位元與64位元的浮點影像而言,能夠個別地計算107 and 108曲線點的最大值。注意降低曲線點的數可以限制演算法的能力,以便偵測十分小亮度在鄰近像素間的改變,它在考量因著在影像中雜訊的差異是不可或缺的。然而,實際上,內定限制106離散值,對32位元浮點影像是十分足夠的。增加這個參數可以改善對通常是由深度的高動態範圍合成產生的十分豐富的浮點與32位元積分影像之結果。記住大曲線將會相當地增加計算時間,因此它們應該只在需要時才使用。在大多數的情況中,這個參數的內定值是十分合適的。

Region of interest有興趣的區域

By default, the AdaptiveStretch process analyzes pairwise pixel brightness differences on the whole target image. Normally this is the best option if there are no big differences in brightness, or if some big differences can be safely ignored. A typical example is an indoor daylight scene where we decide that it is OK to burn a window completely. However, there are more difficult cases where these simple assumptions are unacceptable, or where they simply don't work. In these cases a region of interest (ROI) can be defined to restrict the analysis to a rectangular region of the image. The ROI is defined by the X and Y pixel coordinates of its upper left corner, and by its width and height in pixels. The process will ignore a ROI with less than 16×16 pixels, or a ROI that lies completely outside the image.內定值是自適性拉伸處理分析成對像素在整個目標影像上的亮度差異。一般說來,如果沒有在亮度上的大差異的話,這是最佳選項,或是如果一些大差異可以被安全地忽略。一個典型的例子是一個戶內日光場景,在此我們決定完全爆了一個視窗是OK的。然而,有更多困難的情況是何處這些簡單的假定不可接受的,何處是它們實際上無法工作的。在這些情況中,一個感興趣的區域(ROI)可以定義為對一個影像矩形區域的限制分析。這些ROI是藉由它的左上角的X與Y像素座標,與它以像素計的寬與高。這個處理將會忽略有著小於16X16像素的ROI,或是完全置於影像外的ROI。
An example of the use of regions of interest (ROI) to control the AdaptiveStretch process. As a whole, this image as quite flat, or in other words, it is dominated by an overwhelmingly large amount of pixels with intermediate values. This is more evident on the result of a histogram transformation shown in section (b). Using the whole image to analyze pairwise pixel differences yields a too contrasted result (c), where the dimmest areas are too dark and the brightest regions are too flat. This happens because the AdaptiveStretch algorithm computes a transformation to optimize contrast for a dominant subset of the analyzed pixels.使用ROI來控制自適性拉伸處理的範例。就處體而言,這個影像相當平坦,換句話說,它是由一個壓倒性大量有著有著中間值的像素所支配。這在一個顯示在(b)部分中分布圖轉化結果是更明顯的。使用整個影像來分析成對像素的差異,產生一個過度對比的結果(c),此處,最暗的區域太暗且最亮的區域太平坦。這個會發生是因為自適性拉伸演算法對已分析像素的主導子集合計算一個轉化來最佳化對比。
By restricting the analysys to a smaller area, where bright and dark structures are equally well sampled, and intermediate pixel values are no longer dominant, the result (d) allows us to show much better the entire range of structures in the image. This is a nice example of complex image dynamics. Note however that the result achieved in section (c) can be improved using HDR compression techniques in PixInsight, for example with the HDRMultiscaleTransform tool, which opens a completely different path for processing. Image courtesy of Ivette Rodríguez and Oriol Lehmkuhl.藉由對較小區域的限制分析,在此亮與暗結構會相等地良好被取樣,且中間的像素值就不再佔優勢,結果(d)允許我們顯示在影像中較優的整個結構範圍。這是一個複雜影像動態的良好範例。然而,注意在(c)部分中所達成的結果可以使用在PixInsight中的動態範圍壓縮技巧(如高動態範圍多尺寸轉化工具來改善,它對處理打開一個完全不同的路徑。影像承蒙Ivette Rodríguez 與 Oriol Lehmkuhl的特許。
(a) Top left左上: The linear image with an automatic screen stretch (STF) applied (note that the automatic STF transformation clips pixels at the shadows).套用STF的線性影像(注意自動STF轉化裁掉陰影像中的像素)
(b) Top right右上: Result achieved with the HistogramTransformation tool by clipping unused histogram sections at both ends and applying a midtones balance value of 0.005.用分布圖轉化工具達成的結果,它藉由裁剪分布圖部分兩端未使用的部分,並套用一個0.005的中間調平衡值
(c) Bottom left左下: Result of AdaptiveStretch, noise threshold = 10-4, curve computed for the whole image (no region of interest).自適性拉伸的結果,雜訊門檻=10-4,對整個影像做曲線計算(無ROI)
(d) Bottom right右下: Result of AdaptiveStretch, noise threshold = 1.2×10-4, region of interest set to the green rectangle shown on (a).自適性拉伸的結果,雜訊門檻=1.2×10-4,ROI設為顯示在(a)上的綠色矩形。
Another example of AdaptiveStretch with a region of interest (ROI). In this example, a ROI covering the main subject has been used to prevent the excessive contrast increase in the processed image. The relative lack of color saturation can be easily compensated with a color saturation curve.另一個有用ROI的自適性拉伸範例。在這個範例子,一個ROI涵蓋主物體,用來防止在已處理影像中的過度對比增加。相對的缺乏的顏色飽和可以很容易的用顏色飽和曲線來補償。
(a) Top left: The linear image. This is a de-Bayered raw DSLR image acquired with a Canon 450D camera.
(b) Top right: Result of AdaptiveStretch with noise threshold = 8.7×10-4 and contrast protection = 0.355, no ROI.
(c) Bottom left: Result of AdaptiveStretch, noise threshold = 6.7×10-4, contrast protection = 0.375, ROI set to the green rectangle shown on (a).
(d) Bottom right: The result of (c) after a color saturation curve applied with CurvesTransformation.

Usage


Exponential Controls

The noise threshold and contrast protection parameters of AdaptiveStretch are extremely sensitive. They can vary in the range from zero to one with eight digits of fractional precision. This extended precision is necessary to process 32-bit floating point and integer images. For 16-bit integer images, usually 4 or 5 decimal digits are required. As a result, the usual edit and slider combined controls that are ubiquitous in the PixInsight platform, are just too rough to control these parameters.
For these parameters we have implemented a specialized control with three subcontrols: an edit field to enter the parameter value with 8 decimal digits; an edit/slider combo to specify the coefficient in scientific notation, with 2 decimal digts in the range from 1 to 9.99; and a spin box to specify the exponent in the 0 to -8 range.
For example, in the figure above, the value of the noise threshold parameter is 0.000275, which is equivalent to 2.75×10-4 in scientific notation. By increasing and decreasing the exponent by one unit, you can quickly change the scale of the parameter by one order of magnitude. By moving the slider, you can fine tune the coefficient. This allows you to control a sensitive parameter very easily with the mouse without needing to write numeric values.

Using AdaptiveStretch in Real-Time Preview Mode

Despite being a rather automatic process, AdaptiveStretch is a highly interactive tool. In fact, you actually cannot apply this tool properly unless you fine tune its two main parameters during a real-time preview session. The reason for this is that this is an adaptive tool: it computes a transformation based on the existing brightness differences between adjacent pairs of pixels in the target image. Of course, you can also adjust AdaptiveStretch parameters using standard previews in PixInsight, which allows you to achieve very accurate results, but the real-time preview is just more convenient and easy to use. Once you have found good parameters with the real-time preview, nothing stops you to refine them using standard previews, if necessary.
Working with the AdaptiveStretch tool in real-time preview mode on a raw CCD image of NGC 1808. Image courtesy of jack Harvey / SSRO.
The RealTimePreview virtual view can be used to inspect the histogram of the transformed image on the HistogramTransformation tool during an AdaptiveStretch real-time session. The histogram and the curve graph provide you with a wealth of information to control the final image.
Curve Graphs
One of the most useful features of AdaptiveStretch is its ability to generate a real-time curve graph. This graph represents the transformation curve being computed as a function of the current process parameters. The graph is drawn on an auxiliary window when the tool is working in real-time preview mode, if the real-time curve graph check box is checked.
The curve graph allows you to fully evaluate and understand the transformation being applied, while you can see the result on the real-time preview window, and even its histogram on the HistogramTransformation tool with the RealTimePreview virtual view selected (an example of this is shown on the figure above). Two buttons on the AdaptiveStretch Curve Graph window allow you to render the graph as a new image window (as an 8-bit RGB color image) and to convert the current AdaptiveStretch curve into a CurvesTransformation instance. This is useful to apply the same transformation curve to a set of images. Since the AdaptiveStretch process depends on the contents of the image being processed, each running instance applies a different transformation to each particular image; however, CurvesTransformation is not an adaptive process and hence does not have this limitation.
An AdaptiveStretch curve and its equivalent CurvesTransformation instance.

References

[1] Maria Petrou and Costas Petrou, Image Processing: The Fundamentals, Second Edition, John Wiley and Sons Ltd., 2010, pp. 377–382.