GoPiGo 小汽車︰格點圖像算術《色彩空間》主觀性【一】

也許小汽車因為因緣

想那洛水小神龜自由自在

洛書

Turtle

L3

L2

images

子虛先生說︰昔 時洛水有神龜,總於晨昏之時,彩雲滿天之際,游於洛水之波光霞影之中。興起就神足直行,左旋右轉飛舞迴旋,那時波濤不起漣漪不見,河面只隨神龜尾之上下, 或粗或細或長或短或直或曲契刻成圖文。一日大禹治水偶經洛水恰遇神龜,神龜感念大禹昔日洩洪疏河之恩,特演平日最得意水畫之作,所以歷史才傳說『大禹得洛 書』。

雖然作者以為子虛先生所說乃是烏有之言,然而他卻把『小海龜』繪圖法的精神描寫的活靈活現。小海龜頭的朝向決定它『前進』的方向,『【向前】【數值】 』表示向前走多少單位距離的指令,比方 forward 10,是說向前走十個單位。除了直行之外小海龜還可以『轉向』,這個轉向是依據當前之前進的方向『左轉』或是『右轉』,用『【旋轉】【角度】』表示,比方 rotate 90 是說右轉九十度, 而 rotate -90 是講左轉九十度。小海龜在網頁上的『位置』是由網頁上的 (X,Y) 座標來決定的,它的設定是『左上』(0,0)和『右下』 (600,600) 。小海龜當下的『狀態』state 是由『現在』的『位置』與『朝向角度』所一起決定的,這也就是『存上堆疊』push 與『堆疊取回』pop 存上取回指令裡所說的狀態。小海龜可以給定一個『開始』的『位置』與『朝向』,初進網頁時它在 (50,300),小海龜的頭朝右,它的角度是 0。

─── 摘自《科赫傳說!!

 

自主自動,經絡暢通心到行至,早不知何謂『控制』的也。這個『 GoPiGo 』畢竟是人造之物聽人使喚,前進、後退、左旋、右轉不得不有個『運動機制』…

─── 摘自《樹莓派 0W 狂想曲︰ 木牛流馬《控制》

 

方才開始注意

薄暮現象

薄暮現象,又稱柏金赫現象(Purkinje effect),是色彩學的內容之一

說明如下: 在白色光源或高明度中,紅色藍色明度強10倍,在低明度藍色比紅色明度強16倍。指在傍晚時,人的視覺由彩度優先轉換成明暗現象。

視網膜上包括兩種細胞接受外界光源:感色的錐狀細胞,與感光不感色的柱狀細胞。在微弱光線中,人類無法清晰辨識顏色,原因是只剩柱狀細胞可以接受微弱的光源,錐狀細胞感色功能停止。

薄暮現象是從以感色細胞為主的階段轉變為以感光為主的階段過程中的一個狀態:當外界光度逐漸降低,錐狀細胞活躍狀態隨之降低,柱狀細胞開始接手成為視網膜上主要接受光源的細胞,在辨識顏色能力完全消失之前的這個階段。

Simulated appearance of a red geranium and foliage in normal bright-light (photopic) vision, dusk (mesopic) vision, and night (scotopic) vision

Purkinje effect

The Purkinje effect (sometimes called the Purkinje shift or dark adaptation) is the tendency for the peak luminance sensitivity of the human eye to shift toward the blue end of the color spectrum at low illumination levels.[1][2][page needed] The effect is named after the Czech anatomist Jan Evangelista Purkyně.

This effect introduces a difference in color contrast under different levels of illumination. For instance, in bright sunlight, geranium flowers appear bright red against the dull green of their leaves, or adjacent blue flowers, but in the same scene viewed at dusk, the contrast is reversed, with the red petals appearing a dark red or black, and the leaves and blue petals appearing relatively bright.

The sensitivity to light in scotopic vision varies with wavelength, though the perception is essentially black-and-white. The Purkinje shift is the relation between the absorption maximum of rhodopsin, reaching a maximum at about 500 nm, and that of the opsins in the long-wavelength and medium-wavelength cones that dominate in photopic vision, about 555 nm.[3]

In visual astronomy, the Purkinje shift can affect visual estimates of variable stars when using comparison stars of different colors, especially if one of the stars is red.

Physiology

The effect occurs because the color-sensitive cones in the retina are most sensitive to green light, whereas the rods, which are more light-sensitive (and thus more important in low light) but which do not distinguish colors, respond best to green-blue light.[4] This is why humans become virtually color-blind under low levels of illumination, for instance moonlight.

The Purkinje effect occurs at the transition between primary use of the photopic (cone-based) and scotopic (rod-based) systems, that is, in the mesopic state: as intensity dims, the rods take over, and before color disappears completely, it shifts towards the rods’ top sensitivity.[5]

Rod sensitivity improves considerably after 5-10 minutes in the dark,[6] but rods take about 30 minutes of darkness to regenerate photoreceptors and reach full sensitivity.[7]

 

潛心學習

Color balance

In photography and image processing, color balance is the global adjustment of the intensities of the colors (typically red, green, and blue primary colors). An important goal of this adjustment is to render specific colors – particularly neutral colors – correctly. Hence, the general method is sometimes called gray balance, neutral balance, or white balance. Color balance changes the overall mixture of colors in an image and is used for color correction. Generalized versions of color balance are used to correct colors other than neutrals or to deliberately change them for effect.

Image data acquired by sensors – either film or electronic image sensors – must be transformed from the acquired values to new values that are appropriate for color reproduction or display. Several aspects of the acquisition and display process make such color correction essential – including the fact that the acquisition sensors do not match the sensors in the human eye, that the properties of the display medium must be accounted for, and that the ambient viewing conditions of the acquisition differ from the display viewing conditions.

The color balance operations in popular image editing applications usually operate directly on the red, green, and blue channel pixel values,[1][2] without respect to any color sensing or reproduction model. In film photography, color balance is typically achieved by using color correction filters over the lights or on the camera lens.[3]

