Arthritic Hand-Finger Movement Similarity Measurements: Tolerance Near Set Approach

The problem considered in this paper is how to measure the degree of resemblance between nonarthritic and arthritic hand movements during rehabilitation exercise. The solution to this problem stems from recent work on a tolerance space view of digital images and the introduction of image resemblance measures. The motivation for this work is both to quantify and to visualize differences between hand-finger movements in an effort to provide clinicians and physicians with indications of the efficacy of the prescribed rehabilitation exercise. The more recent introduction of tolerance near sets has led to a useful approach for measuring the similarity of sets of objects and their application to the problem of classifying image sequences extracted from videos showing finger-hand movement during rehabilitation exercise. The approach to measuring the resemblance between hand movement images introduced in this paper is based on an application of the well-known Hausdorff distance measure and a tolerance nearness measure. The contribution of this paper is an approach to measuring as well as visualizing the degree of separation between images in arthritic and nonarthritic hand-finger motion videos captured during rehabilitation exercise.


Introduction
This paper presents an approach to quantifying and visualizing the degree of separation between images in arthritic and non-arthritic hand-finger motion videos captured during rehabilitation exercises. The proposed approach is based on tolerance near set theory. In this paper, a complete procedure for determining the degree of resemblance between non-arthritic and arthritic hand movements is presented. Measuring resemblances between hand motions during rehabilitation exercise has two main advantages: (i) apart from measurements of stiffness and pain before and after rehabilitation exercise, the separation as well as the degree of resemblance between what would be considered normal hand-finger motion and arthritic hand-finger motion can be measured (resemblance between sequences of non-arthritic and arthritic hand-finger movements are reported in this paper) and (ii) hand motion resemblance measurements provide a basis for assessing the efficacy of rehabilitation exercise regimes for arthritic patients. Videos made during hand-finger motion tracking that are part of a telerehabilitation system for automatic tracking and assessment of rehabilitation exercise by those with arthritis are a source of image sequences that are analyzed in this paper (see, e.g., [1]). The approach presented here can be used for assessment and comparison in problem domains that can be formulated in terms of a set of objects with descriptions represented by feature value vectors. A feature vector is an n-dimensional vector of numerical features representing an object description. Disjoint sets containing objects with similar descriptions are near sets. As an example of the degree of nearness between two sets, consider Figure 1 as two pairs of ovals containing colored segments. Each color in the figures corresponds to an equivalence class where all pixels in the class have matching descriptions, for example, pixels with matching colors. Thus, the ovals in Figure 1(a) are closer (more near) to each other in terms of their descriptions than the sets in Figure 1  patterns of interest. The contribution of this paper is an approach to measuring as well as visualizing the degree of separation between images in arthritic and non-arthritic hand-finger motion videos captured during rehabilitation exercise. This paper is organized as follows. Section 2 presents related works to help establish a context for this research. Section 3 gives a brief introduction to near set theory, Section 4 presents the image processing necessary to perform feature extraction on the hand images, Section 5 presents the algorithm used to generate the results presented in this paper, and finally Section 6 presents a discussion on the results.

