Subscribe RSS

Posts Tagged ‘example’

A minimal ImageJ Plugin in Clojure: image inversion

January 15th, 2010 by fmn | 2 Comments | Filed in Enseignement, Research

I show in this post how to write an ImageJ plugin with Clojure. This example is taken from Digital Image Processing: An Algorithmic Introduction Using Java: an image inversion (page 32).

The goal is to invert all the pixels of a 8-bit grayscale image, turning an image into its negative. As a pixel value is coded with 8 bits, the higher possible value is 255. The operation is thus to transform each pixel value v into 255-v.

I first present the plugin in Java, with a description of the essentials elements of an ImageJ plugin. Then, i give several Clojure versions. The last is as fast as the Java one, but more reusable.

(more…)

Tags: , , , , , , , ,

How to find good examples of triangular inequality for visual similarity?

June 8th, 2009 by fmn | 4 Comments | Filed in Research
Amos Tversky works have shown that human similarity judgement is not a metric (in a mathematic sens). In particular the following properties are not always verified:
  1. Minimality : \delta(a,b) \geq \delta(a, a) = 0.
  2. Symmetry : \delta(a, b) = \delta(b, a).
  3. Triangular inequality : \delta(a, b) + \delta(b, c) \geq \delta(a, c).

Computer vision shows more and more interests in Tversky’s results. In their introduction, many publications try to illustrate the non-verification of the previous properties. My point is that the examples of the non-verification of the triangular inequality are not correct (for images).

By example, in a projet report (Graphem – in french) on the visual similarity, the authors propose these images:

b_01
A                               B                               C
According to the authors:
  1. left (A) and right (C) images can be judged quite dissimilars.
  2. But middle image (B) can be judged similar to (A) et à (C).
  3. The distance d(A, C) would thus be greater than the sum d(A,B)+d(B,C), contradicting the triangle inequality.
I don’t see in this example where is the non verification of the triangle inequality:
  1. Ok for the first point, one can imagine an experience reinforcing these facts. The distance d(A, C) is thus obtained “high”. It could be discussed on the precise measure. Or if the measure is d(A, C) or d(C, A). But this can be admitted.
  2. If B is judged similar to A and C, the measures d(B, A) and d(B, C) must be “low”, in  any case smaller than d(A, C).

For the last point, a conclusion on the triangle inequality can only be given from a comparison between d(A, C) and the sum d(B, A) + d(B, C). But the numerical values are unknown, or not given by the authors. It is thus impossible to compute the sum and thus impossible to conclude. More formally, we have:

d(B, A) \leq d(A, C)

and

d(B, C) \leq d(A, C).

The only possible conclusion is d(B, A) + d(B, C) \leq 2 d(A, C), but not d(B, A) + d(B, C) \geq d(A, C).

Other bad examples can be find. Thus in a diaporama from J.M. Jolion (in french) on the similarity between images:
similarite_01-1
According to the author: with respect to a partial registration the triangle inequality is not validated d(a, b) + d(b, c) <= d(a, c). My previous commentaries still apply, i don’t understand how the author produces its conclusion.
In order to be complete, in E. Baudrier PhD thesis (p. 67) (that i supervised), the same kind of examples is reproduced:
scriptthesebaudrier_01-1
Triangular inequality: left and center images are similar, center and right ones also. If the similarity verify the triangular inequality, the left and right images are simular. It is not the case (Baudrier, 2005)
There, the author doesn’t try to compute any sum and its argument is close to Tversky one’s in “Features of Similarity” :
The triangle inequality differs from minimality and symmetry in that it cannot be formulated in ordinal terms. It asserts that one distante must be smaller than the sum of the two others, and hence it cannot be readily refuted with ordinal or even interval data. However, the triangle inequality implies that if A is quite similar to B, and B is quite similar to C, then A and C cannot be very dissimilar from each other.
Here Tversky makes a confusion between transitivity and triangular inequality. Does the former implies the latter ? It is not proved! Elsewhere in its publication, Tversky points out that visual stimulus are different in nature of others stimulus (verbal ones by example). Can visual stimulus lead to a verification of the triangular inequality? I don’t think so but still can’t find indisputable example of this in the case of visual objects.
FMN.

Tags: , , , ,

Détection de motifs par intercorrélation

November 28th, 2008 by fmn | 7 Comments | Filed in Popularization

Translate original post with Google Translate

Avec cet article, je commence une petite série destinée à expliquer quelques méthodes permettant de trouver des objets dans une image. Toute les méthodes seront accompagnées d’illustrations reproductible sous sage. Les codes sources seront également téléchargeables sous la forme d’un notebook sage.

Notebook

Vous pouvez télécharger le notebook sage contenant le code complet présenté ici accompagné des images de test : detecteur_de_motifs_base__sur_une_intercorrelation.sws

Objectif

Pour ce premier article, imaginons que j’ai l’image suivante (que j’appelle image reférence)  :
Image de référence

Je pense que vous avez tous remarqués le mignon petit ourson au centre de l’image. Tentons de le retrouver. Il faut d’abord posséder une image contenant un exemplaire de l’objet à chercher, en voici une que j’appelle image motif :
ourson
(more…)

Tags: , , , , , ,