The left half shows the photo as it came from the digital camera. The right half shows the photo adjusted to make a gray surface neutral in the same light.

Generalized color balance

Sometimes the adjustment to keep neutrals neutral is called white balance, and the phrase color balance refers to the adjustment that in addition makes other colors in a displayed image appear to have the same general appearance as the colors in an original scene.[4] It is particularly important that neutral (gray, neutral, white) colors in a scene appear neutral in the reproduction. [5]

Example of color balancing

Illuminant estimation and adaptation

Most digital cameras have means to select color correction based on the type of scene lighting, using either manual lighting selection, automatic white balance, or custom white balance.[citation needed] The algorithms for these processes perform generalized chromatic adaptation.

Many methods exist for color balancing. Setting a button on a camera is a way for the user to indicate to the processor the nature of the scene lighting. Another option on some cameras is a button which one may press when the camera is pointed at a gray card or other neutral colored object. This captures an image of the ambient light, which enables a digital camera to set the correct color balance for that light.

There is a large literature on how one might estimate the ambient lighting from the camera data and then use this information to transform the image data. A variety of algorithms have been proposed, and the quality of these has been debated. A few examples and examination of the references therein will lead the reader to many others. Examples are Retinex, an artificial neural network[6] or a Bayesian method.[7]

A seascape photograph at Clifton Beach, South Arm, Tasmania, Australia. The white balance has been adjusted towards the warm side for creative effect.

Chromatic colors

Color balancing an image affects not only the neutrals, but other colors as well. An image that is not color balanced is said to have a color cast, as everything in the image appears to have been shifted towards one color.[8][page needed] Color balancing may be thought in terms of removing this color cast.

Color balance is also related to color constancy. Algorithms and techniques used to attain color constancy are frequently used for color balancing, as well. Color constancy is, in turn, related to chromatic adaptation. Conceptually, color balancing consists of two steps: first, determining the illuminant under which an image was captured; and second, scaling the components (e.g., R, G, and B) of the image or otherwise transforming the components so they conform to the viewing illuminant.

Viggiano found that white balancing in the camera’s native RGB color model tended to produce less color inconstancy (i.e., less distortion of the colors) than in monitor RGB for over 4000 hypothetical sets of camera sensitivities.[9] This difference typically amounted to a factor of more than two in favor of camera RGB. This means that it is advantageous to get color balance right at the time an image is captured, rather than edit later on a monitor. If one must color balance later, balancing the raw image data will tend to produce less distortion of chromatic colors than balancing in monitor RGB.

Photograph of a ColorChecker as a reference shot for color balance adjustments.

 

逐步踏入『腦中色彩』之世界︰

Retinex theory

The effect was described in 1971 by Edwin H. Land, who formulated “retinex theory” to explain it. The word “retinex” is a portmanteau formed from “retina” and “cortex“, suggesting that both the eye and the brain are involved in the processing.

The effect can be experimentally demonstrated as follows. A display called a “Mondrian” (after Piet Mondrian whose paintings are similar) consisting of numerous colored patches is shown to a person. The display is illuminated by three white lights, one projected through a red filter, one projected through a green filter, and one projected through a blue filter. The person is asked to adjust the intensity of the lights so that a particular patch in the display appears white. The experimenter then measures the intensities of red, green, and blue light reflected from this white-appearing patch. Then the experimenter asks the person to identify the color of a neighboring patch, which, for example, appears green. Then the experimenter adjusts the lights so that the intensities of red, blue, and green light reflected from the green patch are the same as were originally measured from the white patch. The person shows color constancy in that the green patch continues to appear green, the white patch continues to appear white, and all the remaining patches continue to have their original colors.

Color constancy is a desirable feature of computer vision, and many algorithms have been developed for this purpose. These include several retinex algorithms.[8][9][10] [11] These algorithms receive as input the red/green/blue values of each pixel of the image and attempt to estimate the reflectances of each point. One such algorithm operates as follows: the maximal red value rmax of all pixels is determined, and also the maximal green value gmax and the maximal blue value bmax. Assuming that the scene contains objects which reflect all red light, and (other) objects which reflect all green light and still others which reflect all blue light, one can then deduce that the illuminating light source is described by (rmax, gmax, bmax). For each pixel with values (r, g, b) its reflectance is estimated as (r/rmax, g/gmax, b/bmax). The original retinex algorithm proposed by Land and McCann uses a localized version of this principle.[12][13]

Although retinex models are still widely used in computer vision, actual human color perception has been shown to be more complex.[14]

 

 

 

 

 

 

 

 

GoPiGo 小汽車︰格點圖像算術《色彩空間》主觀性

此刻小汽車正努力的學習『色彩知識』,祇是為著為何感覺不符合『理論文字』而煩惱呢?或許智慧長煩惱生吧!於是七葷八素之餘 ,忽然不愛聽新聞哩!!何不就聽聽舊聞乎??很久很久以前…

這時海之涯的另一端正是『拓荒』的時代,1774 年出生的 Johnny Chapman ,譜出『蘋果種子Appleseed傳奇

200px-Johnny_Appleseed_1

Appleseed

那從一顆『蘋果種子』能見著什麼呢?是生命的強韌?或破土而出的喜悅?還是夏娃偷吃的那個?也許可以這樣說︰『』的掌握改變了人類當時的生活,而一顆種子傳承造就世世代代的持有強尼‧蘋果種子所代表的『拓荒精神』──

STAR TREK
星艦迷航記
Where No One Has Gone Before
前人未至之境

──,是否終將化作『概念種子』等待時機『發芽』?

1776年7月4日,美國的大陸會議通過《獨立宣言》,宣言這個新國家是獨立的,完全脫離英國,目的是為『圖生存、求自由、謀幸福』,實現啟蒙運動的理想。之後過了一百三十九年,一九一五年三月十一日,Joseph Carl Robnett Licklider 誕生於密蘇里州的聖路易斯,不知距馬克吐溫湯姆──密蘇里州聖彼得斯堡──歷險記之地有多少距離?身為浸信會牧師獨子的他,自幼喜歡玩模型飛機,展現了工程天份,終身喜好修整汽車,史稱『計算機種子』。