Related Works
The hand-finger motion classification method reported in this paper is an outgrowth of earlier work on medical imaging [2,3] and, in particular, on comparing hand movement image sequences [4]. The term arthritis is derived from the Greek words arthron (referring to joints) and the suffix itis (inflammation of). Interest in arthritis has not always been approached with as much fervor as other human ailments, particularly since the most common form (osteoarthritis) is not likely to be fatal [5]. However, human life expectancy has continued to improve, and, hence, an increase in arthritis cases is highly probable. Typically, with age there is a much greater likelihood of joints degrading and potentially wearing out. There are a a number of factors that lead to arthritis, for example, lifestyle, heredity, joint trauma, and even work-related, repetitive tasks [5]. Although the prognosis may not be fatal, quality of life for arthritis patients can be severely limited due to pain and disability. The resulting costs associated with health care for arthritis patients has become significant. Forbes published a list of the most expensive diseases and arthritis made the list in the USA, totaling 7.8 billion dollars of annual spending reported from 2002 [6]. As a result of reduced quality of life and the burden placed on health-care systems, continued research efforts are ongoing in drugs, joint replacements, intra-articular injections, and other experimental treatments of the disease [7].
While the applications presented in this paper are based on the comparison of hand movement images, the proposed approach is suitable for investigation of problems formated in a similar manner. For example, Schubert et al. [23] presented a neural cell detection system to measure fluorescent lymphocytes in images of tissue sections. Their approach was to use a neural network, trained from a set of cell image patches, to determine if a pixel is the centre of one fluorescent cell. Each pixel was associated with a 6-dimensional feature vector generated by principal component analysis (PCA) on a 15 × 15 subimage centred on the pixel. Another example of a problem formated in a manner conducive to the proposed approach to discovering affinities in medical data is given by Yu et al. [24] in terms of a protein-protein interaction extraction from biomedical text. Given an abstract of an article containing instances of proteins, the system detects whether a relationship exists for each pair of proteins in the abstract. This problem is solved by using support vector machines, where each sentence containing a reference to proteins in a given abstract is considered an object and lexical and syntactic features are used to create a featurevalue vector.

