Archive for July, 2012

Flowers from Rousseau’s herbarium

July 25, 2012

A wonderful passage from Ernst Jünger‘s magnum opus Eumeswil:

My genitor strikes me—to maintain Vigo’s image—as someone who delights in dried bouquets, in flowers from Rousseau’s herbarium. I can even sympathize with this as an academic. On the tribune, my old man’s self-deception becomes a deception of the populace.

On the other hand, my interest in the Domo’s squabbles with the tribunes is metahistorical; I am absorbed in the model, not the urgent issue. At the luminar, I studied the particulars of Rousseau’s visit with Hume, plus the misunderstandings that led to Hume’s invitation. Jean-Jacques’s life leads from disappointment to disappointment to solitude. This is reflected in his successors, down to the present day. It hints that something human was touched at the core. The great ideas spring up in the heart, says an old Frenchman. One could add: and are thwarted by the world.

I consider it poor historical form to make fun of ancestral mistakes without respecting the eros that was linked to them. We are no less in bondage to the Zeitgeist; folly is handed down, we merely don a new cap.

I therefore would not resent my genitor for merely believing in a fallacy; no one can help that. What disturbs me is not error but triteness, the rehashing of bromides that once moved the world as grand utterances.

Errors can shake the political world to its very core; yet they are like diseases: in a crisis, they can accomplish a great deal, and even effect a cure—as hearts are tested in a fever. An acute illness: that is the waterfall with new energies. A chronic illness: sickliness, morass. Such is Eumeswil: we are wasting away—of course, only for lack of ideas; otherwise, infamy has been worthwhile.

The lack of ideas or—put more simply—of gods causes an inexplicable moroseness, almost like a fog that the sun fails to penetrate. The world turns colorless; words lose substance, especially when they are to transcend sheer communication.

__________

Source:

Ernst Jünger, Joachim Neugroschel (translator), Eumeswil, Marsilio Publishers, New York, 1993.

Experiments with the Python Imaging Library

July 14, 2012

Back in February 2009, I spent some time playing with the Python Imaging Library (PIL). I even started a blog post on my experiments with PIL, but I never finished it. I will finish it now. Be warned: this post will have a very experimental flavor.

Since we are all acquainted with Lena, as a test image I will use the following photograph of the late Ruslana Korshunova (1987-2008):

The flowers and the hair create plenty of high-frequency content. Let us now use the Python Imaging Library (PIL) to convert the image to B&W, invert the image, and apply several elementary filters to it.

__________

Python script

The following Python script opens the image above and performs the aforementioned operations on it:

import Image
import ImageChops
import ImageFilter

# open image and print format
Im = Image.open('Ruslana.jpg')
print Im.format, Im.size, Im.mode

# convert to black & white
ImBW = Im.convert('1')
ImBW.save('Ruslana_BW.bmp',"BMP")

# invert image (obtain negative)
ImInv = ImageChops.invert(Im)
ImInv.save('Ruslana_Inv.jpg',"JPEG")

# apply BLUR filter
ImBlur = Im.filter(ImageFilter.BLUR)
ImBlur.save('Ruslana_BLUR.jpg',"JPEG")

# apply CONTOUR filter
ImContour = Im.filter(ImageFilter.CONTOUR)
ImContour.save('Ruslana_CONTOUR.jpg',"JPEG")

# apply DETAIL filter
ImDetail = Im.filter(ImageFilter.DETAIL)
ImDetail.save('Ruslana_DETAIL.jpg',"JPEG")

# apply EDGE_ENHANCE filter
ImEH = Im.filter(ImageFilter.EDGE_ENHANCE)
ImEH.save('Ruslana_EDGE_ENHANCE.jpg',"JPEG")

# apply EDGE_ENHANCE_MORE filter
ImEHM = Im.filter(ImageFilter.EDGE_ENHANCE_MORE)
ImEHM.save('Ruslana_EHM.jpg',"JPEG")

# apply EMBOSS filter
ImEmb = Im.filter(ImageFilter.EMBOSS)
ImEmb.save('Ruslana_EMBOSS.jpg',"JPEG")

# apply FIND_EDGES filter
ImEdges = Im.filter(ImageFilter.FIND_EDGES)
ImEdges = ImEdges.save('Ruslana_FIND_EDGES.jpg',"JPEG")

# apply SMOOTH filter
ImSmooth = Im.filter(ImageFilter.SMOOTH)
ImSmooth = ImSmooth.save('Ruslana_SMOOTH.jpg',"JPEG")