191px-J._C._R._Licklider

220px-SAGE_console

220px-Xerox_Alto_mit_Rechner

220px-Xerox_8010_compound_document

Evolution_of_the_document_icon_shape

220px-Rank_Xerox_8010+40_brochure_front

1937 年二十二歲的 Lick 自華盛頓大學取得藝術學位,主修物理數學、和心理學;1942 年為羅微斯特大學心理聲學的博士;1943 至 1950 年間工作於哈佛大學心理聲學實驗室,開始對『資訊科技』有興趣,於是前往 MIT 任副教授,並成為 MIT 林肯實驗室委員會的成員,推動建立工程系學生的心理學課程。那時正是美蘇『冷戰』時期,Lick 參與了『SAGE』─ Semi-Automatic Ground Environment ── 計畫,見左圖二。1957 年獲頒工程心理學會的最高榮譽 Franklin V. Taylor Award 獎;同年轉任 Beranek and Newman 高科技公司的副總裁,用他購買的第一代 PDP-1 電腦,引領大眾了解何謂『 time-sharing 』的概念;次年他被選為美國聲學學會會長。1962 年十月 Lick 被美國國防高等研究計劃署 DARPA ── 後稱 作ARPA ── 指派領導資訊處理技術辦公室 Information Processing Techniques Office (IPTO),一九六三年,轉任領導 ARPA 的 Behavioral Sciences Command & Control Research 辦公室,在一張標題為『Members and Affiliates of the Intergalactic Computer Network』給工作同仁的備忘錄上︰
imagined as an electronic commons open to all, ‘the main and essential medium of informational interaction for governments, institutions, corporations, and individuals.'”

宣告『銀河際網路』的願景,是促使 Internet 誕生的第一響春雷!! 1968年 Lick 到 MIT 的電機工程系作教授,領導 MAC ── Mathematics And Computation  ── 計畫,建立了第一台分時計算系統,… 靈感鼓舞了……  Unix 的發展 ………。或許 Robert Taylor ── Xerox PARC 計算機科學實驗室和 DEC 系統研究中心的發起人 ──說的好︰
most of the significant advances in computer technology—including the work that my group did at Xerox PARC—were simply extrapolations of Lick’s vision. They were not really new visions of their own. So he was really the father of it all

雖然全錄 Xerox 創造了 Alto  ──上圖三──,一台有滑鼠與鍵盤的圖形界面的電腦,發行了據說蘋果 Jobs 買過的 Star 8010/40 WYSIWYG 系統 ──上圖四、五、六──,或許由於為時太早,又也許因為業務不知怎麼推銷,傳聞只賣了不超過八台。

─── 摘自《一個奇想!!

 

大概它已發生『主客觀』糾結矛盾也!

Color constancy

Color constancy is an example of subjective constancy and a feature of the human color perception system which ensures that the perceived color of objects remains relatively constant under varying illumination conditions. A green apple for instance looks green to us at midday, when the main illumination is white sunlight, and also at sunset, when the main illumination is red. This helps us identify objects.

Constancy makes square A appear darker than square B, when in fact they are both exactly the same shade of grey. See Same color illusion.

Variations of the illusion

Minimal version

Simply cropping a portion of Edward Adelson’s original shows that most of the board and even the cylinder are actually redundant. As can be seen in the picture on the left (Fig 1) the illusion remains very strong even with only a small portion of the board remaining. The visual system is still persuaded to “see” a 3D object in which A and B have differing original shades, even though the actual shades are identical.

Fig 1. Cropped portion of the checkerboard showing illusion remains strong

Flip flop version

A further modification is to add an extra polygon between A and B with smaller size but similar shade. This produces a “flip-flop” illusion effect similar to the Rabbit–duck illusion and My Wife and My Mother-in-Law illusions. When gazing at the picture on the right (Fig 2) the visual system “sees” either a checkerboard – with A different from B, or three grey polygons of the same colour and hence – A the same shade as B. With effort the mind can be persuaded to see one or the other, or may flip randomly

Fig 2. Modified version with extra floating polygon

 

In these two pictures, the second card from the left seems to be a stronger shade of pink in the upper one than in the lower one. In fact they are the same color (since they have the same RGB values), but perception is affected by the color cast of the surrounding photo.

 

還是它的小鏡頭尚未能『色彩適應』耶?

Chromatic adaptation

Chromatic adaptation is the human visual system’s ability to adjust to changes in illumination in order to preserve the appearance of object colors. It is responsible for the stable appearance of object colours despite the wide variation of light which might be reflected from an object and observed by our eyes. A chromatic adaptation transform (CAT) function emulates this important aspect of color perception in color appearance models.

An object may be viewed under various conditions. For example, it may be illuminated by sunlight, the light of a fire, or a harsh electric light. In all of these situations, human vision perceives that the object has the same color: an apple always appears red, whether viewed at night or during the day (unless it is green). On the other hand, a camera with no adjustment for light may register the apple as having varying color. This feature of the visual system is called chromatic adaptation, or color constancy; when the correction occurs in a camera it is referred to as white balance.

Though the human visual system generally does maintain constant perceived color under different lighting, there are situations where the relative brightness of two different stimuli will appear reversed at different illuminance levels. For example, the bright yellow petals of flowers will appear dark compared to the green leaves in dim light while the opposite is true during the day. This is known as the Purkinje effect, and arises because the peak sensitivity of the human eye shifts toward the blue end of the spectrum at lower light levels.

 

唉◎時流向前從不回頭乎☆

 

 

 

 

 

 

 

 

GoPiGo 小汽車︰格點圖像算術《色彩空間》標準化‧想像實驗【五】

為什麼自然創造眼睛?眼睛產生色覺??答以達爾文『物競天擇』之進化結果,似乎難窮其妙!