Tolerance Near Sets
Tolerance near sets are defined in the context of tolerance spaces. The term tolerance space was coined by Zeeman in 1961 in modelling visual perception with tolerances [25].
consists of a set X and a binary relation on X ( ⊂ X × X) that is reflexive (for all x ∈ X, x x, instead of (x, y) ∈ we write x y) and symmetric (for all x, y ∈ X, if x y, then y x) but transitivity of is not required. In this case, is called a tolerance relation (on X) or simply a tolerance. All sets in near set theory consist of perceptual objects, defined as something that has its origin in the physical world. Moreover, all objects need to be described in some manner. This is accomplished by a probe function, a realvalued function representing a feature of a perceptual object [26]. Next, a perceptual system O, F consists of a nonempty set O of sample objects, and a non-empty set F of real-valued functions φ ∈ F such that φ : O → R [8]. The elements of O are called perceptual objects and the functions in F are called probe functions. The description of an object x ∈ O is a vector given by where l is the length of the vector is a probe function value that is part of the description of the object x ∈ O. Keeping these concepts in mind, a perceptual tolerance relation can be described as follows.
Definition 1 (perceptual tolerance relation [12,13] see [2,17] for applications)). Let O, F be a perceptual system and let ε ∈ R. For every B ⊆ F a reflexive and symmetric tolerance relation ∼ =B,ε is defined as follows: For notational convenience, this relation can be written as ∼ =B instead of ∼ =B,ε with the understanding that ε is inherent to the definition of the tolerance relation. Definition 1 gives rise to two very useful types of sets, namely, a neighbourhood and a tolerance class. A neighbourhood of an object x ∈ O is defined as An example of a neighbourhood in 2D feature space is given in Figure 2 where the position of all the objects is given by the numbers 1 to 21 and the neighbourhood is defined with respect to the object labelled 1. Notice that the distance between all the objects and object 1 is less than or equal to ε = 0.1 but that not all the pairs of objects in the neighbourhood of x satisfy the tolerance relation. In contrast, all the pairs of objects within a preclass must satisfy the tolerance relation.
A set X ⊆ O is a pre-class when x ∼ =B y for any pair x, y ∈ X [27]. A maximal pre-class with respect to inclusion is called a tolerance class. An example of a tolerance class is given in Figure 2 since no object can be added to the orange set and still satisfy the condition that any pair x, y ∈ X must be within ε of each other. As mentioned above, we are interested in sets that have some objects that are similar to each other, where the term "similar" is quantified by the tolerance relation given in Definition 1. Thus, we introduce the following definition for tolerance near sets. Definition 2 (tolerance near set relation [12,13]). Let O, F be a perceptual system, and let X, Y ⊆ O, ε ∈ R. A set X is near to a set Y within the perceptual system O, F (X F Y ) if and only if there exists x ∈ X and y ∈ Y and there is B ⊆ F such that x ∼ =B,ε y.
Definition 3 (tolerance near sets [12,13]). Let O, F be a perceptual system, and let ε ∈ R, B ⊆ F. Further, let X, Y ⊆ O denote disjoint sets with coverings determined by the tolerance relation ∼ =B,ε, and let H∼ =B,ε (X), H∼ =B,ε (Y ) denote the set of tolerance classes for X, Y , respectively. Sets X, Y are tolerance near sets if and only if there are tolerance classes . . , f s }, and F is a set of functions that operate on images. Then the sets X, Y ∈ O are perceptually near each other if there are x ∈ X (i.e., subimages from X) and y ∈ Y (i.e., subimages from Y ) and there is B ⊆ F such that x ∼ =B y. This would be the case when there are two or more subimages that have similar descriptions using the probe functions in B.
Definition 2 provides a means of determining whether two sets of perceptual objects are near each other. Suppose, however, that we want to consider the problem of comparing objects in tolerance near sets (such as sets created by separate images) and measure the degree of similarity between the two sets. This problem is of interest because its solution provides a formal basis for measuring the resemblance of sets of objects that are described by feature value vectors and has many applications, such as the problem of measuring image resemblance presented in this paper. In other words, a method for determining the degree in which two tolerance near sets are similar is needed. Let X and Y be two disjoint sets, and let Z = X ∪ Y . Then a nearness measure [2,28,29] between two sets is given by The idea behind (4) is that similar sets should produce tolerance classes that are evenly divided between X and Y . This is measured by counting the number of objects that belong to sets X and Y for each tolerance class and then comparing these counts as a proper fraction. Then, the measure is simply a weighted average of all the fractions. A weighted average was selected to give preference to larger tolerance classes with the idea that a larger tolerance class contains more perceptually relevant information.
Calculating the proper fraction for a single tolerance class C is shown graphically in Figure 3 using the example given above concerning subimages. Figure 3(a) gives a sample tolerance class in 3D feature space, while Figure 3(b) shows the position of the subimages in the images (i.e., sets X and Y ) that belong to the tolerance class in Figure 3(a). Observe that a tolerance class in feature space can be distributed throughout the images and that tNM would compare the number of objects from the tolerance class in set X to the number of objects from the tolerance class in set Y . In this case, the ratio would be close to 1 because the number of objects in both sets X and Y are roughly the same.

Segmenting Hand Motion Images and Feature Extraction
Recall that the focus of this paper is to present an application of the tolerance near set approach by way of comparing the hand movements of an arthritic patient with normal hand movements during rehabilitation exercises. Digital images obtained from video captured during the exercises are used to make the comparison (see, e.g., [30]). As a result, a brief presentation of the image segmentation and feature extraction methods used in the reported experiments are presented in this section. Measuring the resemblance of hand motion images is made possible by segmenting the images. Segmenting a digital image is a separation of image regions that are nonoverlapping and is important in this work since it facilitates separation of image background from the portion of a hand in an image (see, e.g., Figure 4).

Mean Shift Segmentation Algorithm. The mean shift algorithm (introduced in [31]
) segments an image using kernel density estimation, a nonparametric technique for estimating the distribution of a random variable. Nonparametric techniques are characterized by their lack of assumptions about the distributions and differ from parametric techniques which assume a given distribution and then estimate parameters which describe the density, like mean or variance [34]. The estimate of the distribution at a point x is calculated from the number of observations within a volume in d-dimensional space centred on x and a kernel that weights the importance of the observations [34]. The segmentations used in this paper were created using an implementation of the mean shift segmentation algorithm called EDISON [32], a system for which both the source code and binaries are freely available online. A sample segmentation produced by the EDISON system is given in Figure 4.