# apply SMOOTH_MORE filter
ImSmoothMore = Im.filter(ImageFilter.SMOOTH_MORE)
ImSmoothMore = ImSmoothMore.save('Ruslana_SMOOTH_MORE.jpg',"JPEG")

# apply SHARPEN filter
ImSharp = Im.filter(ImageFilter.SHARPEN)
ImSharp = ImSharp.save('Ruslana_SHARPEN.jpg',"JPEG")

Let us now see how the processed images look like.

__________

Results

Here’s the B&W image:

The script produced a monochromatic (1 bit per pixel) BMP file. Since WordPress.com does not allow one to upload BMP files, I converted it to JPEG, which greatly increased the size of the file. How ironic! In this case, lossy compression actually led to expansion!

The inverted (i.e., negative) image looks quite interesting:

It looks as though the EDGE_ENHANCE_MORE filter performs some form of amplification of the high-frequency content of the image:

Look how funny the flowers and her hair look! If we want to extract the actual edges, we can use the FIND_EDGES filter:

The other images produced by the Python script are not particularly interesting and, therefore, I have not posted them here.

__________

Concluding remarks

The Python Imaging Library (PIL) offers the capability to perform some very basic image processing. However, given Python’s lack of a matrix data structure, one cannot do that much. I believe the PIL is useful to process large collections of photos (to generate thumbnails, for example), not to perform 2-dimensional signal processing.

__________

Related:

Vladimir Arnold on mathematical models

July 3, 2012

Vladimir Igorevich Arnold (1937-2010) on mathematical models [1]:

The scheme of construction of a mathematical theory is exactly the same as that in any other natural science. First we consider some objects and make some observations in special cases. Then we try and find the limits of application of our observations, look for counter-examples which would prevent unjustified extension of our observations onto a too wide range of events.

As a result we formulate the empirical discovery that we made (for example, the Fermat conjecture or Poincaré conjecture) as clearly as possible. After this there comes the difficult period of checking as to how reliable are the conclusions.

At this point a special technique has been developed in mathematics. This technique, when applied to the real world, is sometimes useful, but can sometimes also lead to self-deception. This technique is called modelling. When constructing a model, the following idealisation is made: certain facts which are only known with a certain degree of probability or with a certain degree of accuracy, are considered to be “absolutely” correct and are accepted as “axioms”. The sense of this “absoluteness” lies precisely in the fact that we allow ourselves to use these “facts” according to the rules of formal logic, in the process declaring as “theorems” all that we can derive from them.

It is obvious that in any real-life activity it is impossible to wholly rely on such deductions. The reason is at least that the parameters of the studied phenomena are never known absolutely exactly and a small change in parameters (for example, the initial conditions of a process) can totally change the result. Say, for this reason a reliable long-term weather forecast is impossible and will remain impossible, no matter how much we develop computers and devices which record initial conditions.

In exactly the same way a small change in axioms (of which we cannot be completely sure) is capable, generally speaking, of leading to completely different conclusions than those that are obtained from theorems which have been deduced from the accepted axioms. The longer and fancier is the chain of deductions (“proofs”), the less reliable is the final result.

Complex models are rarely useful (unless for those writing their dissertations).

The mathematical technique of modelling consists of ignoring this trouble and speaking about your deductive model in such a way as if it coincided with reality. The fact that this path, which is obviously incorrect from the point of view of natural science, often leads to useful results in physics is called “the inconceivable effectiveness of mathematics in natural sciences” (or “the Wigner principle”).

Here we can add a remark by I.M. Gel’fand: there exists yet another phenomenon which is comparable in its inconceivability with the inconceivable effectiveness of mathematics in physics noted by Wigner – this is the equally inconceivable ineffectiveness of mathematics in biology.

“The subtle poison of mathematical education” (in F. Klein‘s words) for a physicist consists precisely in that the absolutised model separates from the reality and is no longer compared with it.

__________

I did remove one comment in parentheses to shorten the passage. Hence, this is not an exact reproduction of the original passage in [1]. The “Wigner Principle” that Arnold refers to is the thesis of Eugene Wigner’s famous article [2]. Lastly, I do wonder how many theoretical chemists, theoretical physicists, and systems biologists out there were angered by Arnold’s “heretical” thoughts.

__________

References

[1] Vladimir Igorevich Arnold, A.V. Goryunov (translator), On teaching mathematics, 1998.

[2] Eugene Paul Wigner, The Unreasonable Effectiveness of Mathematics in the Natural Sciences, February 1960.


Follow

Get every new post delivered to your Inbox.

Join 76 other followers