150px-Origin_of_Species_title_page

《物種起源》

200px-Darwin_divergence

生命之樹

Editorial_cartoon_depicting_Charles_Darwin_as_an_ape_(1871)

人類與猿類具有共同祖先?!

300px-CollapsedtreeLabels-simplified.svg

系統發生樹

ON
THE ORIGIN OF SPECIES
BY MEANS OF NATURAL SELECTION,
OR THE
PRESERVATION OF FAVOURED RACES IN THE STRUGGLE
FOR LIFE.
By CHARLES DARWIN, M.A.,
FELLOW OF THE ROYAL, GEOLOGICAL, LINNÆAN, ETC., SOCIETIES;
AUTHOR OF ‘JOURNAL OF RESEARCHES DURING H. M. S. BEAGLE’S VOYAGE
ROUND THE WORLD.’
LONDON:
JOHN MURRAY, ALBEMARLE STREET.
1859.
The right of Translation is reserved.

英國大名鼎鼎的博物學家與生物學家查爾斯‧羅伯特‧達爾文 Charles Robert Darwin 自《小獵犬號航行之旅》一書成為著名作家。一九五九年出版的《物種起源》── 源於共同祖先的演化 ──,奠定了對自然界之多樣性由來的重要科學解釋。之後達爾文在《人類與動物的情感表達》以及《人類由來與性擇》中,闡釋人類的演化與性選擇的作用。他的一生可說是善於觀察與發想者的了吧。

如果將『人造物』的改變,對比於『大自然設計』之『穩定性』與『適應性』之演化。也許可以比擬為『改善』── 漸變之法 ── 和『創新』── 突變之則 ── 之設計工法的實踐。

─── 摘自《當真電源惹的禍??《中》

 

如果知道『似魚非魚的文昌魚』竟是脊椎動物之遠祖,生命演化的活化石!達爾文的眼睛竟能從之進化而來,豈不讚嘆宇宙之神奇!更別說乾坤造化『色覺』乎??!!設想眼睛若『分光儀』一般,能見『光譜』 I(\lambda, \vec{r}, t) ,那麼物體上之任一點 \vec{r} 的『入眼光譜』將因周遭『光源』變化,時時 t 變動不居,如是要如何『簡易區分』

【生】

 

【熟】

 

香蕉哩!怕猴子吃香蕉也難耶!!??

所以『不同光譜』對映『相同色彩』是天地利生之舉也!縱然恐有『閃閃發亮的不必鑽石,光芒萬丈者未必真金』之失矣◎

就讓我們瞧瞧 W. David Wright 和 John Guild 所用『光譜色』吧︰

pi@raspberrypi:~ $ ipython3 --pylab
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
Using matplotlib backend: TkAgg

In [1]: import colorpy.ciexyz

In [2]: import colorpy.colormodels

In [3]: import colorpy.misc

In [4]: Wright_Guild_紅光 = 700

In [5]: Wright_Guild_綠光 = 546.1

In [6]: Wright_Guild_藍光 = 435.8

In [7]: 紅光譜色xyz值 = colorpy.ciexyz.xyz_from_wavelength(Wright_Guild_紅光)

In [8]: 紅光譜色xyz值
Out[8]: array([ 0.03083035,  0.0111334 ,  0.        ])

In [9]: 明度歸一紅光譜色xyz值 = colorpy.colormodels.xyz_normalize_Y1(紅光譜色xyz值)

In [10]: 明度歸一紅光譜色xyz值
Out[10]: array([ 2.76917601,  1.        ,  0.        ])

In [11]: sRGB可顯示紅光譜色字串 = colorpy.colormodels.irgb_string_from_xyz(明度歸一紅光譜色xyz值) 
In [12]: sRGB可顯示紅光譜色字串
Out[12]: '#FF0056'

In [13]: 綠光譜色xyz值 = colorpy.ciexyz.xyz_from_wavelength(Wright_Guild_綠光)

In [14]: 綠光譜色xyz值
Out[14]: array([ 1.01926669,  2.67186719,  0.03313068])

In [15]: 明度歸一綠光譜色xyz值 = colorpy.colormodels.xyz_normalize_Y1(綠光譜色xyz值)

In [16]: 明度歸一綠光譜色xyz值
Out[16]: array([ 0.38148104,  1.        ,  0.01239982])

In [17]: sRGB可顯示綠光譜色字串 = colorpy.colormodels.irgb_string_from_xyz(明度歸一綠光譜色xyz值) 
In [18]: sRGB可顯示綠光譜色字串
Out[18]: '#00FF4E'

In [19]: 藍光譜色xyz值 = colorpy.ciexyz.xyz_from_wavelength(Wright_Guild_藍光)

In [20]: 藍光譜色xyz值
Out[20]: array([ 0.90429998,  0.04824082,  4.47755971])

In [21]: 明度歸一藍光譜色xyz值 = colorpy.colormodels.xyz_normalize_Y1(藍光譜色xyz值)

In [22]: 明度歸一藍光譜色xyz值
Out[22]: array([ 18.74553502,   1.        ,  92.81682432])

In [23]: sRGB可顯示藍光譜色字串 = colorpy.colormodels.irgb_string_from_xyz(明度歸一藍光譜色xyz值) 
In [24]: sRGB可顯示藍光譜色字串
Out[24]: '#8300FF'

In [25]: 紅綠藍光譜三原色 = [sRGB可顯示紅光譜色字串, sRGB可顯示綠光譜色字串, sRGB可顯示藍光譜色字串]

In [26]: 紅綠藍光譜波長 = ['700 nm', '546.1 nm', '435.8 nm']

In [27]: colorpy.misc.colorstring_patch_plot (紅綠藍光譜三原色, 紅綠藍光譜波長, 'CIERGB', 'ciergb', num_across=3)
Saving plot ciergb

In [28]: 

 

 

想像『新鮮』看得見嗎?!