Multiscale Edge Detection.
Mallat's multiscale edge detection method uses Wavelet theory to find edges in an image [33]. Edges are located at points of sharp variation in pixel intensity identified by calculating the gradient of a smoothed image (i.e., an image that has been blurred). Then, edge pixels are defined as those that have locally maximal gradient magnitudes in the direction of the gradient. Examples of our own implementation of Mallat's edge detection and edge orientation methods are given in Figure 5.

Feature
Extraction. An example of the type of images obtained directly from the video is given in Figure 6(a). These images needed to be further processed to remove the common background (e.g., all the images contain the white desktop, the square blue sensor, etc.) that would produce results indicating that all the images were similar. Therefore, the mean shift segmentation algorithm was used to create a segment containing only the hand in each image. The resultant segmented image is given in Figure 6(b) where pixels with similar colour are now grouped together into segments. The next step was to use the segment representing the hand as a mask to separate the hand from the original image (given in Figure 6(c)). Next, notice the absence of the majority of the black background (representing the masked pixels in the original image) in Figure 6(d). Each image was cropped to an image containing only the hand because the output of probe functions on the black background would be the same for each image. Next, perceptual objects are created in the same manner as the example given in Section 3. Specifically, each image was divided into square subimages such that no subimage overlapped, where each subimage represents an object in the near set sense and a probe function is then any function that can operate on images. In this case, we used only one probe function, namely, the average orientation of lines within a subimage. For example, the orientation can be determined (using the process given in Section 4.2) for each pixel considered part of a line detected in an image. Then, the probe function takes an average of all the orientations for pixels belonging to edges within a specific subimage. An example of the output of this probe function is given in Figure 6(d).

Tolerance Class Algorithm
The practical application of the nearness measure, tNM, rests on the ability to efficiently find all the classes for a set Z = X ∪ Y . In the case where ε = 0, the process is straightforward, that is, the first object is assigned to a tolerance class, then the description of each subsequent object is compared to objects in each existing tolerance class. If a given object's description does not match any of the descriptions of the existing tolerance classes, then a new class is created. Thus, the algorithm runtime ranges from order O(|Z| 2 ) in the worst case, which occurs when none of the object descriptions match, to O(|Z|), which occurs when all the object descriptions are equivalent. In practice, the runtime is somewhere between these two extremes. The approach to finding tolerance classes in the case where ε / = 0 is based on the observations presented in the following Propositions. Proof. Given a tolerance space X, ∼ =B,ε and tolerance class A ⊂ ∼ =B,ε, then (x, y) ∈ ∼ =B,ε for every x, y ∈ A. Let N∼ =B,ε (x) be a neighbourhood of x ∈ X and assume that x ∈ A. For y ∈ A, (x, y) ∈ ∼ =B,ε. Hence, A ⊂ N∼ =B,ε (x). As a result, N∼ =B,ε (x) is superset of all tolerance classes containing x. Proposition 2. Let z 1 , . . . , z n ∈ Z be a succession of objects, called query points, such that z n ∈ N(z n−1 ) \ z n−1 , N(z n ) ⊆ N(z n−1 )\z n−1 ⊆ · · · ⊆ N(z 1 )\z 1 , and define N(z 0 )\z 0 as the original set of objects (i.e., N(z 0 ) \ z 0 = Z). In other words, the series of query points, z 1 , . . . , z n ∈ Z, is selected such that each subsequent object z n (where z n / = z n−1 ) is obtained from the neighbourhood N(z n−1 ), that is created only using objects from the previous neighbourhood. Then, under these conditions, the set {z 1 , . . . , z n } is a pre-class.
Proof. For n ≥ 2, let S(n) be the statement that {z 1 , . . . , z n } is a pre-class given the conditions in Proposition 2.