※如果『色彩變化』,定然『光譜變化』?某種物理改變化學反應發生了!

『月下』相片可以轉成『日中』照片嘛!?

Color rendering index

A color rendering index (CRI) is a quantitative measure of the ability of a light source to reveal the colors of various objects faithfully in comparison with an ideal or natural light source. Light sources with a high CRI are desirable in color-critical applications such as neonatal care, photography and cinematography.[1] It is defined by the International Commission on Illumination (CIE) as follows:[2]

Color rendering: Effect of an illuminant on the color appearance of objects by conscious or subconscious comparison with their color appearance under a reference illuminant

The CRI of a light source does not indicate the apparent color of the light source; that information is under the rubric of the correlated color temperature (CCT). The CRI is determined by the light source’s spectrum. The pictures on the right show the continuous spectrum of an incandescent lamp and the discrete line spectrum of a fluorescent lamp; the former lamp has the higher CRI.

The value often quoted as ‘CRI’ on commercially available lighting products is properly called the CIE Ra value, ‘CRI’ being a general term and CIE Ra being the international standard color rendering index.

Numerically, the highest possible CIE Ra value is 100, and would only be given to a source identical to standardized daylight or a black body (incandescent lamps are effectively black bodies), dropping to negative values for some light sources. Low-pressure sodium lighting has negative CRI; fluorescent lights range from about 50 for the basic types, up to about 98 for the best multi-phosphor type. Typical LEDs have about 80+ CRI, while some manufacturers claim that their LEDs have achieved up to 98 CRI.[3]

CIE Ra‘s ability to predict color appearance has been criticized in favor of measures based on color appearance models, such as CIECAM02 and, for daylight simulators, the CIE Metamerism Index.[4] CRI is not a good indicator for use in visual assessment, especially for sources below 5000 kelvin (K).[5][6] A newer version of the CRI, R96, has been developed, but it has not replaced the better-known Ra general color rendering index.[7]

Emitted light spectrum determines the CRI of the lamp.

 

跨步向前走進

Lab color space

The Lab color space describes mathematically all perceivable colors in the three dimensions L for lightness and a and b for the color opponents green–red and blue–yellow. The terminology “Lab” originates from the Hunter 1948 color space.[1][2]Nowadays “Lab” is frequently mis-used as abbreviation for CIEL*a*b* 1976 color space (also CIELAB); the asterisks/stars distinguish the CIE version from Hunter’s original version. The difference from the Hunter Lab coordinates is that the CIELAB coordinates are created by a cube root transformation of the CIE XYZ color data, while the Hunter Lab coordinates are the result of a square root transformation. Other, less common examples of color spaces with Lab representations make use of the CIE 1994 color difference and the CIE 2000 color difference.

The Lab color space exceeds the gamuts of the RGB and CMYK color models (for example, ProPhoto RGB includes about 90% all perceivable colors). One of the most important attributes of the Lab model is device independence. This means that the colors are defined independent of their nature of creation or the device they are displayed on. The Lab color space is used when graphics for print have to be converted from RGB to CMYK, as the Lab gamut includes both the RGB and CMYK gamut. Also it is used as an interchange format between different devices as for its device independency. The space itself is a three-dimensional real number space, that contains an infinite number of possible representations of colors. However, in practice, the space is usually mapped onto a three-dimensional integer space for device-independent digital representation, and for these reasons, the L*, a*, and b* values are usually absolute, with a pre-defined range. The lightness, L*, represents the darkest black at L* = 0, and the brightest white at L* = 100. The color channels, a* and b*, will represent true neutral gray values at a* = 0 and b* = 0. The red/green opponent colors are represented along the a* axis, with green at negative a* values and red at positive a* values. The yellow/blue opponent colors are represented along the b* axis, with blue at negative b* values and yellow at positive b* values. The scaling and limits of the a* and b* axes will depend on the specific implementation of Lab color, as described below, but they often run in the range of ±100 or −128 to +127 (signed 8-bit integer).

Both the Hunter and the 1976 CIELAB color spaces were derived from the prior “master” space CIE 1931 XYZ color space, which can predict which spectral power distributions will be perceived as the same color (see metamerism), but which is not particularly perceptually uniform.[3] Strongly influenced by the Munsell color system, the intention of both “Lab” color spaces is to create a space that can be computed via simple formulas from the XYZ space but is more perceptually uniform than XYZ.[4] Perceptually uniform means that a change of the same amount in a color value should produce a change of about the same visual importance. When storing colors in limited precision values, this can improve the reproduction of tones. Both Lab spaces are relative to the white point of the XYZ data they were converted from. Lab values do not define absolute colors unless the white point is also specified. Often, in practice, the white point is assumed to follow a standard and is not explicitly stated (e.g., for “absolute colorimetric” rendering intent, the International Color Consortium L*a*b* values are relative to CIE standard illuminant D50, while they are relative to the unprinted substrate for other rendering intents).[5]

The lightness correlate in CIELAB is calculated using the cube root of the relative luminance.

The CIE 1976 (L*, a*, b*) color space (CIELAB), showing only colors that fit within the sRGB gamut (and can therefore be displayed on a typical computer display). Each axis of each square ranges from −128 to 128.

Advantages

 An example of color enhancement using LAB color mode in Photoshop. The left side of the photo is enhanced, while the right side is normal.

Unlike the RGB and CMYK color models, Lab color is designed to approximate human vision. It aspires to perceptual uniformity, and its L component closely matches human perception of lightness, although it does not take the Helmholtz–Kohlrausch effect into account. Thus, it can be used to make accurate color balance corrections by modifying output curves in the a and b components, or to adjust the lightness contrast using the L component. In RGB or CMYK spaces, which model the output of physical devices rather than human visual perception, these transformations can be done only with the help of appropriate blend modes in the editing application.

Because the Lab space is larger than the gamut of computer displays and printers and because the visual stepwidths are relatively different to the color area, a bitmap image represented as Lab requires more data per pixel to obtain the same precision as an RGB or CMYK bitmap. In the 1990s, when computer hardware and software were limited to storing and manipulating mostly 8-bit/channel bitmaps, converting an RGB image to Lab and back was a very lossy operation. With 16-bit/channel and floating-point support now common, the loss due to quantization is negligible.

Copyright and license-free: as it is fully mathematically defined, the CIELAB model is public domain, it is in all respects freely usable and integrable (also systematic Lab / HLC color value tables).

A big portion of the Lab coordinate space cannot be generated by spectral distributions, it therefore falls outside the human vision and such Lab values are not “colors”.

 

,一探究竟呦☆

 

 

 

 

 

 

 

 

GoPiGo 小汽車︰格點圖像算術《色彩空間》標準化‧想像實驗【四】

宇宙霹靂生,天地因是成,自然方便行︰

光的世界︰方便行

既然身處將入人工智慧、工業 4.0 的世界,為何不以電腦輔助學習 、軟體強化理解、程式探索未知耶?佛法古來行方便︰

維摩詰所說經卷上

姚秦三藏鳩摩羅什譯

方便品第二

爾 時毘耶離大城中有長者名維摩詰。已曾供養無量諸佛深植善本。得無生忍。辯才無礙。遊戲神通逮諸總持。獲無所畏降魔勞怨。入深法門善於智度。通 達方便大願成就。明了眾生心之所趣。又能分別諸根利鈍。久於佛道心已純淑決定大乘。諸有所作能善思量。住佛威儀心大如海。諸佛咨嗟弟子。釋梵世主所敬。欲 度人故以善方便居毘耶離。資財無量攝諸貧民。奉戒清淨攝諸毀禁。以忍調行攝諸恚怒。以大精進攝諸懈怠。一心禪寂攝諸亂意。以決定慧攝諸無智。雖為白衣奉持 沙門清淨律行。雖處居家不著三界。示有妻子常修梵行。現有眷屬常樂遠離。雖服寶飾而以相好嚴身。雖復飲食而以禪悅為味。若至博弈戲處輒以度人。受諸異道不 毀正信。雖明世典常樂佛法。一切見敬為供養中最。執持正法攝諸長幼。一切治生諧偶雖獲俗利不以喜悅。遊諸四衢饒益眾生。入治政法救護一切。入講論處導以大 乘。入諸學堂誘開童蒙。入諸婬舍示欲之過。入諸酒肆能立其志。若在長者長者中尊為說勝法。若在居士居士中尊斷其貪著。若在剎利剎利中尊教以忍辱。若在婆羅 門婆羅門中尊除其我慢。若在大臣大臣中尊教以正法。若在王子王子中尊示以忠孝。若在內官內官中尊化政宮女。若在庶民庶民中尊令興福力。若在梵天梵天中尊誨 以勝慧。若在帝釋帝釋中尊示現無常。若在護世護世中尊護諸眾生。長者維摩詰。以如是等無量方便饒益眾生。其以方便現身有疾。以其疾故。國王大臣長者居士婆 羅門等。及諸王子并餘官屬。無數千人皆往問疾。其往者。維摩詰因以身疾廣為說法。諸仁者。是身無常無強無力無堅。速朽之法不可信也。為苦為惱眾病所集。諸 仁者。如此身明智者所不怙。是身如聚沫不可撮摩。是身如泡不得久立。是身如炎從渴愛生。是身如芭蕉中無有堅。是身如幻從顛倒起。是身如夢為虛妄見。是身如 影從業緣現。是身如響屬諸因緣。是身如浮雲須臾變滅。是身如電念念不住。是身無主為如地。是身無我為如火。是身無壽為如風。是身無人為如水。是身不實四大 為家。是身為空離我我所。是身無知如草木瓦礫。是身無作風力所轉。是身不淨穢惡充滿。是身為虛偽。雖假以澡浴衣食必歸磨滅。是身為災百一病惱。是身如丘井 為老所逼。是身無定為要當死。是身如毒蛇如怨賊如空聚。陰界諸入所共合成。諸仁者。此可患厭當樂佛身。所以者何。佛身者即法身也。從無量功德智慧生 。從戒 定慧解脫解脫知見生。從慈悲喜捨生。從布施持戒忍辱柔和勤行精進禪定解脫三昧多聞智慧諸波羅蜜生。從方便生。從六通生 。從三明生。從三十七道品生。從止觀 生。從十力四無所畏十八不共法生。從斷一切不善法集一切善法生。從真實生。從不放逸生。從如是無量清淨法生如來身。諸仁者。欲得佛身斷一切眾生病者。當發 阿耨多羅三藐三菩提心。如是長者維摩詰。為諸問疾者如應說法。令無數千人皆發阿耨多羅三藐三菩提心。

 

。如是我聞,因此整裝蓄勢願見鯤鵬之變也。雖說萬事起頭難!!自由軟件早有無量光,豈不方便行??就從軟件安裝開始︰

# 派生程式庫
sudo apt-get install python-numpy python3-numpy
sudo apt-get install python-scipy python3-scipy
sudo apt-get install python-skimage python3-skimage
sudo pip install sympy
sudo pip3 install sympy

 

自徵己光明。

乃今憑借 Sympy

Matrices (linear algebra)

Creating Matrices

The linear algebra module is designed to be as simple as possible. First, we import and declare our first Matrix object:

 

運算『色彩空間』也。