Base
Step (n = 2). Let z 1 ∈ Z be the first query point, and let N(z 1 ) be the first neighbourhood. Next, let z 2 represent the next query object. Since z 2 must come from N(z 1 ) and all objects in x ∈ N(z 1 ) satisfy the tolerance relation z 1 ∼ =B, x, S(2) holds.

Corollary 1.
Let z 1 , . . . , z n ∈ Z be a succession of objects, called query points, such that z n ∈ N(z n−1 ) \ z n−1 , N(z n ) ⊆ N(z n−1 )\z n−1 ⊆ · · · ⊆ N(z 1 )\z 1 , and define N(z 0 )\z 0 as the original set of objects (i.e., N(z 0 ) \ z 0 = Z). In other words, the series of query points, z 1 , . . . , z n ∈ Z, is selected such that each subsequent object z n (where z n / = z n−1 ) is obtained from the neighbourhood N(z n−1 ) that is created only using objects from the previous neighbourhood. Then, under these conditions, the set {z 1 , . . . , z n } is a tolerance class if |N (z n )| = 1.
Proof. Since the cardinality of N(z 1 ) is finite for any practical application and the conditions given in Proposition 2 dictate that each successive neighbourhood will be smaller than the last, there is an n such that |N (z n )| = 1. By Proposition 2 the series of query points {z 1 , . . . , z n } is a pre-class, and by Proposition 1 there are no other objects that can be added to the class {z 1 , . . . , z n }. As a result, this pre-class is maximal with respect to inclusion and by definition is called a tolerance class.  The above observations are visualized in Figure 7 using the example first introduced in Figure 2. Starting with the the proof of Proposition 2, a visual example of the base step is given in Figures 7(a) and 7(b). In this case, only the first 21 objects of Z are shown, where z 1 is the object labelled 1 and N(z 1 ) is the circle containing the objects {1, . . . , 21}. Next, according to Proposition 2, another query point z 2 ∈ N(z 1 ) \ z 1 is selected (i.e., z 2 can be any object in N(z 1 ) except z 1 ). Here, z 2 = 20 is selected because it is the next object closest to z 1 . Since z 1 ∼ =B, z 2 , the class {z 1 , z 2 } is a pre-class. Also, note that Figure 7(b) also gives an example of N(z 2 ) ⊂ N(z 1 ) as the area shaded grey, and the area shaded red is the part of N(z 1 ) that does not satisfy the tolerance relation with z 2 . Continuing on, an example of the inductive step from the proof of Proposition 2 is given in Figure 7(e). In this case, there are k = 5 objects and {z 1 , . . . , z 5 } = {1, 20, 10, 6, 15}. The area shaded grey represents N(z 5 ) \ z 5 ⊂, . . . , ⊂ N(z 1 ) \ z 1 along with the query points {z 1 , . . . , z 5 }(according to the conditions given in Proposition 2 queries points are not included in subsequent neighbourhoods), and the other shaded areas represent the parts of successive neighbourhoods that no longer satisfy the tolerance relation with every query point. For instance, all the colours except red are in N (20), and all the colours except red and purple are in N (10) and N (6). Notice that all the objects in the grey area satisfy the tolerance with all the query points but that the grey area does not represent a preclass. Moreover, any new query point selected from N(z 5 ) \ z 5 = {16, 18, 3, 14, 11} will also satisfy the tolerance relation with all the query points {z 1 , . . . , z 5 }. Finally, Figure 7(f) demonstrates the idea behind Corollary 1. In this figure, the area shaded grey represents the neighbourhood of z 7 = 3 along with all previous query points. Observe that (besides query points) the shaded area only contains one object, namely, z 7 . Also, note that there are no more objects that will satisfy the tolerance relation with all the objects in the shaded area. As a result, the set {z 1 , . . . , z 7 } is a tolerance class.
Using Propositions 1 and 2 and Corollary 1, the following algorithm gives the pseudocode for an approach for finding all the tolerance classes on a set of objects Z. The general concept of the algorithm is, for a given object z ∈ Z, to recursively find all the tolerance classes containing z. The first step, based on Proposition 1, is to set z as a query point and to find the neighbourhood N(z). Next, consider the nearest neighbour of z from the neighbourhood N(z) as a query point and find its neighbourhood only considering objects in N(z). Continue this process until the result of a query produces a neighbourhood with cardinality 1. (The result of a query will always be at least 1 since the tolerance relation is reflexive.) Lastly, the series of query points becomes the tolerance class.
(2) Add z to a new tolerance class C. Select an object z ∈ N∼ =B,ε (z) such that z / = z.
(3) Add z to C. Find neighbourhood N∼ =B,ε (z ) using only objects from N∼ =B,ε (z). Do not include z in (4) Repeat step 3 until a neighbourhood of only 1 element is produced. When this occurs, add the last element to C and then add C to H ε B (Z). (5) Perform step 2 (and subsequent steps) until each object in N∼ =B,ε (z) has been selected at the level of step 2.
(6) Perform step 1 (and subsequent steps) for each object in Z.
Finally, note the following. We used an added heuristic for step 2 to reduce the computation time of the algorithm. Namely, an object from N∼ =B,ε (z) can only be selected as z in step 2 if it has not already been added to a tolerance class created from N∼ =B,ε (z) (i.e., this rule is reset each time step 1 is visited). In addition, the Fast Library for Approximate Nearest Neighbours [35,36] was used to find all the neighbourhoods in this algorithm.
The tolerance class originally given in Figure 2 was produced using this algorithm, and the intermediate steps of this algorithm are visualized in Figure 7. To begin with, Figure 7(a) represents Step 1 of the algorithm with z = 1.
Step 2 is given in Figure 7(b), where z = 20. Steps 3 and 4 are given in Figures 7(c)-7(f). Observe that in Figure 7(f)|N∼ =B,ε (3)| = 1 since all the other bold objects in the grey area have been added to C, and, as such, are not allowed to be included in subsequent neighbourhoods.
Step 5 can be explained as follows. Figure 7 shows the sequence of steps for selecting z = 20 (the closest object to 1) at the level of Step 2. Hence, Step 5 states that each object in the neighbourhood of 1 (except 1 itself) should be selected at Step 2. Moreover, the heuristic given after the algorithm states that any object added to a tolerance class derived from the neighbourhood of 1 should not be considered at Step 2. As a result, in this example, the objects {3, 6, 10, 15, 16} should not be considered again at Step 2 for finding tolerance classes derived from the neighbourhood of object 1. Lastly, note that Step 1 must be performed for all objects in Z. Finally, this section is concluded by mentioning a few observations about the algorithm. The runtime of the algorithm in the worst case is O(|Z| 2 T), where T is the complexity of finding an object's neighbourhood among the other |Z| − 1 objects. However, it should be noted that the algorithm is rarely run on the worst case data. The worst case suggests that either the epsilon value is much too large or that the data is so clustered that, from a perceptual point of view, every pair of objects in the set resembles each other. In either case, the data is not interesting from a nearness measure or image correspondence perspective. The runtime on typical data is of order O(|Z|cT), where c ≤ |Z| is a constant based on the object z ∈ Z that has the largest neighbourhood. Lastly, this algorithm lends itself to parallel processing techniques, and the results in this paper were also obtained using multithreading on a quad core processor. A comparison of two images used to generate the results in this paper using our implementation was on the order of 0.2 sec.

Results
The goal of this paper is to present an application of the tolerance near set approach by way of comparing the hand movements of an arthritic patient with normal hand movements during rehabilitation exercises. Consequently, this section presents results of comparing images from three patients, two of which do not have arthritis, using the tolerance near set approach. As mentioned, the images were obtained from a video taken during a rehabilitation exercise (see, e.g. [30]). This section presents the selection of parameters used to obtain the results and ends with a look at a comparison of tNM with an existing measure called the Hausdorff distance.

Selection of Epsilon.
For normalized feature values, the largest distance between two objects occurs when one object has a feature vector (object description) of all zeros and the other has a feature vector of all ones. As a result, ε is in the interval [0, √ l], where l is the length of the feature vectors. In any given application, there is always an optimal ε when performing experiments using the perceptual tolerance relation. For instance, a value of ε = 0 produces little or no pairs of objects that satisfy the perceptual tolerance relation, and a value of ε = √ l means that all pairs of objects satisfy the tolerance relation. Consequently, ε should be selected such that the objects that are relatively (Here, distance of "objects that are relatively close" will be determined by the application.) close in feature space satisfy the tolerance relation, and the rest of the pairs of objects do not. The selection of ε is straightforward when a metric is available for measuring the success of the experiment. In this instance, the value of ε is selected based on the best result of the evaluation metric, where a plot of ε versus the metric usually resembles an inverted parabola. Fortunately, in this case, precision versus recall plots, defined in the context of image retrieval, can be used to evaluate the effectiveness of ε. To demonstrate the selection of ε, the database of handfinger movement images from three patients is used. One of the patients has rheumatoid arthritis, while the other two do not. Here, the goal is to perform content-based image retrieval and separate the images into three categories, one for each patient. An image belonging to one of the three patients is used as a query image, and then the images are ranked in descending order based on the value of tNM with the query image. For example, the database of images contains 98 images, of which 30 are from the patient with arthritis, and, respectively, 39 and 29 of them are from two patients without arthritis. Then, each image is in turn selected as the query image, and a value of tNM between the query image and every other image in the database is determined. Subsequently, a tolerance ε can be selected based on the number of images that are retrieved from the same category as the query image before a false negative occurs (i.e., before an image from a category other than the query image occurs). Using this approach, Figure 8 contains a plot showing the number of images retrieved before the precision dropped below 90% for a given value of ε. The image (out of all possible 98 images) that produced the best query results is given in red, and the average is given in blue. Notice that the best results in the average case occur with tolerance ε = 0.05, which is close to the ε = 0.07 in the best case. This plot suggests that retrieval of images in this database benefits from a slight easying of the equivalence condition, but not much.
Verifying the validity of selecting ε in this manner can be accomplished both by the visualization of the nearness measure for all pairs of images in the experiment and by observing the precision recall plots directly. First, an image can be created where the height and width are equal to the number of images in the database, each pixel corresponds to the value of tNM generated from the comparison of two images, and the colours black and white correspond to a nearness measure of 0 and 1, respectively. For example, an image of size 98 × 98 can be created like the one in Figure 9(a) where patient B is the one with arthritis, and each pixel corresponds to the nearness measure between two pairs of images in the database. Notice that a checkered pattern is formed with a white line down the diagonal. The white line corresponds to the comparison of an image with itself in the database, naturally producing a nearness measure of 1. Moreover, the lightest squares in the image are formed from comparisons between images from the same patient, and the darkest squares are formed from comparisons between the arthritis and healthy images. Also notice that the boundaries in Figures 9(c) and 9(d) are more distinct than for images created by other values of ε suggesting that ε = 0.05 or ε = 0.07 is the right choice of ε. Similarly, the square corresponding to patient C has crisp boundaries in Figures 9(a) and 9(h) and is also the brightest area of the figure, suggesting that a value of ε = 0.3 would also be a good choice for images belonging to patient C.
Next, Figure 10 gives plots of the average precision versus recall for each patient. These plots were created by fixing a value of ε and calculating precision versus recall for each image belonging to a patient. Then, the average of all the precision/recall values for a specific value of ε are added to the plot for each patient. The results for selecting ε = 0.05 are given in red, and, in the case of patients B and C, the choice of ε that produced a better result than ε = 0.05 is also highlighted.