pi@raspberrypi:~ ipython3 --pylab Python 3.4.2 (default, Oct 19 2014, 13:31:11)  Type "copyright", "credits" or "license" for more information.  IPython 2.3.0 -- An enhanced Interactive Python. ?         -> Introduction and overview of IPython's features. %quickref -> Quick reference. help      -> Python's own help system. object?   -> Details about 'object', use 'object??' for extra details. Using matplotlib backend: TkAgg  In [1]: from sympy import *  In [2]: XYZ2RGB = Matrix([[0.41847, -0.15866, -0.082835], [-0.091169, 0.25243, 0.015708], [0.00092090, -0.0025498, 0.17860]])  In [3]: def 規一化(V):    ...:     I = V[0] + V[1] + V[2]    ...:     return Matrix([V[0]/I, V[1]/I, V[2]/I])    ...:   In [4]: Cb =  規一化(XYZ2RGB * Matrix([0,0,1]))  In [5]: Cb Out[5]:  Matrix([ [-0.743094740430418], [ 0.140913046208499], [  1.60218169422192]])  In [6]: Cr = 規一化(XYZ2RGB * Matrix([1,0,0]))  In [7]: Cr Out[7]:  Matrix([ [   1.27496062876974], [ -0.277766352580373], [0.00280572381062933]])  In [8]: Cg = 規一化(XYZ2RGB * Matrix([0,1,0]))  In [9]: Cg Out[9]:  Matrix([ [  -1.73930774104858], [   2.76725988322762], [-0.0279521421790349]])  In [10]: W = 規一化(XYZ2RGB * Matrix([1,1,1]))  In [11]: W Out[11]:  Matrix([ [0.333339549016406], [0.333328247774456], [0.333332203209138]])  In [12]: RGB2XYZ = XYZ2RGB.inv()  In [13]: RGB2XYZ Out[13]:  Matrix([ [     2.7687985150634,   1.75169009300027,   1.13011129347384], [    0.99999442177259,   4.59062801876531, 0.0600501288284834], [-4.34426727413501e-9, 0.0565064496954302,   5.59413435794136]])  In [14]: 0.17697*RGB2XYZ Out[14]:  Matrix([ [     0.48999427321077,   0.309996595758258,  0.199995795606066], [    0.176969012821095,   0.812403440480896, 0.0106270712987767], [-7.68804979503673e-10, 0.00999994640260027,  0.989993957324882]])  In [15]:  </pre>    <span style="color: #666699;">檢視C_b, C_r, C_g之(r, g)分量</span>C_b = (-0.743094740430418, 0.140913046208499, 1.60218169422192)C_r = (1.27496062876974, -0.277766352580373, 0.00280572381062933)C_g = (-1.73930774104858, 2.76725988322762, -0.0279521421790349)$

 

皆有『-』成份,故而知 CIE1931 XYZ 『色彩空間』為『理論的』,它的『三原色』根本『無法顯示』哩!!無礙其作為『數學論理』基礎依據乎??

 

 

 

 

 

 

 

 

 

GoPiGo 小汽車︰格點圖像算術《色彩空間》標準化‧想像實驗【三】

看著 CIE 1931 r-g 色度圖︰

 

唸著 XYZ 色彩空間的目標︰

  1. 新顏色匹配函數在所有地方都大於等於零。在1931年,計算是憑藉手工或滑尺進行的,正值的規定有用於計算簡化。
  2.   \overline{y}(\lambda)顏色匹配函數精確的等於「CIE標準適應光觀察者」(CIE 1926)的適應光發光效率函數V(λ)。它是描述感知明度對波長的變換的亮度函數。亮度函數可以構造為RGB顏色匹配函數的線性組合的事實是沒有任何方式來保證的,但是被認為幾乎是真實的,因為人類視覺的幾乎線性本質。還有,這個要求的主要原因是計算簡單。
  3. 對於恆定能量白點,要求為x = y = z = 1/3。
  4. 由於色度定義和要求xy為正值的優勢,可以在三角形[1,0],[0,0],[0,1]內見到所有顏色的色域。在實踐中必須把色域完全的充入這個空間中。
  5.   \overline{z}(\lambda)可以在650 nm處被設置為零而仍保持在實驗誤差範圍內。為了計算簡單規定可以這樣做。

 

想著『三角形』 \Delta \ C_g C_b C_r 得包含整個『色彩舌形』,既然 Y(\lambda) 代表著『明度』,那麼連接『發光體』 C_bC_r 之線 \overline{C_b C_r} 豈非『無明度』 alychne  \bar{y}=Y=0 耶?有這種光源乎??偏巧 \bar{z} (\lambda) 在 650 nm 波長處為零,故線 \overline{C_g C_r} 得切於『舌形』!因為『三角形』 \Delta \ C_g C_b C_r 有『等能點』位置,所以 (r, g) = (\bar{x}, \bar{y}) = (\frac{1}{3}, \frac{1}{3}) 不得不是『白點』,於是『邏輯上』恰好得出 C_g, C_b, C_r(r, g) 色彩空間之『座標』!!…… 或因最近天氣燠熱,忽然不知所之,一時果如『夢夢』者乎??

當人們在『夢中』喃喃自語,人們真的說了些什麼嗎?若是講有人『記下』了『夢中』所憶︰

pi@raspberrypi ~ $ python3
Python 3.2.3 (default, Mar  1 2013, 11:53:50) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> from pyDatalog import pyDatalog
>>> pyDatalog.create_terms('T萬物, 有力, 長生')
>>> +有力('聖人', '能力')
>>> +有力('大盜', '能力')
>>> 長生(T萬物, '難死') <= 有力(T萬物, '能力')
長生(T萬物,'難死') <= 有力(T萬物,'能力')
>>> print(長生(T萬物,'難死'))
T萬物
---
聖人 
大盜 
>>> print(有力(T萬物,'能力'))
T萬物
---
大盜 
聖人 
>>>
>>> pyDatalog.create_terms('有死')
>>> pyDatalog.create_terms('定律')
>>> 定律(T萬物, '會死') <= 有死(T萬物, '人')
定律(T萬物,'會死') <= 有死(T萬物,'人')
>>> +有死('聖人', '人')
>>> +有死('大盜', '人')
>>> print(有死(T萬物,'人'))
T萬物
---
聖人 
大盜 
>>> print(定律(T萬物,'會死'))
T萬物
---
大盜 
聖人 
>>>
>>> print((有死(T萬物, '人')) & ~(定律(T萬物, '會死'))) 
[]
>>>
>>> print((T萬物 == '聖人') & ~(定律(T萬物, '會死')))
[]
>>> print((T萬物 == '大盜') & ~(定律(T萬物, '會死')))
[]
>>> print((定律('聖人', '會死')) & ~(定律('大盜', '會死'))) 
[]
>>>

 