Hausdorff Distance.
This section introduces an additional measure for determining the degree that near sets resemble each other. The Hausdorff distance is used to measure the distance between sets in a metric space [37] (see [38] for English translation) and is defined as (5) where sup and inf refer to the supremum and infimum and d(x, y) is the distance metric (in this case it is the l 2 norm). The distance is calculated by considering the distance from a single element in a set X to every element of set Y , and the shortest distance is selected as the infimum. This process is repeated for every x ∈ X, and the largest distance (supremum) is selected as the Hausdorff distance of the set X to the set Y . This process is then repeated for the set Y because the two distances will not necessarily be the same. Keeping this in mind, the measure tHD [29] is defined as Observe that low values of the Hausdorff distance correspond to a higher degree of resemblance than larger distances. Consequently, the distance is subtracted from the largest distance √ l. The Hausdorff distance is a natural choice for comparison with the tNM nearness measure because it measures the distance between sets in a metric space. Recall that tolerance classes are sets of objects with descriptions in l-dimensional feature space. The nearness measure evaluates the split of a tolerance class between sets X and Y , where the idea is that a tolerance class should be evenly divided between X and Y , if the two sets are similar (or the same). In contrast, the Hausdorff distance measures the distance between two sets. Here the distance being measured is between the portions of a tolerance class in sets X and Y . Thus, two different measures can be used on the same data, namely, the tolerance classes obtained from the union of X and Y .