那麼是否應該『設想』他可能『證明』了『聖人不死,大盜不止』的呢?然後在考察『邏輯』之後,『認同』他真的……的耶??

也 許與『清醒』的人談論『真、假』以及『是、非』都未必可信,那又將怎麽說那『夢中』之事?真的有誰知此『夢』會不會是一個『夢中之夢』!還不曉那人哪時方 將『醒來』的哩!!雖說你不能『證明』上帝『存在』,那你能說祂『不存在』的嗎?反之你不能『證明』上帝『不存在』,那你就能說祂『存在』的耶??此所以紅樓夢》講︰世間事終難定。因為『時間矛盾』早已經在那裡了 ,這又與『知或不知』有什麼關係的呢?於是『邏輯』與『宇宙』的關係到底是什麼??!!也許真正困惑的是『人世間』正在追求之『價值』的方向的吧!!??

有 的人以疏落的觀點看待『語言』,認為『凡是可以詮釋的現象,都是大自然之言說』。如是一沙一石皆有所說,更別講鳥語花香,以至於『動物語言』的哩!這樣的 人是否更容易了解『程式語言』的呢?也有人以嚴格之想法處理『語言』,認為『只有人類的語言才能稱得上言語』。因此海豚雖可溝通,卻不會講話,動物吼叫聲 除了警示意謂,了無它意,若說到花草的榮枯根本毫無意義的勒!這樣的人是否更容易了解『程式語言』的嗎?那麼什麼是『語言』的呢?什麼又是『程式語言』的 哩?假使給個『定義』是否就能將之釐定清楚,大家都講同家話的耶!考之於歷史,此事希望渺茫,難保不正因這種『多樣性』開拓了視野,加深了認識的嗎??也 許還是多些『兩極對話』的好!!談到理解一個『程式語言』

Programming language

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms.

就 是藉著一般『語言』的『共同性』以及『特殊性』,明白它的『符號』、『詞彙』、『文法』、『語義』,達於『能用』『善用 』之成果。或許說『分別心』易生『偏見』,卻也易見『差別』;『平等心』容易『概括』,卻也容易『失察』。既然同屬『一心』 ,歸之『一人』,何不使其能『和』,『統合』運用的呢?!

─── 摘自《勇闖新世界︰ 《 pyDatalog 》 導引《五》

 

該不會『氣候變遷』矣,天地已然是『春秋』不在耶!!

尚未進到『幽 竟夢卿』之地界,祇見『林中道』宛如紅紋斑馬導引遠方。原來這裡是用紅外光來照明的啊!入林後,剛走幾步,便為一塊看似立牌之物吸引,向前仔細一看,竟然 像是個『顯示器』,而且『耳內』還傳來聽不明的聲音,當真叫人好奇得很。便朝向Mrphs 問道︰這個是什麼呢? Mrphs 說︰你指的是『日月雙屏』的吧!那是一種並紅外線與可見光的兩用顯示器。據聞是 M♪o 特別為『幽境夢鄉』所設計的。可以在白天和夜晚講解此地景物。還新創了『形聲字譜』,利用『文字辨識』技術,輔以『骨聽傳音』方法 ,既不打擾四周幽靜,又能夠耳中喃喃有語。它以『隔空觸控』來操縱,先生正看的圖像是『古蕉園』,靠近東邊山壁『木火泉』之旁 ,所聽到的『耳語』當是 Tux 語對應之『山野蕉源流』解說史的了。……

此刻深感 M♪o 所謂『幽竟夢卿』或有『傷春悲秋』之意!想當是時天地已然是『春秋』不在,『字詞對錯』之爭,真存『價值意義』的嗎?前行者不該忘『幽境夢鄉』曾經有

20110121105956554_2309

紅樓夢曲‧聰明累

機關算盡太聰明,反算了卿卿性命!生前心已碎,死後性空靈。家富人寧,終有個,家亡人散各奔騰。枉費了意懸懸半世心,好一似盪悠悠三更夢。忽喇喇似大廈傾,昏慘慘似燈將盡。呀!一場歡喜忽悲辛。歎人世,終難定!

百科全書講︰

曲名“聰明累”,是受聰明之連累、聰明自誤的意思。語出北宋蘇軾《洗兒》詩:“人皆養子望聰明,我被聰明誤一生。惟願孩兒愚且魯,無災無難到公卿。

明‧錢鶴灘明日歌

明日復明日,
明日何其多!
我生待明日,
萬事成蹉跎。
世人苦被明日累,
春去秋來老將至。
朝看水東流,
暮看日西墜。
百年明日能幾何?
請君聽我明日歌!

200px-Pilgrim's_Progress_first_edition_1678
約翰‧班揚 John Bunyan
天路歷程

一個自在的人活在當下,自由選擇他的旅程。

The Pilgrim’s Progress John Bunyan

As I walk’d through the wilderness of this world, I lighted on a certain place, where was a Denn; And I laid me down in that place to sleep: And as I slept I dreamed a Dream. I dreamed, and behold I saw a Man cloathed with Raggs, standing in a certain place, with his face from his own House, a Book in his hand, and a great burden upon his Back. I looked and saw him open the Book, and Read therein; and as he read, he wept and trembled: and not being able longer to contain, he brake out with a lamentable cry; saying, what shall I do?

讀一段封塵往事︰

……

─── 引自《自由日?!??!!

或終知萬般事『因緣生法』!!

Prajnyaapaaramitaa_Hridaya_by_Ouyang_Xun

 

至於感一切象『和光同塵』的耶??

─── 摘自《勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧境鄉之留

 

恍惚醒非醒,彷彿覺得『依數量據事實』,然後『正反問詰』求『自證』吧☆