Comparison between Hausdorff and tNM Measures.
Next, Figure 11 contains the comparison of the two measures. The precision recall data for the Hausdorff distance was generated with ε = 0.5. Again, the data was obtained by taking an average of all the precision (and recall) values for each image belonging to a particular patient. Notice that the nearness measure performs better, that is, the precision recall plot is closer to ideal for all three patients using the nearness measure. The reason is that the performance of the Hausdorff distance is poor for low values of ε, since, as tolerance classes start to become equivalence classes (i.e., as ε → 0), the Hausdorff distance approaches 0 as well. Thus, if each tolerance class is close to an equivalence class, the resulting distance will be zero and consequently the measure will produce a value near to 1, even if the images are not alike. In contrast, as ε increases, the members of classes tend to become separated in feature space, and, as a result, only classes with objects that have objects in X that are close to objects in Y will produce a distance close to zero. What does this imply? If for a larger value of ε, relatively speaking, the set of objects Z = X ∪ Y still produces tolerance classes with objects that are tightly clustered, then this measure will produce a high measure value. Notice that this distinction is only made possible if ε is relaxed. Otherwise, all tolerance classes will be tightly clustered. Finally, Figures 12, 13, and 14 show the top five retrieved results for randomly selected query image of each category. Observe that the results all belong to the right category, which is as expected based on the precision recall plots.

Concluding Remarks
This paper focuses on the analysis, classification, and visualization of hand-finger movement images extracted from videos made during rehabilitation exercise sessions for osteoarthritic clients. This work stems from the need to provide healthcare providers and clients with resemblance measures, and hand-figure movement image analysis and visualization of the results of content-based image retrieval. Two forms of image resemblance measures are considered, the Hausdorff distance tHD and a tolerance near set resemblance measure tNM. The results reported in this paper suggest that the tNM measure is more accurate than the well-known Hausdorff distance measure. In addition, two forms of visualization of a tolerance space view of handfinger motion during rehabilitation exercise are presented. In addition to watching videos of rehabilitation therapy sessions, it is now possible to compare arthritic and nonarthritic hand movements in entirely different ways, that is, comparisons can be made using checkerboard grids and precision recall plots. A checkerboard greyscale grid like the one in Figure 9 gives a qualitative view of handfigure movement images extracted from rehabilitation exercise videos. That is, the greater the contrast between the grey areas reflecting arthritic and non-arthritic hand-finger movements, the greater the disparity between client hand movements. By contrast, precision recall plots like the ones in Figure 10 give a quantitative comparison of the results of different tolerances in measuring resemblance between hand-finger movement images.