Compare commits

6 Commits
master ... main

Author SHA1 Message Date
Johannes Paehr
929f905886 update 2025-11-20 21:21:20 +01:00
9cffa391e8 update Benny 2025-11-16 13:49:49 +01:00
Johannes Paehr
fa200db2cc update Database 2025-11-13 21:29:16 +01:00
Johannes Paehr
13cf7fdaa0 update 2025-11-06 23:17:37 +01:00
Johannes Paehr
6ccc747dca update 2025-10-29 11:12:28 +01:00
Johannes Paehr
376edbdfbc update 2025-10-26 17:12:09 +01:00
59 changed files with 21777 additions and 686 deletions

Binary file not shown.

371
logs/upgrade.log Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,867 @@
Pattern Recognition 47 (2014) 22802292
Contents lists available at ScienceDirect
Pattern Recognition
journal homepage: www.elsevier.com/locate/pr
Automatic generation and detection of highly reliable fiducial markers under occlusion
S. Garrido-Jurado n, R. Muñoz-Salinas, F.J. Madrid-Cuevas, M.J. Marín-Jiménez
Computing and Numerical Analysis Department, Córdoba University, Edificio Einstein, 3a planta, Campus de Rabanales, 14071 Córdoba, Spain
article info
Article history: Received 4 June 2013 Received in revised form 2 December 2013 Accepted 9 January 2014 Available online 21 January 2014
Keywords: Augmented reality Fiducial marker Computer vision
abstract
This paper presents a fiducial marker system specially appropriated for camera pose estimation in applications such as augmented reality and robot localization. Three main contributions are presented. First, we propose an algorithm for generating configurable marker dictionaries (in size and number of bits) following a criterion to maximize the inter-marker distance and the number of bit transitions. In the process, we derive the maximum theoretical inter-marker distance that dictionaries of square binary markers can have. Second, a method for automatically detecting the markers and correcting possible errors is proposed. Third, a solution to the occlusion problem in augmented reality applications is shown. To that aim, multiple markers are combined with an occlusion mask calculated by color segmentation. The experiments conducted show that our proposal obtains dictionaries with higher inter-marker distances and lower false negative rates than state-of-the-art systems, and provides an effective solution to the occlusion problem.
& 2014 Elsevier Ltd. All rights reserved.
1. Introduction
Camera pose estimation (Fig. 1(a,b)) is a common problem in many applications requiring a precise localization in the environment such as augmented and virtual reality applications, and robotics. [14]. Obtaining the camera pose from images requires to find the correspondences between known points in the environment and their camera projections. While some approaches seek natural features such as key points or textures [59], fiducial markers are still an attractive approach because they are easy to detect and allows us to achieve high speed and precision.
Among the several fiducial marker systems proposed in the literature, those based on square markers have gained popularity, especially in the augmented reality community [1012]. The reason why is that they allow us to extract the camera pose from their four corners, given that the camera is properly calibrated. In most of the approaches, markers encode a unique identification by a binary code that may include error detection and correction bits. In general, each author has proposed its own predefined set of markers (dictionary). The problems of setting a predefined dictionary are twofold. First, in some cases, the number of markers required by the application might be higher than the dictionary size. Second, if the number of markers required is smaller, then it
n Corresponding author. Tel.: þ 34 957212255. E-mail addresses: i52gajus@uco.es (S. Garrido-Jurado),
rmsalinas@uco.es (R. Muñoz-Salinas), fjmadrid@uco.es (F.J. Madrid-Cuevas), mjmarin@uco.es (M.J. Marín-Jiménez).
0031-3203/$ - see front matter & 2014 Elsevier Ltd. All rights reserved. http://dx.doi.org/10.1016/j.patcog.2014.01.005
is preferable to use a smaller dictionary whose inter-marker distance is as high as possible, so as to reduce the inter-marker confusion rate.
Another common problem in augmented reality applications is related to the occlusion. The problem occurs when a real object appears occluding the virtual scene. In this case, the virtual objects are rendered on the real object, which should be visible (see Fig. 1 (c,d)). This is indeed a limitation to the augmented experience since the user cannot interact freely.
This paper presents a fiducial marker system based on square markers offering solutions to the above-mentioned problems. First, we propose a general method for generating configurable dictionaries (both in size and number of bits). Our algorithm creates dictionaries following a criterion to maximize the intermarker distance and the number of bit transitions. In the process, we derive the maximum theoretical inter-marker distance that a dictionary of square binary markers can have. Then, a method for automatically detecting markers in images and correcting possible errors, based on our generated dictionaries, is presented. Third, we propose a solution to the occlusion problem based on combining multiple markers and an occlusion mask calculated using color information. While using multiple markers provides robustness against occlusion, color information is used to determine the occluded pixels avoiding rendering on them.
The rest of the paper is structured as follows. Section 2 presents the most relevant works related to ours. Section 3 explains the proposed method to generate marker dictionaries. Section 4 shows the process proposed for marker detection and error correction.
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
2281
Fig. 1. Example of augmented reality scene. (a) Input image containing a set of fiducial markers. (b) Markers automatically detected and used for camera pose estimation. (c) Augmented scene without considering user0s occlusion. (d) Augmented scene considering occlusion.
Fig. 2. Examples of fiducial markers proposed in previous works.
Section 5 presents our solution to the occlusion problem. Finally, Section 6 shows the experimentation carried out, and Section 7 draws some conclusions.
Finally, it must be indicated that our work has been implemented in the ArUco library which is freely available [13].
2. Related work
A fiducial marker system is composed by a set of valid markers and an algorithm which performs its detection, and possibly correction, in images. Several fiducial marker systems have been proposed in the literature as shown in Fig. 2.
The simplest proposals consist in using points as fiducial markers, such as LEDs, retroreflective spheres or planar dots [14,15], which can be segmented using basic techniques over controlled conditions. Their identification is usually obtained from the relative position of the markers and often involves a complex process.
Other approaches use planar circular markers where the identification is encoded in circular sectors or concentric rings [16,17]. However, circular markers usually provide just one correspondence point (the center), making necessary the detection of several of them for pose estimation.
Other types of fiducial markers are based on blob detection. Cybercode [18] or VisualCode [19] is derived from 2D-barcodes technology as MaxiCode or QR but can also accurately provide several correspondence points. Other popular fiducial markers are the ReacTIVision amoeba markers [20] which are also based on
blob detection and its design was optimized by using genetic algorithms. Some authors have proposed the use of trained classifiers to improve detection in cases of bad illumination and blurring caused by fast camera movement [21].
An alternative to the previous approaches is the square-based fiducial markers systems. Their main advantage is that the presence of four prominent points can be employed to obtain the pose, while the inner region is used for identification (either using a binary code or an arbitrary pattern such as an image). In the arbitrary pattern category, one of the most popular systems is ARToolKit [10], an open source project which has been extensively used in the last decade, especially in the academic community. ARToolKit markers are composed by a wide black border with an inner image which is stored in a database of valid patterns. Despite its popularity, it has some drawbacks. First, it uses a template matching approach to identify markers, obtaining high false positive and inter-marker confusion rates [22]. Second, the system uses a fixed global threshold to detect squares, making it very sensitive to varying lighting conditions.
Most of the square-based fiducial systems use binary codes. Matrix [23] is one of the first and simplest proposals. It uses a binary code with redundant bits for error detection. The ARTag [11] system is based on the same principles but improves the robustness to lighting and partial occlusion by using an edgebased square detection method, instead of a fixed threshold. Additionally, it uses a binary coding scheme that includes checksum bits for error detection and correction. It also recommends using its dictionary markers in a specific order so as to maximize the inter-marker distances. Its main drawback is that the proposed
2282
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
marker dictionary is fixed to 36 bits and the maximum number of erroneous bits that can be corrected is two, independent of the inter-marker distances of the subset of markers used.
ARToolKit Plus [24] improves some of the features of ARToolKit. First, it includes a method to automatically update the global threshold value depending on pixel values from previously detected markers. Second, it employs binary codes including error detection and correction, thus achieving higher robustness than its predecessor. The last known version of ARToolKitPlus employs a binary BCH [25] code for 36 bits markers which presents a minimum Hamming distance of two. As a consequence, ARToolKitPlus BCH markers can detect a maximum error of one bit and cannot perform error correction. ARToolKitPlus project was halted and followed by the Studierstube Tracker [12] project which is not publicly available.
BinARyID [26] proposes a method to generate binary coded markers focused on avoiding rotation ambiguities, however it only achieves Hamming distance of one between two markers and does not present any error correction process. There are also some closed-source systems which employ square markers such as the SCR, HOM and IGD [27] marker systems used by the ARVIKA project [28].
This paper proposes a square-based fiducial marker system with binary codes. However, instead of using a predefined set of markers, we propose a method for generating configurable marker dictionaries (with arbitrary size and number of markers), containing only the number of markers required. Our algorithm produces markers using a criterion to maximize the inter-marker distance and the number of bit transitions. Additionally, a method for detecting and correcting errors, based on the dictionary obtained, is proposed. This method allows error correction of a greater number of erroneous bits compared to the current state of the art systems.
Our last contribution is related to the occlusion problem in augmented reality applications. When designing an augmented reality application, interactivity is a key aspect to consider. So, one may expect users to occlude the markers. ARTag handles the problem in two ways. First, the marker detection method allows small breaks in the square sides. Second, they employ several markers simultaneously, thus, the occlusion of some of them does not affect the global pose estimation. Despite being robust to occlusion, ARTag still has a main drawback: it cannot detect occlusion precisely. As a consequence, if an object moves between the camera and the augmented scene (e.g. user0s hands), the virtual objects will be rendered on the hands, hiding it (see Fig. 1(c,d)).
Proposals to detect the occluded regions usually fall into three main categories: depth-based, model-based, and color-based approaches. Depth-based approaches try to calculate the depth of the image pixels to detect occlusions. However, these approaches require depth-based sensors, such as stereo, time of flight or structured light cameras [2931]. When a single camera is used, some authors have adopted model-based approaches [32,33]. The idea is to provide geometric models of the objects which can occlude the scene, and detect their pose. This solution is not practical in many applications where the occluding objects are not known in advance, and imposes very strong performance limitations. Finally, color-based approaches [34] can be employed. The idea is to create a color model of the scene (background) which is then compared to the foreground objects.
In this work, we propose the use of multiple markers to handle occlusion (as in ARTag). However, we also propose the use of a color map for precisely detecting the visible pixels, so that the virtual scene is only rendered on them. In order to improve segmentation, we employ blue and green markers, instead of classical black-and-white ones. As we experimentally show, our
proposal is an effective method for improving current augmented reality applications such as in gaming or film industry, although not limited to that.
3. Automatic dictionary generation
The most relevant aspects to consider when designing a marker dictionary are the false positive and negative rates, the intermarker confusion rate, and the number of valid markers [11]. The first two are often tackled in the literature using error detection and correction bits, which, on the other hand, reduces the number of valid markers. The third one depends only on the distance between the markers employed. If they are too close, a few erroneous bits can lead to another valid marker of the dictionary, and the error could not be even detected.
Another desirable property of markers is having a high number of bit transitions, so that they are less likely to be confused with environment objects. For instance, the binary codes with only zeros or ones will be printed as completely black or white markers, respectively, which would be easily confused with environment objects.
While previous works impose fixed dictionaries, we propose an automatic method for generating them with the desired number of markers and with the desired number of bits. Our problem is then to select m markers, from the space of all markers with n  n bits, D , so that they are as far as possible from each other and with as many bit transitions as possible. In general, the problem is to find the dictionary Dn that maximizes the desired criterion τ^ðDÞ:
Dn ¼ argmaxfτ^ðDÞg
ð1Þ
DAD
Since a complete evaluation of the search space is not feasible even for a small n, a stochastic algorithm that finds suboptimal solutions is proposed.
3.1. Algorithm overview
Our algorithm starts from an empty dictionary D that is incrementally populated with new markers. Our markers are encoded as a ðn þ2Þ Â ðn þ 2Þ grid (Fig. 3) where the external cells are set as black, creating an external border easily detectable. The remaining n  n cells are employed for coding. Thus, we might define a marker
m ¼ ðw0; w1; …; wn À 1Þ;
ð2Þ
as a tuple composed by n binary words w of length n such that
w ¼ ðb0; …; bn À 1jbi A f0; 1gÞ:
ð3Þ
Let us also denote W as the set of all possible words of n bits, whose cardinal is jWj ¼ 2n.
At each iteration of the algorithm, a marker is selected based on a stochastic process that assigns more probability to markers with a higher number of bit transitions and whose words have not been yet added to D. If the distance between the generated marker and these in D is greater than a minimum value τ, then it is added. Otherwise, the marker is rejected and a new marker is randomly selected. The process stops when the required number of markers is achieved.
Because of the probabilistic nature of the algorithm, the acceptance of new markers could be improbable or even impossible in some cases. To guarantee the convergence of the algorithm, the distance threshold is initially set to the maximum possible inter-marker distance that the dictionary can have τ0. Along the process, the value of τ is reduced after a number of unproductive iterations ψ. The final value τ^ðDÞ represents the minimum distance between any two markers in D, and it will be
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
2283
Fig. 3. Examples of markers of different sizes, n, generated with the proposed method. From left to right: n¼5, n¼ 6 and n¼ 8.
used as the base for error detection and correction (explained in Section 4). The proposed algorithm is summarized in Algorithm 1.
Algorithm 1. Dictionary generation process.
D∅ # Reset dictionary ττ0 # Initialize target distance, see Section 3.4 ϱ0 # Reset unproductive iteration counter while D has not desired size do
Generate a new marker m # Section 3.2 if distance of m to elements in D is Zτ then
DD [ m # Add to dictionary ϱ0 else ϱϱ þ 1 # It was unproductive # maximum unproductive iteration reached? if ϱ ¼ ψ then
τ’τ À1 # Decrease target distance ϱ0 end if end if end while
3.2. Marker generation
As previously pointed out, markers are selected using a random process led by a probability distribution that assigns a higher probability to these markers with a high number of transitions and whose words are not yet present in D. The proposed process for generating a marker consists in selecting n words from W with replacement. To do so, each word wi A W has a probability of being selected at each iteration that is defined as
P
fw
¼
wi
g
¼
TðwiÞOðwi; DÞ ∑wj A W T ðwjÞOðwj;
DÞ:
ð4Þ
Eq. (4) defines the probability of selecting a word as the combination of two functions. The first one, TðwiÞ A ½0; 1Š, is related to the number of bit transitions of the word. It is defined as
T
ðwiÞ
¼
1
À
∑nj ¼À
2 0
δðwji þ nÀ1
1
;
wji
Þ ;
ð5Þ
being wij the j-bit of the word wi, and δ is 1 if both elements are equal and 0 otherwise. So, TðwiÞ tends to 1 as the number of transitions between consecutive bits increases and to 0 as the number of transitions decreases. For instance, the words 010110 and 000011 present values of T ¼ 4=5 and T ¼ 1=5, respectively, which are proportional to the number of bit transitions.
On the other hand, the function Oðwi; DÞ accounts for the number of times the word wi appears among the markers in D. The idea is to reduce the probability of choosing words that have already been selected many times. It is defined in the interval ½0; 1Š
as
Oðwi
;
¼
8 < :
1
À
∑mi
A
D
∑wj A mi njDj
δðwj
;
wi
Þ
if jDj a0
ð6Þ
1
otherwise:
The double sum counts the appearances of w among the markers in D, while the denominator counts the total number of words in D. Thus, Oðwi; DÞ is 1 if wi is not in D, and tends to 0 as it appears a higher number of times. Finally, in the first iteration (jDj ¼ 0), the function is defined as 1 so that all words have the same probability of being selected.
3.3. Distance calculation
As previously indicated, a marker is added to the dictionary if its distance to the markers in the dictionary is below τ. The concept of distance between markers must be defined considering that they are printed as binary grids of n  n bits that can be observed under rotation. Then, let us define the distance between two markers as
Dðmi; mjÞ ¼ min fHðmi; RkðmjÞÞg:
ð7Þ
k A f0;1;2;3g
The function H is the Hamming distance between two markers, which is defined as the sum of Hamming distances between each pair of marker words. The function Rk is an operator that rotates the marker grid k  901 in the clockwise direction. The function D is then the rotation-invariant Hamming distance between the markers.
Let us also define the distance of a marker to a dictionary
Dðmi; DÞ ¼ min fDðmi; mjÞg;
ð8Þ
mj A D
as the distance of the marker to the nearest one in the dictionary. Finally, it is not only important to distinguish markers from
each other, but also to correctly identify the marker orientation. Otherwise, pose estimation would fail. So, a valid marker must also guarantee that the minimum distance to its own rotations is above τ. Thus, we define the marker self-distance as
SðmiÞ ¼ min fHðmi; RkðmiÞÞg:
ð9Þ
k A f1;2;3g
In summary, we only add a marker to the dictionary if both
SðmiÞ and Dðmi; DÞ are greater than or equal to τ. Otherwise, the marker is rejected and a new one generated. After a number of
unproductive iterations ψ, the value of τ is decreased by one so as
to allow new markers to be added.
In the end, the markers of the generated dictionary have a
minimum distance between them and to themselves, τ^, that is the
last τ employed. This value can be calculated for any marker
dictionary (manually or automatically generated) as


τ^ðDÞ ¼ min
mmi AinDfSðmiÞg;
mi
min
a mj A
DfDðmi
;
mj
Þg
:
ð10Þ
2284
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
Fig. 4. Examples of quartets for a 2 Â 2 and 3 Â 3 marker. Each arrow indicates the destination of a bit after a 901 clockwise rotation.
3.4. Maximum inter-marker distance: τ0
The proposed algorithm requires an initial value for the parameter τ0. If one analyzes the first iteration (when the dictionary is
empty), it is clear that the only distance to consider is the self-
distance (Eq. (9)), since the distance to other markers is not
applicable. So, the maximum self-distance for markers of size
n  n (let us denote it by Snn) is the maximum distance that a dictionary can have for these types of markers. This section
explains how to determine Snn, which is equivalent to find the marker of size n  n with highest self-distance.
If we analyze the path of the bits when applying 901 rotations
to a marker, it is clear that any bit (x,y) changes its position to
another three locations until it returns to its original position (see
Fig. 4). It can be understood that the Hamming distance provided
by a marker bit to Eq. (9) is only influenced by these other three
bits. So, let us define a quartet as the set composed by these
positions: fðx; yÞ; ðn À y À 1; xÞ; ðn À x À 1; n À y À1Þ; ðy; n À x À 1Þg.
In general, a marker of size n  n, has a total of C quartets that
can be calculated as
n2
C¼ ;
ð11Þ
4
where ⌊Ác represents the floor function. If n is odd, the central bit of the marker constitutes a quartet by itself which does not provide extra distance to S.
If a quartet is expressed as a bit string, a 901 rotation can be obtained as a circular bit shift operation. For instance, the quartet 1100 becomes ð0110-0011-1001Þ in successive rotations. In fact, for the purpose of calculating Snn, these four quartets are equivalent, and we will refer to them as a quartet group Qi. It can be seen from Eq. (9) that the contribution of any quartet is given by the distance of its successive rotations to the original quartet. For instance, quartet 1100 contributes to Eq. (9) with distances ð2; 4; 2Þ as it rotates:
Hð1100; 0110Þ ¼ 2; Hð1100; 0011Þ ¼ 4; Hð1100; 1001Þ ¼ 2:
But also, if we start from quartet 0110 and rotate it successively, we obtain the quartets ð0011-1001-1100Þ that again provide the distances ð2; 4; 2Þ:
Hð0110; 0011Þ ¼ 2; Hð0110; 1001Þ ¼ 4; Hð0110; 1100Þ ¼ 2:
In fact, there are only 6 quartet groups (shown in Table 1), thus reducing the problem considerably.
As previously indicated, calculating Snn is the problem of obtaining the marker with highest self-distance, and we have turned this problem into assigning quartets groups to the C quartets of a maker. It can be seen that it is in fact a multiobjective optimization, where each quartet group Qi is a possible solution and the objectives to maximize are the distances for each
Table 1 Quartet groups and quartet Hamming distances for each rotation.
Group
Quartets
Hamming distances
901
1801
Q1
0000
0
0
Q2
1000-0100-0010-0001
2
2
Q3
1100-0110-0011-1001
2
4
Q4
0101-1010
4
0
Q5
1110-0111-1011-1101
2
2
Q6
1111
0
0
2701
0 2 2 4 2 0
Table 2 Quartet assignment for a 4 Â 4 marker (C¼4) to obtain Snn. It can be observed as the sequence fQ 3; Q 3; Q 4g is repeated until filling all the quartets in the marker.
Group
Quartets
Hamming distances
901
1801
2701
1
Q3
2
Q3
3
Q4
4
Q3
2
4
2
2
4
2
4
0
4
2
4
2
Total distances
V
n s
10
12
10
minð10; 12; 10Þ ¼ 10
rotation. If the Pareto front is obtained, it can be observed that the
groups Q3 and Q4 dominate the rest of the solutions. Thus, the
problem is simplified, again, to assign Q3 and Q4 to the C quartets
of a marker.
From
a
brief
analysis,
it
can
be
deduced
that
S
n n
is
obtained
by
assigning the groups fQ 3; Q 3; Q 4g (in this order) repeatedly until
completing the C quartets. For instance, the simplest marker is a
2 Â 2 marker (C ¼ 1), Snn ¼ 2 and is obtained by assigning Q3. For a
3 Â 3 marker (C ¼ 2), Snn ¼ 4 which is obtained by assigning Q3
twice.
For
a
4
Â
4
marker
(C
¼
4),
S
n n
¼
10
obtained
by
assigning
the
groups fQ 3; Q 3; Q 4; Q 3g. This last case is shown in detail in Table 2. Therefore, for a generic marker with C quartets, the value Snn
follows the rule

S
n n
¼
2
4C 3
ð12Þ
Then, we employ the value
τ0
¼
S
n n
;
ð13Þ
as a starting point for our algorithm.
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
2285
Fig. 5. Image process for automatic marker detection. (a) Original image. (b) Result of applying local thresholding. (c) Contour detection. (d) Polygonal approximation and removal of irrelevant contours. (e) Example of marker after perspective transformation. (f) Bit assignment for each cell.
4. Marker detection and error correction
This section explains the steps employed to automatically detect the markers in an image (Fig. 5(a)). The process is comprised by several steps aimed at detecting rectangles and extracting the binary code from them. For that purpose, we take as input a gray-scale image. While the image analysis is not a novel contribution, the marker code identification and error correction is a new approach specifically designed for the generated dictionaries of our method. The steps employed by our system are described in the following:
 Image segmentation: Firstly, the most prominent contours in
the gray-scale image are extracted. Our initial approach was employing the Canny edge detector [35], however, it is very slow for our real-time purposes. In this work, we have opted for a local adaptive thresholding approach which has proven to be very robust to different lighting conditions (see Fig. 5(b)).
 Contour extraction and filtering: Afterwards, a contour extrac-
tion is performed on the thresholded image using the Suzuki and Abe [36] algorithm. It produces the set of image contours, most of which are irrelevant for our purposes (see Fig. 5(c)). Then, a polygonal approximation is performed using the DouglasPeucker [37] algorithm. Since markers are enclosed in rectangular contours, those that are not approximated to 4-vertex polygons are discarded. Finally, we simplify near contours leaving only the external ones. Fig. 5(d) shows the resulting polygons from this process.
 Marker Code extraction: The next step consists in analyzing the
inner region of these contours to extract its internal code. First, perspective projection is removed by computing the homography matrix (Fig. 5(e)). The resulting image is thresholded using Otsu0s method [38], which provides the optimal image threshold value given that image distribution is bimodal (which holds true in this case). Then, the binarized image is divided into a regular grid and each element is assigned the value 0 or 1 depending on the values of the majority of pixels
into it (see Fig. 5(e,f)). A first rejection test consists in detecting the presence of the black border. If all the bits of the border are zero, then the inner grid is analyzed using the method described below.
 Marker identification and error correction: At this point, it is
necessary to determine which of the marker candidates obtained actually belongs to the dictionary and which are just part of the environment. Once the code of a marker candidate is extracted, four different identifiers are obtained (one for each possible rotation). If any of them is found in D, we consider the candidate as a valid marker. To speed up this process, the dictionary elements are sorted as a balanced binary tree. To that aim, markers are represented by the integer value obtained by concatenating all its bits. It can be deduced then that this process has a logarithmic complexity Oð4 log 2ðjDjÞÞ, where the factor 4 indicates that one search is necessary for each rotation of the marker candidate.
If no match is found, the correction method can be applied. Considering that the minimum distance between any two markers in D is τ^, an error of at most ⌊ðτ^ À 1Þ=2c bits can be detected and corrected. Therefore, our marker correction method consists in calculating the distance of the erroneous marker candidate to all the markers in D (using Eq. (8)). If the distance is equal to or smaller than ⌊ðτ^ À 1Þ=2c, we consider that the nearest marker is the correct one. This process, though, presents a linear complexity of Oð4jDjÞ, since each rotation of the candidate has to be compared to the entire dictionary. Nonetheless, it is a highly parallelizable process that can be efficiently implemented in current computers.
Note that, compared to the dictionaries of ARToolKitPlus (which cannot correct errors using the BCH set) and ARTag (only capable of recovering errors of two bits), our approach can correct errors of ⌊ðτ^ À 1Þ=2c bits. For instance, for a dictionary generated in Section 6 with 6 Â 6 bits and 30 markers, we obtained τ^ ¼ 12. So, our approach can correct 5 bits of errors in this dictionary. Additionally, we can generate markers with more bits which leads to a larger τ^, thus increasing the correction capabilities. Actually,
2286
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
our detection and correction method is a general framework that can be used with any dictionary (including ARToolKitPlus and ARTag dictionaries). In fact, if our method is employed with the ARTag dictionary of 30 markers, for instance, we could recover from errors of 5 bits, instead of the 2 bits they can recover from.
 Corner refinement and pose estimation: Once a marker has been
detected, it is possible to estimate its pose with respect to the camera by iteratively minimizing the reprojection error of the corners (using for instance the LevenbergMarquardt algorithm [39,40]). While, many approaches have been proposed for corner detection [4143], we have opted for doing a linear regression of the marker side pixels to calculate their intersections. This approach was also employed in ARTag [11], ARToolKit [10] and ARToolKitPlus [24].
5. Occlusion detection
Detecting a single marker might fail for different reasons such as poor lighting conditions, fast camera movement, and occlusions. A common approach to improve the robustness of a marker system is the use of marker boards. A marker board is a pattern composed by multiple markers whose corner locations are referred to a common reference system. Boards present two main advantages. First, since there are more than one marker, it is less likely to lose all of them at the same time. Second, the more markers are detected, the more corner points are available for computing the camera pose, thus, the pose obtained is less influenced by noise. Fig. 1(a) shows the robustness of a marker board against partial occlusion.
Based on the marker board idea, a method to overcome the occlusion problem in augmented reality applications (i.e., virtual objects rendered on real objects as shown in Fig. 1(c,d)) is proposed. Our approach consists in defining a color map of the board that is employed to compute an occlusion mask by color segmentation.
Although the proposed method is general enough to work with any combinations of colors, we have opted in our tests to replace black and white markers by others with higher chromatic contrast so as to improve color segmentation. In our case, blue and green have been selected. Additionally we have opted for using only the hue component of the HSV color model, since we have observed that it provides the highest robustness to lighting changes and shadows.
Let us define the color map M as a nc  mc grid, where each cell c represents the color distribution of the pixels of a board region. If the board pose is properly estimated, it is possible to compute the homography Hm that maps the board image pixels p into the map space
pm ¼ Hmp:
Then, the corresponding cell pc is obtained by discretizing the result to its nearest value pc ¼ ½pmŠ. Let us denote by I c the set of image board pixels that maps onto cell c.
If the grid size of M is relatively small compared to the size of the board in the images, I c will contain pixels of the two main board colors. It is assumed then that the distribution of the colors in each cell can be modeled by a mixture of two Gaussians [44], using the ExpectationMaximization algorithm [45] to obtain its parameters. Therefore, the pdf of the color u in a cell c can be approximated by the expression
Pðu; cÞ ¼
π
k
N
c k
ðujμck
;
Σ
ck Þ;
k ¼ 1;2
ð14Þ
where
N
c k
ðujμck
;
Σ
c k
Þ
is
the
k-th
Gaussian
distribution
and
πkc
is
the
mixing coefficient, being
∑ πck ¼ 1:
k ¼ 1;2
In an initial step, the map must be created from a view of the board without occlusion. In subsequent frames, color segmentation is done analyzing if the probability of a pixel is below a certain threshold θc. However, to avoid the hard partitioning imposed by the discretization, the probability of each pixel is computed as the weighted average of the probabilities obtained by the neighbor cells in the map
P
ðpÞ
¼
∑c
A Hðpc
∑c A
Þwðpm; cÞPðpu HðpcÞwðpm; cÞ
;
cÞ ;
ð15Þ
where pu is the color of the pixel, HðpcÞ & M are the nearest neighbor cells of pc, and
wðpm; cÞ ¼ ð2 À jpm À cj1Þ2
ð16Þ
is a weighting factor based on the L1-norm between the mapped value pm and the center of the cell c. The value 2 represents the maximum possible L1 distance between neighbors. As a consequence, the proposed weighting value is very fast to compute and provides good results in practice.
Considering that the dimension of the observed board in the image is much bigger than the number of cells in the color map, neighbor pixels in the image are likely to have similar probabilities. Thus, we can speed up computation by downsampling the image pixels employed for calculating the mask and assigning the same value to its neighbors.
Fig. 6 shows the results of the detection and segmentation obtained by our method using as input the hue channel and a downsampling factor of 4. As can be seen, the occluding hand is properly detected by color segmentation.
Finally, it must be considered that the lighting conditions might change, thus making it necessary to update the map. This process can be done with each new frame, or less frequently to avoid increasing the computing time excessively. In order to update the color map, the probability distribution of the map cells is recalculated using only the visible pixels of the board. The process only applies to cells with a minimum number of visible pixels γc, i.e., only if jI cj 4 γc.
6. Experiments and results
This section explains the experimentation carried out to test our proposal. First, the processing times required for marker detection and correction are analyzed. Then, the proposed method is compared with the state-of-the-art systems in terms of intermarker distances, number of bit transitions, robustness against noise and vertex jitter. Finally, an analysis of the occlusion method proposed is made.
As already indicated, this work is available under the BSD license in the ArUco library [13].
6.1. Processing time
Processing time is a crucial feature in many real time fiducial applications (such as augmented reality). The marker detection process of Section 4 can be divided into two main steps: finding marker candidates and analyzing them to determine if they actually belong to the dictionary.
The detection performance of our method has been tested for a dictionary size of jDj ¼ 24. The processing time for candidate detection, marker identification and error correction was measured for several video sequences. The tests were performed using
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
2287
Fig. 6. Occlusion mask example. (a) Hue component of Fig. 1(a) with the detected markers. (b) Occlusion mask: white pixels represent visible regions of the board.
Table 3 Average processing times for the different steps of our method.
Candidates detection Marker identification Error correction Total time (jDj ¼ 24)
8.17 ms/image 0.17 ms/candidate 0.71 ms/candidate 11.08 ms/image
a single core of a system equipped with an Intel Core 2 Quad 2.40 GHz processor, 2048 MB of RAM and Ubuntu 12.04 as the operating system with a load average of 0.1. Table 3 summarizes the average obtained results for a total of 6000 images with resolution of 640 Â 480 pixels. The sequences include indoor recording with several markers and marker boards arranged in the environment.
In addition, we have evaluated the computing time required for generating dictionaries with the proposed method for 6 Â 6 markers. The value of τ was reduced after ψ ¼ 5000 unproductive iterations. The computing times for dictionaries of sizes 10, 100 and 1000 elements are approximately 8, 20 and 90 min, respectively. Since this is an off-line process done only once, we consider that the computing times obtained are appropriated for real applications. It must be considered, though, that generating the first elements of the dictionary is more time consuming because the high inter-distances imposed. As τ decreases, the computation speed increases.
Finally, the time required for creating the color map and the occlusion mask in the sequences reported in Section 6.6, is 170 and 4 ms, respectively. In these sequences, the board has an average dimension of 320 Â 240 pixels.
6.2. Analysis of dictionary distances
The inter-marker confusion rate is related to the distances between the markers in the dictionary τ^ðDÞ (Eq. (10)). The higher the distance between markers, the more difficult is to confuse them in case of error. The marker dictionary proposed by Fiala in the ARTag [11] system improves the distances of other systems such as ARToolKitPlus [24] or BinARyID [26]. His work recommends using its dictionary (of 6 Â 6 markers) in a specific order so as to maximize the distance.
We have compared the dictionaries generated with our method to those obtained by incrementally adding the first 1000 recommended markers of ARTag. For our algorithm, the initial distance employed is τ0 ¼ 24 (Eq. (13)), which has been decremented by one after ψ ¼ 5000 unproductive iterations. Since ARTag considers the possibility of marker reflection (i.e. markers seen in a mirror), we have also tested our method including the reflection condition. However, we consider that this is as an uncommon case in fiducial marker applications.
Fig. 7 shows the values τ^ðDÞ for the dictionaries as their size increases. The results shown for our method represent the average
Fig. 7. Inter-marker distances of ARTag dictionaries and ours (Eq. (10)) for an increasing number of markers. ArUco values correspond to the mean of 30 runs of our algorithm (with and without considering reflection). Higher distances reduce the possibility of inter-marker confusion in case of error.
values of 30 runs of our algorithm. As can be seen, our system outperforms the ARTag dictionaries in the majority of the cases and obtains the same results in the worst ones. Even when considering reflection, our method still outperforms the ARTag results in most cases. The ARToolKitPlus system has not been compared since it does not include a recommended marker order as ARTag. However, the minimum distance in ARToolKitPlus considering all the BCH markers is 2, which is a low value in comparison to our method, or ARTag.
Fig. 8 shows standard deviations for 30 runs of the tests shown in Fig. 7. It can be observed that there are two patterns in the deviation results: (i) peaks which correspond to the slopes in Fig. 7, and (ii) intervals without deviation where the inter-marker distance remains the same in all runs. As can be observed, the higher deviations occur at the transitions of τ^ðDÞ in Fig. 7. It must be noted, though, that in most of the cases, the maximum deviation is 0.5. Just in the generation of the first markers, the deviation ascends up to 1.4 and 0.7 (with and without considering reflection, respectively).
6.3. Evaluation of the bit transitions
Our marker generation process encourages markers with a high number of bit transitions, thus, reducing the possibility of confusion with environment elements. Fig. 9 shows the number of bit transitions of the dictionaries generated in the previous section with our method and with ARTag. The number of transitions is obtained as the sum of the transitions for each word in the marker. As in the previous case, our results represent the average values obtained for 30 different marker dictionaries generated with our
2288
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
Fig. 8. Standard deviations of inter-marker distances obtained by our method in Fig. 7 (with and without considering reflection).
Fig. 10. False negative rates for different levels of additive Gaussian noise.
Fig. 10 shows the false negative rates obtained as a function of the noise level.
As can be observed, the proposed method is more robust against high amounts of noise than the rest. The ARToolKitPlus false negative rate increases sharply for high levels of noise. ARTag presents a higher sensitivity for low levels of noise, however it is nearly as robust as our method for high levels. Fig. 11 shows some examples of the sequences used to test the proposed system. It must be indicated, though, that no false positives have been detected by any method in the video sequences tested during our experimentation.
Fig. 9. Number of bit transitions of ARTag dictionaries and ours for an increasing number of markers. Higher number of transitions reduces the possibility of confusion with environment elements.
algorithm. It must be indicated that the maximum standard deviation obtained in all cases was 1.7.
It can be observed that our approach generates markers with more transitions than ARTag. Also, the number of transitions does not decrease drastically as the number of markers selected grows. The mean bit transitions for all the BCH markers in ARToolKitPlus is 15.0 which is also below our method.
6.4. Error detection
The false positive and false negative rates are related to the coding scheme and the number of redundant bits employed for error detection and correction. In our approach, however, false positives are not detected by checking redundant bits but analyzing the distance to the dictionary markers. A comparison between the correction capabilities of ARToolKitPlus, ARTag and our method has been performed by comparing the false negative rates from a set of 100 test images for each system. The images showed markers of each system from different distances and viewpoints. The images were taken in the same positions for each of the tested systems. Different levels of additive Gaussian noise have been applied to the images to measure the robustness of the methods.
6.5. Vertex jitter
An important issue in many augmented reality applications is the vertex jitter, which refers to the noise in the localization of the marker corner. Errors in the location of corners are propagated to the estimation of the camera extrinsic parameters, leading to unpleasant user experiences. This section analyzes the obtained vertex jitter of (i) the result of the polygonal approximation (see Section 4), (ii) our method implemented in the ArUco library, (iii) the ARToolKitPlus library and (iv) the ARTag library. The first method is the most basic approach (i.e., no corner refinement) and is applied to analyze the impact of the other methods. Then, since the techniques used by ARToolKitPlus, ARTag and our method are based on the same principle (linear regression of marker side pixels), it is expected that they obtain similar results.
For the experiments, the camera has been placed at a fixed position with respect to a set of markers and several frames have been acquired. Then, the camera has been moved farther away from the marker thus obtaining several view points at different distances. The standard deviation of the corner locations estimated by each method has been measured in all the frames. The experiment has been repeated both for black-and-white markers and green-and-blue markers. Note that the hue channel employed for detecting the latter presents less contrast than the black-andwhite markers (see Fig. 6(a)). Thus, evaluating the different corner refinement systems is especially relevant in that case.
Fig. 12 shows the results obtained as a box plot [46] for both, black-and-white markers and green-and-blue markers. The lower and upper ends of the whiskers represent the minimum and maximum distribution values, respectively. The bottom and top of the boxes represent the lower and upper quartiles, while the middle band represents the median.
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
2289
Fig. 11. Image examples from video sequences used to test the proposed fiducial marker system. First row shows cases of correct marker detection. Second row shows cases where false positives have not been detected.
It can be observed that the jitter level is lower in black-and-white markers than in green-and-blue ones. Nonetheless, it is small enough to provide a satisfactory user0s experience. As expected, not performing any refinement produces higher deviations. It can also be noted that our method obtains similar results than these obtained by ARToolKitPlus and ARTag libraries. We consider that differences obtained between the three methods can be attributed to implementation details.
6.6. Analysis of occlusion
Along with the marker system described, a method to overcome the occlusion problem in augmented reality applications has been proposed. First, we employ marker boards so as to increase the probability of seeing complete markers in the presence of occlusion. Then, we propose using a color map to calculate an occlusion mask of the board pixels. We have designed two sets of experiments to validate our proposal. Firstly, it has been analyzed how different occlusion levels affect to the estimation of the camera pose. While ARTag introduces the idea of multiple markers, no analysis of occlusion is made in their work. Secondly, a qualitative evaluation of the occlusion mask generated has been performed under different lighting conditions. It must be noticed that the estimation of the occlusion mask is not present in any of the previous works (ARTag, ARToolKit or ARToolKitPlus), thus a comparison with them is not feasible.
For our tests, the parameters
θc ¼ 10 À 4; γc ¼ 50; nc ¼ mc ¼ 5;
have been employed, providing good results in a wide range of sequences.
6.6.1. Occlusion tolerance In these experiments we aim at analyzing the tolerance to
occlusion of our system. To do so, a video sequence is recorded showing a board composed by 24 markers without occlusion so that all markers are correctly detected. Assuming Gaussian noise, the ground truth camera pose is assumed to be the average in all the frames. Then, we have artificially simulated several degrees of occlusion by randomly removing a percentage of the detected markers in each frame and computing the pose with the remaining ones. Thus, the deviation from the ground truth at each frame is the error introduced by occlusion. This process has been
Fig. 12. Vertex jitter measures for different marker systems.
repeated for three distances from the board to analyze the impact of distance in the occlusion handling.
The 3D rotation error is computed using the inner product of unit quaterions [47]
ϕðq1; q2Þ ¼ 1 À jq1 Á q2j
which gives values in the range ½0; 1Š. The translation error has been obtained using the Euclidean distance.
Figs. 13 and 14 show the obtained results for different camera distances to the marker board. It can be observed that, both in rotation and translation, the error originated by the occlusion is insignificant until the occlusion degree is above 85%. It can also be noted that the error increases as the camera is farther from the board.
6.6.2. Qualitative evaluation of the occlusion mask Fig. 15 shows some captures from a user session using the
green-and-blue marker board. The augmented objects consist in a piece of virtual floor and a virtual character doing some actions around. It can be observed that the user hand and other real objects are not occluded by virtual objects since they have different tonalities than the board and thus can be recognized by our method.
2290
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
Nonetheless, as any color-based method, it is sensitive to lighting conditions, i.e., too bright or too dark regions make it impossible to detect the markers nor to obtain a precise occlusion mask. Fig. 16 shows an example of scene where a lamp has been
placed besides the board. It can be seen that there is a bright spot saturating the lower right region of the board, where markers cannot be detected. Additionally, because of the light saturation, the chromatic information in that region (hue channel) is not reliable, thus producing segmentation errors in the board.
Fig. 13. Rotation error for different degrees of marker board occlusion and for three camera distances.
7. Conclusions
This paper has proposed a fiducial marker system specially appropriated for camera localization in applications such as augmented reality applications or robotics. Instead of employing a predefined set of markers, a general method to generate configurable dictionaries in size and number of bits has been proposed. The algorithm relies on a probabilistic search maximizing two criteria: the inter-marker distances and the number of bit transitions. Also, the theoretical maximum inter-marker distance that a dictionary with square makers can have has been derived. The paper has also proposed an automatic method to detect the markers and correct possible errors. Instead of using redundant bits for error detection and correction, our approach is based on a search on the generated dictionary. Finally, a method to overcome the occlusion problem in augmented reality applications has been presented: a color map employed to calculate the occlusion mask.
The experiments conducted have shown that the dictionaries generated with our method outperform state-of-the-art systems in terms of inter-marker distance, number of bit transitions and false positive rate. Finally, this work has been set publicly available in the ArUco library [13].
Conflict of interest statement None declared.
Fig. 14. Translation error for different degrees of marker board occlusion and for three camera distances.
Acknowledgments
We are grateful to the financial support provided by Science and Technology Ministry of Spain and FEDER (projects TIN201232952 and BROCA).
Fig. 15. Examples of users0 interaction applying the occlusion mask. Note that hands and other real objects are not occluded by the virtual character and the virtual floor texture. (For interpretation of the references to color in this figure caption, the reader is referred to the web version of this paper.)
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
2291
Fig. 16. Example of occlusion mask errors due to light saturation. (a) Original input image. (b) Markers detected. (c) Occlusion mask. (d) Augmented scene.
Appendix A. Supplementary data
Supplementary data associated with this article can be found in the online version at http://dx.doi.org/10.1016/j.patcog.2014.01. 005.
References
[1] R.T. Azuma, A survey of augmented reality, Presence 6 (1997) 355385. [2] H. Kato, M. Billinghurst, Marker tracking and HMD calibration for a video-
based augmented reality conferencing system, in: International Workshop on Augmented Reality, 1999, pp. 8594. [3] V. Lepetit, P. Fua, Monocular model-based 3D tracking of rigid objects: a survey, in: Foundations and Trends in Computer Graphics and Vision, 2005, pp. 189. [4] B. Williams, M. Cummins, J. Neira, P. Newman, I. Reid, J. Tardós, A comparison of loop closing techniques in monocular SLAM, Robotics and Autonomous Systems 57 (2009) 11881197. [5] W. Daniel, R. Gerhard, M. Alessandro, T. Drummond, S. Dieter, Real-time detection and tracking for augmented reality on mobile phones, IEEE Trans. Vis. Comput. Graph. 16 (3) (2010) 355368. [6] G. Klein, D. Murray, Parallel tracking and mapping for small AR workspaces, in: Proceedings of the 2007 6th IEEE and ACM International Symposium on Mixed and Augmented Reality, ISMAR 007, IEEE Computer Society, Washington, DC, USA, 2007, pp. 110. [7] K. Mikolajczyk, C. Schmid, Indexing based on scale invariant interest points, in: ICCV, 2001, pp. 525531. [8] D.G. Lowe, Object recognition from local scale-invariant features, in: Proceedings of the International Conference on Computer Vision, ICCV 099, vol. 2, IEEE Computer Society, Washington, DC, USA, 1999, pp. 11501157. [9] P. Bhattacharya, M. Gavrilova, A survey of landmark recognition using the bag-ofwords framework, in: Intelligent Computer Graphics, Studies in Computational Intelligence, vol. 441, Springer, Berlin, Heidelberg, 2013, pp. 243263. [10] H. Kato, M. Billinghurst, Marker tracking and HMD calibration for a videobased augmented reality conferencing system, in: Proceedings of the 2nd IEEE and ACM International Workshop on Augmented Reality, IWAR 099, IEEE Computer Society, Washington, DC, USA, 1999, pp. 8594. [11] M. Fiala, Designing highly reliable fiducial markers, IEEE Trans. Pattern Anal. Mach. Intell. 32 (7) (2010) 13171324. [12] D. Schmalstieg, A. Fuhrmann, G. Hesina, Z. Szalavári, L.M. Encarnaçäo, M. Gervautz, W. Purgathofer, The Studierstube augmented reality project, Presence: Teleoper. Virtual Environ. 11 (1) (2002) 3354. [13] R. Muñoz-Salinas, S. Garrido-Jurado, ArUco Library, 2013, 〈http://sourceforge. net/projects/aruco/〉[Online; accessed 01-December-2013]. [14] K. Dorfmller, H. Wirth, Real-time hand and head tracking for virtual environments using infrared beacons, in: Proceedings of CAPTECH98, Springer-Verlag, Berlin Heidelberg, 1998, pp. 113127. [15] M. Ribo, A. Pinz, A. L. Fuhrmann, A new optical tracking system for virtual and augmented reality applications, in: Proceedings of the IEEE Instrumentation and Measurement Technical Conference, 2001, pp. 19321936. [16] V.A. Knyaz, R.V. Sibiryakov, The development of new coded targets for automated point identification and non-contact surface measurements, in: 3D Surface Measurements, International Archives of Photogrammetry and Remote Sensing, vol. XXXII, Part 5, 1998, pp. 8085. [17] L. Naimark, E. Foxlin, Circular data matrix fiducial system and robust image processing for a wearable vision-inertial self-tracker, in: Proceedings of the 1st International Symposium on Mixed and Augmented Reality, ISMAR 002, IEEE Computer Society, Washington, DC, USA, 2002, pp. 2736. [18] J. Rekimoto, Y. Ayatsuka, Cybercode: designing augmented reality environments with visual tags, in: Proceedings of DARE 2000 on Designing Augmented Reality Environments, DARE 000, ACM, New York, NY, USA, 2000, pp. 110.
[19] M. Rohs, B. Gfeller, Using camera-equipped mobile phones for interacting with real-world objects, in: Advances in Pervasive Computing, 2004, pp. 265271.
[20] M. Kaltenbrunner, R. Bencina, Reactivision: a computer-vision framework for table-based tangible interaction, in: Proceedings of the 1st International Conference on Tangible and Embedded Interaction, TEI 007, ACM, New York, NY, USA, 2007, pp. 6974.
[21] D. Claus, A. Fitzgibbon, Reliable automatic calibration of a marker-based position tracking system, in: Workshop on the Applications of Computer Vision, 2005, pp. 300305.
[22] M. Fiala, Comparing ARTag and ARToolKit plus fiducial marker systems, in: IEEE International Workshop on Haptic Audio Visual Environments and Their Applications, 2005, pp. 147152.
[23] J. Rekimoto, Matrix: a realtime object identification and registration method for augmented reality, in: Proceedings of the 3rd Asian Pacific Computer and Human Interaction, Kangawa, Japan, IEEE Computer Society, July 1517, 1998, pp. 6369.
[24] D. Wagner, D. Schmalstieg, ARToolKitPlus for pose tracking on mobile devices, in: Computer Vision Winter Workshop, 2007, pp. 139146.
[25] S. Lin, D. Costello, Error Control Coding: Fundamentals and Applications, Prentice Hall, New Jersey, 1983.
[26] D. Flohr, J. Fischer, A lightweight ID-based extension for marker tracking systems, in: Short Paper Proceedings of the Eurographics Symposium on Virtual Environments (EGVE), 2007, pp. 5964.
[27] X. Zhang, S. Fronz, N. Navab, Visual marker detection and decoding in AR systems: a comparative study, in: Proceedings of the 1st International Symposium on Mixed and Augmented Reality, ISMAR 002, IEEE Computer Society, Washington, DC, USA, 2002, pp. 97106.
[28] W. Friedrich, D. Jahn, L. Schmidt, Arvika—augmented reality for development, production and service, in: DLR Projektträger des BMBF für Informationstechnik (Ed.), International Status Conference—Lead Projects HumanComputer Interaction (Saarbrücken 2001), DLR, Berlin, 2001, pp. 7989.
[29] S. Zollmann, G. Reitmayr, Dense depth maps from sparse models and image coherence for augmented reality, in: 18th ACM Symposium on Virtual Reality Software and Technology, 2012, pp. 5360.
[30] M.O. Berger, Resolving occlusion in augmented reality: a contour based approach without 3D reconstruction, in: Proceedings of CVPR (IEEE Conference on Computer Vision and Pattern Recognition), Puerto Rico, 1997, pp. 9196.
[31] J. Schmidt, H. Niemann, S. Vogt, Dense disparity maps in real-time with an application to augmented reality, in: Proceedings of the 6th IEEE Workshop on Applications of Computer Vision, WACV 002, IEEE Computer Society, Washington, DC, USA, 2002, pp. 225230.
[32] A. Fuhrmann, G. Hesina, F. Faure, M. Gervautz, Occlusion in collaborative augmented environments, Technical Report TR-186-2-98-29, Institute of Computer Graphics and Algorithms, Vienna University of Technology, Favoritenstrasse 9-11/186, A-1040 Vienna, Austria, December 1998.
[33] V. Lepetit, M. odile Berger, A semi-automatic method for resolving occlusion in augmented reality, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2000, pp. 225230.
[34] R. Radke, Image change detection algorithms: a systematic survey, IEEE Trans. Image Process. 14 (3) (2005) 294307.
[35] J. Canny, A computational approach to edge detection, IEEE Trans. Pattern Anal. Mach. Intell. 8 (6) (1986) 679698.
[36] S. Suzuki, K. Abe, Topological structural analysis of digitized binary images by border following, Comput. Vis. Graph. Image Process. 30 (1) (1985) 3246.
[37] D.H. Douglas, T.K. Peucker, Algorithms for the reduction of the number of points required to represent a digitized line or its caricature, Cartographica: Int. J. Geogr. Inf. Geovis. 10 (2) (1973) 112122.
[38] N. Otsu, A threshold selection method from gray-level histograms, IEEE Trans. Syst. Man Cybern. 9 (1) (1979) 6266.
[39] D.W. Marquardt, An algorithm for least-squares estimation of nonlinear parameters, SIAM J. Appl. Math. 11 (2) (1963) 431441.
[40] R. Hartley, A. Zisserman, Multiple View Geometry in Computer Vision, 2nd edition, Cambridge University Press, New York, NY, USA, 2003.
[41] C. Harris, M. Stephens, A combined corner and edge detector, in: In Proceedings of 4th Alvey Vision Conference, 1988, pp. 147151.
2292
S. Garrido-Jurado et al. / Pattern Recognition 47 (2014) 22802292
[42] W. Förstner, E. Gülch, A Fast Operator for Detection and Precise Location of Distinct Points, Corners and Centres of Circular Features, 1987.
[43] S.M. Smith, J.M. Brady, Susan—a new approach to low level image processing, Int. J. Comput. Vis. 23 (1995) 4578.
[44] A. Sanjeev, R. Kannan, Learning mixtures of arbitrary Gaussians, in: Proceedings of the 33rd annual ACM Symposium on Theory of Computing, STOC 001, ACM, New York, NY, USA, 2001, pp. 247257.
[45] A.P. Dempster, N.M. Laird, D.B. Rubin, Maximum likelihood from incomplete data via the EM algorithm, J. R. Stat. Soc. Ser. B (Methodological) 39 (1) (1977) 138.
[46] D.F. Williamson, R.A. Parker, J.S. Kendrick, The box plot: a simple visual method to interpret data, Ann. Intern. Med. 110(11) (1989).
[47] D.Q. Huynh, Metrics for 3D rotations: comparison and analysis, J. Math. Imaging Vis. 35 (2) (2009) 155164.
S. Garrido-Jurado received his B.S. degree in Computer Science from Cordoba University, Spain, in 2011. He obtained his M.S. degree in 2012 and is currently a Ph.D. Candidate in the Department of Computing and Numerical Analysis of Cordoba University. His research interests are in the areas of augmented reality, automatic camera pose estimation and 3D reconstruction.
R. Muñoz-Salinas received the Bachelor degree in Computer Science from the University of Granada (Spain) and the Ph.D. degree from the University of Granada in 2006. Since then, he has been working with the Department of Computing and Numerical Analysis of Cordoba University, currently he is a lecturer. His research is focused mainly on Computer Vision, Soft Computing techniques applied to Robotics and HumanRobot Interaction.
F.J. Madrid-Cuevas received the Bachelor degree in Computer Science from Malaga University (Spain) and the Ph.D. degree from Polytechnic University of Madrid (Spain), in 1995 and 2003, respectively. Since 1996 he has been working with the Department of Computing and Numerical Analysis of Cordoba University, currently he is an assistant professor. His research is focused mainly on image segmentation, object recognition and 3D shape-from-X algorithms.
M.J. Marín-Jiménez received his B.Sc., M.Sc. degrees from the University of Granada, Spain, in 2003, and Ph.D. degree from the University of Granada, Spain in 2010. He has worked, as a visiting student, at the Computer Vision Center of Barcelona (Spain), Vislab-ISR/IST of Lisboa (Portugal) and the Visual Geometry Group of Oxford (UK). Currently, he works as an assistant professor at the University of Cordoba (Spain). His research interests include object detection, human-centric video understanding and machine learning.

View File

@@ -0,0 +1,15 @@
Title: Automatic generation and detection of highly reliable fiducial markers under occlusion
Subject: Pattern Recognition, 47 + (2014) 2280-2292. doi:10.1016/j.patcog.2014.01.005
Keywords: Augmented reality; Fiducial marker; Computer vision
Author: S. Garrido-Jurado
Creator: Elsevier
CreationDate: 02/17/14 15:08:11
ModDate: 02/17/14 15:08:11
Tagged: yes
Form: AcroForm
Pages: 13
Encrypted: no
Page size: 595.276 x 793.701 pts (rotated 0 degrees)
File size: 6577180 bytes
Optimized: yes
PDF version: 1.7

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
Title: Foundations of Applied Statistical Methods
Author:
Producer: Adobe PDF Library 10.0.1
CreationDate: 11/20/23 17:55:02
ModDate: 11/21/23 16:13:53
Tagged: yes
Form: none
Pages: 191
Encrypted: no
Page size: 453.54 x 683.15 pts (rotated 0 degrees)
File size: 8372740 bytes
Optimized: yes
PDF version: 1.4

View File

@@ -0,0 +1 @@
{"pageIndex":5,"scale":150,"top":16,"left":-200,"scrollMode":0,"spreadMode":0}

View File

@@ -1 +1 @@
{"pageIndex":0,"scale":"page-width","top":579,"left":-14,"scrollMode":0,"spreadMode":0}
{"pageIndex":0,"scale":"page-width","top":579,"left":-9,"scrollMode":0,"spreadMode":0}

View File

@@ -0,0 +1 @@
{"pageIndex":0,"scale":"page-width","top":677,"left":-7,"scrollMode":0,"spreadMode":0}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
Producer: iText® 5.5.13.2 ©2000-2020 iText Group NV (AGPL-version); modified using iText® 7.1.14 ©2000-2020 iText Group NV (AGPL-version)
CreationDate: 11/28/24 18:58:28
ModDate: 11/29/24 06:36:24
Tagged: no
Form: none
Pages: 595
Encrypted: no
Page size: 476.22 x 680.315 pts (rotated 0 degrees)
File size: 12161243 bytes
Optimized: yes
PDF version: 1.4

View File

@@ -0,0 +1,473 @@
J. Mol. Biol. (1970) 48, 443453
A General Method Applicable to the Search for Similarities in the Amino Acid Sequence of Two Proteins
SAUL B. NEEDLEMAN ~LNDCHRISTIAN D. WIJN~CH Department of Biochemistry, Northwestern University, and
Nuclear Medicine Service, V. A. Research Hospital Chicago, Ill. 60611, U.S.A.
(Received 21 July 1969)
A computer adaptable method for finding similarities in the amino acid sequences of two proteins has been developed. From these findings it is possible to determine whether significant homology exists between the proteins. This information is used to trace their possible evolutionary development.
The maximum match is a number dependent upon the similarity of the sequences. One of its definitions is the largest number of amino acids of one protein that can be matched with those of a second protein allowing for all possible interruptions in either of the sequences. While the interruptions give rise to a very large number of comparisons, the method efficiently excludes from consideration those comparisons that cannot contribute to the maximum match.
Comparisons are made from the smallest unit of significance, a pair of amino acids, one from each protein. All possible pairs are represented by a two-dimensional array, and all possible comparisons are represented by pathways through the array. For this maximum match only certain of the possible pathways must, be evaluated. A numerical value, one in this case, is assigned to every cell in the array representing like amino acids. The maximum match is the largest number that would result from summing the cell values of every pathway.
1. Introduction The amino acid sequences of a number of proteins have been compared to determine whether the relationships existing between them could have occurred by chance. Generally, these sequences are from proteins having closely related functions and are so similar that simple visual comparisons can reveal sequence coincidence. Because the method of visual comparison is tedious and because the determination of the significance of a given result usually is left to intuitive rationalization, computerbased statistical approaches have been proposed (Fitch, 1966; Needleman & Blair, 1969).
Direct comparison of two sequences, based on the presence in both of corresponding amino acids in an identical array, is insufficient to establish the full genetic relationships between the two proteins. Allowance for gaps (Braunitzer, 1965) greatly multiplies the number of comparisons that can be made but introduces unnecessary and partial comparisons.
2. A General Method for Sequence Comparison The smallest unit of comparison is a pair of amino acids, one from each protein. The maximum match can be defined as the largest number of amino acids of one protein that can be matched with those of another protein while allowing for all possible deletions.,
443
444
S. B. NEEDLEMAN
ASD C. D. WUNSCH
The maximum match can be determined by representing in a two-dimensional array? all possible pair combinations that can be constructed from the amino acid sequences of the proteins, A and B, being compared. If the amino acids are numbered from the N-terminal end, Aj is the jth amino acid of protein A and Bi is the ith amino acid of protein B. The Aj represent the columns and the Bi the rows of the two-dimensional array, MAT. Then the cell, MATij, represents a pair combination that contains Aj and Bi.
Every possible comparison can now be represented by pathways through the array. An i or j can occur only once in a pathway because a particular amino acid cannot occupy more than one position at one time. Furthermore, if MATmn is part of a pathway including MATij, the only permissible relationships of their indices are m > i, n > j or m < i, n < j. Any other relationships represent permutations of one or both amino acid sequences which cannot be allowed since this destroys the significance of a sequence. Then any pathway can be represented by MATab . . . MATyz, where a 3 1, b 3 1, the i and j of all subsequent cells of MAT are larger than the running indices of the previous cell and y < K, x 4 M, the total number of amino acids comprising the sequences of proteins A and B, respectively. A pathway is signified by a line connecting cells of the array. Complete diagonals of the array contain no gaps. When MATij and MATmn are part of a pathway, i - m # j - n is a sufficient, but not. necessary condition for a gap to occur. A necessary pathway through MAT is defined as one which begins at a cell in the first column or the first row. Both i and j must increase in value; either i or j must increase by only one but the other index may increase by one or more. This leads to the next cell in a MAT pathway. This procedure is repeated until either i or j, or both, equal their limiting values, I{ and 111, respectively. Every partial or unnecessary pathway will be contained in at least one necessary pathway.
In the simplest method, MATij is assigned the value, one, if Aj is the same kind of amino acid as Bi; if they are different amino acids, MATij is assigned the value, zero. The sophistication of the comparison is increased if, instead of zero or one, each cell value is made a function of the composition of the proteins, the genetic code triplets representing the amino acids, the neighboring cells in the array, or any theory concerned with the significance of a pair of amino acids. A penalty factor, a number subtracted for every gap made, may be assessedas a barrier to allowing the gap. The penalty factor could be a function of the size and/or direction of the gap. No gap would be allowed in the operation unless the benefit from allowing that gap would exceed the barrier. The maximum-match pathway then, is that pathway for u,bich the sum of the assigned cell values (less any penalty factors) is largest. MAT can be broken up into subsections operated upon independently. The method also can be expanded to allow simultaneous comparison of several proteins using the amino acid sequences of n proteins to generate an n-dimensional array whose cells represent all possible combinations of n amino acids, one from each protein.
The maximum-match pathway can be obtained by beginning at the terminals of the sequences (i = y, j = Z) and proceeding toward the origins, first by adding to the value of each cell possessing indices i = y - 1 and/or j = z - 1, the maximum value from among all the cells which lie on a pathway to it. The process is repeated for indices i = y - 2 and/or j = z - 2. This increment in the indices is continued until all cells in the matrix have been operated upon. Each cell in this outer row or column will contain the maximum number of matches that can be obtained by originating
SIMILARITIES
IN AMINO ACID SEQUENCE
446
any pathway at that cell and the largest number in that row or column is equal to the maximum match; the maximum-match pathway in any row or column must begin at this number. The operation of successive summations of cell values is illustrated in Figures 1 and 2.
ABCNJROCLCRPM A 1
1
1
1
4332200
B121111
P000000
FIQ. 1. The maximum-match operation for necessary pathways. The number contained in each cell of the array is the largest number of identical pairs that can be found if that cell is the origin for a pathway which proceeds with increases in running indices. Identical pairs of amino acids were given the value of one. Blank cells which represent non-identical pairs have the value, zero. The operation of successive summations was begun at the last row of the array and proceeded row-by-row towards the first row. The operation has been partially completed in the R row. The enclosed cell in this row is the site of the cell operation which consists of a search along the subrow and subcolumn indicated by borders for the largest value, 4 in subrow C. This value is acldecl to the cell from which the search began.
ABCNJROCLCRPM
A
J
4332100
C
J
N
R
C
K333333 33
C
R 2 11112
111
B
P _0_0000-0.-0-000010
.____
FIG. 2. Contributors to the maximum match in the completed array. The alternative pathways that could form the maximum match are illustrated. The maximum match terminates rtt the largest number in the first row or first column, 8 in this case.
446
S. B. NEEDLEMAN
AND C. D. WUNSCH
It is apparent that the above array operation can begin at any of a number of points along the borders of the array, which is equivalent to a comparison of N-terminal residues or C-terminal residues only. As long as the appropriate rules for pathways are followed, the maximum match will be the same. The cells of the array which contributed to the maximum match, may be determined by recording the origin of the number that was added to each cell when the array was operated upon.
3. Evaluating the Significance of the Maximum Match
A given maximum match may represent the maximum number of amino acids matched, or it may just be a number that is a complex function of the relationship between sequences. It will, however, always be a function of both the amino acid compositions of the proteins and the relationship between their sequences. One may ask whether a particular result found differs significantly from a fortuitous match between two random sequences. Ideally,one would prefer to know the exact probability of obtaining the result found from a pair of random sequences and what fraction of the total possibilities are less probable, but that is prohibitively difficult, especially if a complex function were used for assigning a value to the cells.
As an alternative to determining the exact probabilities, it is possible to estimate the probabilities experimentally. To accomplish the estimate one can construct two sets of random sequences, a set from the amino acid composition of each of the proteins compared. Pairs of random sequences can then be formed by randomly drawing one member from each set. Determining the maximum match for each pair selected will yield a set of random values. If the value found for the real proteins is significantly different from the values found for the random sequences, the difference is a function of the sequences alone and not of the compositions. Alternatively, one can construct random sequences from only one of the proteins and compare them with the other to determine a set of random values. The two procedures measure different probabilities. The first procedure determines whether a significant relationship exists between the real sequences. The second procedure determines whether the relationship of the protein used to form the random sequences to the other proteins is significant. It bears reiterating that the integral amino acid composition of each random sequence must be equal to that of the protein it represents.
The amino acid sequence of each protein compared belongs to a set of sequences which are permutations. Sequences drawn randomly from one or both of these sets are used to establish a distribution of random maximum-match values which would include all possible values if enough comparisons were made. The null hypothesis, that any sequence relationship manifested by the two proteins is a random one, is tested. If the distribution of random values indicates a small probability that a maximum match equal to, or greater than, that found for the two proteins could be drawn from the random set, the hypothesis is rejected.
4. Cell Values and Weighting Factors
To provide a theoretical framework for experiments, amino acid pairs may be classified into two broad types, identical and non-identical pairs. From 20 different amino acids one can construct 180 possible non-identical pairs. Of these, 75 pairs of amino acids have codons (Marshall, Caskey & Nirenberg, 1967) whose bases differ at only one position (Eck & Dayhoff, 1966). Each change is presumably the result of a
SIMILARITIES IN AMINO ACID SEQUENCE
447
single-point mutation. The majority of non-identical pairs have a maximum of only one or zero corresponding bases. Due to the degeneracy of the genetic code, pair differences representing amino acids with no possible corresponding bases are uncommon even in randomly selected pairs. If cells are weighted in accordance with the maximum number of corresponding bases in codons of the represented amino acids, the maximum match will be a function of identical and non-identical pairs. For comparisons in general, the cell weights can be chosen on any basis.
If every possible sequence gap is allowed in forming the maximum match, the significance of the maximum match is enhanced by decreasing the weight of those pathways containing a large number of gaps. A simple way to accomplish this is to assign a penalty factor, a number which is subtracted from the maximum match for each gap used to form it. The penalty is assigned before the maximum match is formed. Thus the pathways will be weighted according to the number of gaps they contain, but the nature of the contributors to the maximum match will be affected as well. In proceeding from one cell to the next in a maximum-match pathway, it is necessary that the difference between each cell value and the penalty, be greater than the value for a cell in a pathway that contains no gap. If the value of the penalty were zero, all. possible gaps could be allowed. If the value were equal to the theoretical value for the maximum match between two proteins, it would be impossible to allow a gap and. the maximum match would be the largest of the values found by simply summing along the diagonals of the array; this is the simple frame-shift method.
5. Application of the Method
To illustrate the role of weighting factors in evaluating a maximum match, two proteins expected to show homology, whale myoglobin (Edmundson, 1965) and human /l-hemoglobin (Konigsberg, Goldstein & Hill, 1963), and two proteins not expected to exhibit homology, bovine pancreatic ribonuclease (Smyth, Stem t Moore, 1963) and hens egg lysozyme (Canfield, 1963) were chosen for comparisons.
The FORTRANprograms used in this study were written for the CDC3400 computer. The operations employed in forming the maximum match are those for the special case when none of the cells of the array have a value less than zero. Four types of amino acid pairs were distinguished and variable sets consisting of values to be assigned to each type of pair and a value for the penalty were established. The pair types are as follows:
Type 3. Identical pairs: those having a maximum of three corresponding bases in their codons.
Type 2. Pairs having a maximum of two corresponding bases in their codons. Type 1. Pairs having a maximum of one corresponding base in their codons. Type 0. Pairs having no possible corresponding base in their codons.
The value for type 3 pairs was 1.0 and the value for type 0 pairs was zero for all variable sets.
At program execution time, the a,mino acids (coded by two-digit numbers) of the sequences to be compared were read into the computer, and were followed by a twenty-by-twenty symmetrical array, the maximum correspondence array, analogous to one used by Fitch (1966), that contained all possible pairs of amino acids and identified each pair as to type. The RNA codons for amino acids used to construct the maximum-correspondence array were taken from a single Table (Marshall et al.,
448
S. B. NEEDLEMAN
AND C. D. WUNSCH
1967). The UGA, UAA and UAG codons were not used, but UUG was used as a codon for leucine. The subsequent data cards indicated the numerical values for a variable set.
The two-dimensional comparison array was generated row-by-row. The amino acid code numbers for Ai and Bj referenced the correspondence array to determine the type of amino acid pair constituted by Ai and Bj. The type number referenced a short array, the variable set, containing the type values, and the appropriate value from that set was assigned to the appropriate cell of the comparison array. The maximum match was then determined by the procedure of successive summations.
Following the determination of the maximum makh for the real proteins, the amino acid sequence of only one member of the protein pair was randomized and the match was repeated. The sequences of ,&hemoglobin and ribonuclease were the ones randomized. The randomization procedure was a sequence shuffling routine based on computer-generated random numbers. A cycle of sequence randomization-maximummatch determination was repeated ten times in all of the experiments in this report, giving the random values used for comparison wit,h the real maximum-match. The average and standard deviation for the random values of each variable set was estimated.
6. Results and Discussion
The use of a small random sample size (ten) was necessary to hold the computer time to a reasonable level. The maximum probable error in a standard deviation estimate for a sample this small is quite large and the results should be judged with this fact in mind. For each set of variables, it was assumed that the random values would be distributed in the fashion of the normal-error curve; therefore, the values of the first six random sets in the ,B-hemoglobin-myoglobin comparison were converted to standard measure, five was added to the result, and these values were plotted as one group against their calculated probit. The results of the plot are shown in Figure 3. The fit is good indicating the probable adequacy of the measured standard deviations for these variable sets in estimating distribution functions for random values through two standard deviations. The above fit indicates no bias in the randomization procedure. In other words, randomization of the sequence was complete before the maximum match was determined for any sequence in a random set.
The results obtained in the comparison of /3-hemoglobin with myoglobin are summarized in Table 1 and the results for the ribonuclease-lysozyme comparison are in Table 2. These Tables indicate the values assigned to the pair types, the penalty factor used in forming each of the maximum matches, and the statistical results obtained. The number of gaps roughly characterizes the nature of the pathway that formed the maximum match. A large number is indicative of a devious pathway through the array. One gap means that all of the pathway may be found on only two partial diagonals of the array.
The most important information is obtained from the standardized value of the maximum match for the real proteins, the difference from the mean in standarddeviation units. For this sample size all deviations greater than 3.0 were assumed to include less than 1% of the true random population and to indicate a significant difference. As might be expected, all matches of myoglobin and ,&hemoglobin show a significant deviation. Among the sets of variables, set 1, which results in a search for identical amino acid pairs while allowing for all deletions, indicates that 63
SIMILARITIES
IN SMINO ACID SEQUENCE
449
8 ----T------T--
_.._ --i.--.-.“-.-T---~i-..
7
6
I$ h
4
3
i
3
4
8
6
7
8
Variable in standardized measure
FIG. 3. Probit plot for six grouped random samples.
The solid line indicates the plot that would result from a probit analysis on an infinite number
of samples from a normally-distributed
population. The points represent the results of probit
calculations on 60 random maximum match values that were assumed to have come from one
population.
TABLE 1 /3-Hemoglobin-myoglobin maximum matches
Variable set
Match values for
pair types
2
1
Penalty
Maximum-match value sum
Real Random?
s
Real Minimum deletions
x
Real
Randomt
0
0
0
63.00
55.60 1.80 4.11
35
36.2
0
0
1.00
38.00
27.80 2.09 4.88
4
5.5
0.67
0.33
0
97.00
91.47 1.55 3.57
18
24.3
0.67
0.33
1.03 89.63
80.25 1.11 8.46
1
3.6
0.25
0.05
0
71.55
64.78 1 59 4.27
46
45.0
0.25
0.05
1.05 51.95
40.54 1.46 7.80
3
7.5
0.25
0.05
25
47.30
33.80 1.52 8.87
0
0
s is the estimated standard deviation; X, the standardized value, (real - random)/s, of the maximum match of the real proteins. The values for type 3 and type 0 pairs were 1-O and 0, respectively, in each variable set.
t An average value from 10 samples.
450
Variable set
8. B. NEEDLEMAN
AND C. D. WUNSCH
TABLE 2 Ribonuclease-lysoxyme maximum matches
Match values for
pair types
2
1
Penalty
Maximum-match value 8um
Real Randomt
9
Real Minimum deletions
X
Real
Random?
1
0
0
0
48.00
44.20 2.56 1.48 34
20.2
2
0
0
1.00 23.00
22.00 1.73 0.58
5
:i 2
3
0.67
0.33
0
78.33
76.17 0.82 2.64 21
18.8
4
0.67
0.33
1.03 67.93
67.37 1.27 0.43
2
2.2
5
0.25
0.05
0
56.00
52.26 2.12 1.77 35
33.5
6
0.25 0.05
1.05 33.70
33.02 1.66 0.41
8
6.8
7
0.25
0.05
25
28.15
27.67 1.75 0.22
0
0
8 is the estimated standard deviation; X, the maximum match of the real proteins. The values respectively in each variable set.
t An average value from 10 samples.
standardized value, for type 3 and type
(real-random)/a, of the 0 pairs were 1.0 and 0,
amino acids in ,&hemoglobin and myoglobin can be matched. To attain this match, however, it is necessary to permit at least 35 gaps. In contrast, when two gaps are allowed according to Braunitzer (1965), it is possible to match only 37 of the amino acids. Curiously, when this variable set was used for comparing human myoglobin (Hill, personal communication) with human /Lhemoglobin, the maximum match obtained was not significant. Differences between real and random values were highly significant, however, when other variable sets were used.
Variable set 2 attaches a penalty equal to the value of one identical amino acid pair to the search for identical amino acid pairs. This penalty will exclude from consideration any possible pathway that leaves and returns to a principal diagonal, thereby needing two gaps, in order to add only one or two amino acids to the maximum match. This set results in a total of 30 + 4 = 42 amino acids matched (the maximum-match value plus the number of gaps is reduced to four) and the significance of the result relative to set 1 appears to be increased. Braunitzers comparison would have a value of 37 - 2 = 35 using this variable set, hence it was not selected by the method.
Variable sets 3 and 4 have an interesting property. Their maximum-match values can be related to the minimum number of mutations needed to convert the selected parts of one amino acid sequence into the selected parts of the other. The minimum number of mutations concept in protein comparisons was first advanced by Fitch (1966). If the type values for these sets are multiplied by three, they become equal to their pair type and directly represent the maximum number of corresponding bases in the codons for a given amino acid pair. Thus the maximum match and penalty factors may be multiplied by three, making it possible to calculate the maximum number of bases matched in the combination of amino acid pairs selected by the maximum-match operation.
,%Hemoglobin, the smaller of the two proteins, contains 146 amino acids; consequently the highest possible maximum match (disregarding integral amino-acid composition data) with myoglobin is 146 x 3 = 438. Insufficient data are available
SIMILARITIES
IN AMINO ACID SEQUENCE
461
to analyze the result from set 3 on the basis of mutations. If it is assumed that the gap in set 4 does not exclude any part of/3-hemoglobin from the comparison, this set has a maximum of 3(89*63 + 1.03) = 272 bases matched, indicating a minimum of 438 272 = 166 point mutations in this combination. Using this variable set and placing gaps according to Braunitzer, a score of 88.6 was obtained, thus his match was not selected. Again it may be observed that the penalty greatly enhanced the significance of the maximum match.
Variable sets 5 and 6 have no intrinsic meaning and were chosen because the weight attached to type 2 and type 1 pairs is intermediate in value with respect to sets 1 and 2 and sets 3 and 4. The maximum match for set 6 is seen to have a highly significant value.
The data of set 7 are results that would be obtained from using the frame-shift method to select a maximum match; the penalty was large enough to prevent any gaps in the comparisons. The slight differences in significance found among the maximum-match values of /l-hemoglobin and myoglobin resulting from use of sets 4,6 and 7 are probably meaningless due to small sample size and errors introduced by the assumptions about the distribution functions of random values. Finding a value in set 7 that is approximately equal to those from sets 4 and 6 in significance is not surprising. A larger penalty factor would have increased the difference from the mean in sets 4 and 6 because almost every random value in each set was the result of more gaps than were required to form the real maximum match. Further, the gaps that are allowed are at the N-terminal ends so that about 85% of the comparison can be made without gaps. If an actual gap were present near the middle of one of the sequences, it would have caused a sharp reduction in the significance of the frame-shift type of match.
Set 3 is the only variable set in Table 2 that shows a possible difference. Assuming the value is accurate, other than chance, there is no simple explanation for the difference. A small but meaningful difference in any comparison could represent evolutionary divergence or convergence. It is generally accepted that the primary structure of proteins is the chief determinant of the tertiary structure. Because certain features of tertiary structure are common to proteins, it is reasonable to suppose that proteins will exhibit similarities in their sequences, and that these similarities will be sufficient to cause a significant difference between most protein pairs and their corresponding randomized sequences, being an example of submolecular evolutionary convergence. Further, the interactions of the protein backbone, side chains, and the solvent that determine tertiary structure are, in large measure, forces arising from the polarity and steric nature of the protein side-chains. There are conspicuous correlations in the polarity and steric nature of type 2 pairs. Heavy weighting of these pairs would be expected to enhance the significance of real maximum-match values if common structural features are present in proteins that are compared. The presence of sequence similarities does not always imply common ancestry in proteins. More experimentation will be required before a choice among the possibilities suggested for the result from set 3 can be made. If several short, sequences of amino acids are common to all proteins, it seems remarkable that the relationship of ribonuclease to lysozyme in six of the seven variable sets appears to be truly a random one. It should be noted, however, that the standard value of the real. maximum-match is positive in each variable set in this comparison.
This method was designed for the purpose of detecting homology and defining its nature when it can be shown to exist. Its usefulness for the above purposes depends in1
452
S. B. NEEDLEMAN
AND C. D. WUNSCH
part upon assumptions related to the genetic events that could have occurred in the evolution of proteins. Starting with the assumption that homologous proteins are the result of gene duplication and subsequent mutations, it is possible to construct several hypothetical amino-acid sequences that would be expected to show homology. If one assumes that following the duplication, point mutations occur at a constant, or variable rate, but randomly, along the genes of the two proteins, after a relatively short period of time the protein pairs will have nearly identical sequences. Detection of the high degree of homology present can be accomplished by several means. The use of values for non-identical pairs will do little to improve the significance of the results. If no, or very few, deletions (insertions) have occurred, one could expect to enhance the significance of the match by assigning a relatively high penalty for gaps. Later on in time the hypothetical proteins may have a sizable fraction of their codons changed by point mutations, the result being that an attempt to increase the significance of the maximum match will probably require attaching substantial weight to those pairs representing amino acids still having two of the three original bases in their codons. Further, if a few more gaps have occurred, the penalty should be reduced to a small enough value to allow areas of homology to be linked to one another. At a still later date in time more emphasis must be placed on non-identical pairs, and perhaps a very small or even negative penalty factor must be assessed. Eventually, it will be impossible to detect the remaining homology in the hypothetical example by using the approach detailed here.
From consideration of this simple model of protein evolution one may deduce that the variables which maximize the significance of the difference between real and random proteins gives an indication of the nature of the homology. In the comparison of human P-hemoglobin to whale myoglobin, the assignment of some weight to type 2 pairs considerably enhances the significance of the result, indicating substantial evolutionary divergence. Further, few deletions (additions) have apparently occurred.
It is known that the evolutionary divergence manifested by cytochrome (Margoliash, Needleman Bt Stewart, 1963) and other heme proteins (Zuckerkandl & Pauling, 1965) did not follow the sample model outlined above. Their divergence is the result of non-random mutations along the genes. The degree and type of homology can be expected to differ between protein pairs. As a consequence of the difference there is no a priori best set of cell and operation values for maximizing the significance of a maximum-match value of homologous proteins, and as a corollary to this fact, there is no best set of values for the purpose of detecting only slight homology. This is an important consideration, because whether the sequence relationship between proteins is significant depends solely upon the cell and operation values chosen. If it is found that the divergence of proteins follows one or two simple models, it may be possible to derive a set of values that will be most useful in detecting and defining homology.
The most common method for determining the degree of homology between protein pairs has been to count the number of non-identical pairs (amino acid replacements) in the homologous comparison and to use this number as a measure of evolutionary distance between the amino acid sequences. A second, more recent concept has been to count the minimum number of mutations represented by the non-identical pairs. This number is probably a more adequate measure of evolutionary distance because it utilizes more of the available information and theory to give some measure of the number of genetic events that have occurred in the evolution of the proteins. The approach outlined in this paper supplies either of these numbers.
SIMILARITIES
IN AMINO ACID SEQUENCE
463
This work was supported in part by grants to one of us (S.B.N.) from the U.S. Public Health Service (1 501 FR 05370 02) and from Merck Sharp & Dohme.
REFERENCES
Braunitzer, G. (1966). In Evolving Genes and Proteina, ed. by V. Bryson & H. J. Vogel, p. 183. New York: Academic Press.
Canfield, R. (1963). J. Biol. Chem. 238, 2698. Eck, R. V. & Dayhoff, M. 0. (1966). Atlas of Protein Sequence and Xtructure. Silver Spring,
Maryland: National Biomedical Research Foundation. Edmundson, A. B. (1965). Nature, 205, 883. Fitch, W. (1966). J. Mol. BioZ. 16, 9. Konigsberg, W., Goldstein, J. & Hill, R. J. (1963). J. BioZ. Chem. 238, 2028. Margoliash, E., Needleman, S. B. & Stewart, J. W. (1963). Acta Chem. Stand. 17, S 250. Marshall, R. E., Caskey, C. T. & Nirenberg, M. (1967). Science, 155, 820. Needleman, S. B. & Blair, T. H. (1969). Proc. Nat. Acad. Sci., Wash. 63, 1127. Smyth, D. G., Stein, W. G. & Moore, S. (1963). J. BioZ. Chem. 238, 227. Zuckerkandl, E. & Pauling, L. (1965). In Evolving Genes and Proteins, ed. by V. Bryson
& H. J. Vogel, p. 97. New York: Academic Press.

View File

@@ -0,0 +1,13 @@
Title: PII: 0022-2836(70)90057-4
Creator: Acrobat 4.05 Capture Plug-in for Windows
Producer: Acrobat 4.05 Import Plug-in for Windows
CreationDate: 08/06/03 23:58:18
ModDate: 09/17/03 19:37:56
Tagged: no
Form: none
Pages: 11
Encrypted: no
Page size: 468 x 684 pts (rotated 0 degrees)
File size: 865922 bytes
Optimized: yes
PDF version: 1.3

View File

@@ -0,0 +1 @@
{"pageIndex":0,"scale":"page-width","top":796,"left":-5,"scrollMode":0,"spreadMode":0}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
Title: Beyond (Multi-) Media
Author: Peter Hoffmann
Producer: Springer-i
CreationDate: 08/09/25 10:24:41
ModDate: 08/09/25 17:31:57
Tagged: yes
Form: AcroForm
Pages: 249
Encrypted: no
Page size: 476.22 x 680.315 pts (rotated 0 degrees)
File size: 24690258 bytes
Optimized: yes
PDF version: 1.7

View File

@@ -0,0 +1,243 @@
J. Mol. Bid. (1981) 147, 195-197
Identification of Common Molecular Subsequences
The identification of maximally homologous subsequences among sets of long
sequences is an important problem in molecular sequence analysis. The problem is
straightforward
only if one restricts consideration to contiguous subsequences
(segments) containing no internal deletions or insertions. The more general problem
has its solution in an extension of sequence metrics (Sellers 1974; Waterman et al.,
1976) developed to measure the minimum number of “events” required to convert
one sequence into another.
These developments in the modern sequence analysis began with the heuristic
homology algorithm of Needleman & Wunsch (1970) which first introduced an
iterative matrix method of calculation. Numerous other heuristic algorithms have
been suggested including those of Fitch (1966) and Dayhoff (1969). More mathemat-
ically rigorous algorithms were suggested by Sankoff (1972), Reichert et al. (1973)
and Beyer et al. (1979) but these were generally not biologically satisfying or
interpretable. Success came with Sellers (1974) development of a true metric measure
of the distance between sequences. This metric was later generalized by Waterman
et al. (1976) to include deletions/insertions
of arbitrary length. This metric
represents the minimum number of “mutational events” required to convert one
sequence into another. It is of interest to note that Smith et al. (1980) have recently
shown that under some conditions the generalized Sellers metric is equivalent to the
original homology algorithm of Needleman & Wunsch (1970).
In this letter we extend the above ideas to find a pair of segments, one from each of
two long sequences, such that there is no other pair of segments with greater
similarity (homology). The similarity measure used here allows for arbitrary length
deletions and insertions.
Algorithm
The two molecular sequences will be h=alaz . . . an and IZj= blb,
b,. A
similarity a(a,b) is given between sequence elements a and b. Deletions of length k
are given weight Wt. To find pairs of segments with high degrees of similarity, we set up a matrix H. First set
Hto = Ho, = 0 for 0 I k I n and 0 I 1 I m.
Preliminary values of H have the interpretation of two segments ending in ai and bj, respectively. relationship
that H, is the maximum similarity These values are obtained from the
Hij=max{Hi-,,j-1+S(ai,bj),
~F,X {Hi-k,j- W,}, ~2" {Hi,j-,- W,}, 0}, (1)
1 li<n and 1 <j<m.
0922-2836/80/09019&03
$02.00/O
195 0 1980 Academic Press Inc. (London) Ltd.
196
T. P. SMITH
AND M. S. LVATER>lAS
The formula for H, follows by considering the possibilities
segments at any ai and b,. (1) If ai and bj are associated, the similarity is
for ending the
Hi-l,j-l +s(ai,bj).
(2) If ai is at the end of a deletion of length k, the similarity is
Hi-k,j-Wk
(3) If bj is at the end of a deletion of length I, the similarity is
Hi-k,j- cc',.
(4) Finally, a zero is included to prevent calculated negative similarity, indicating no similarity up to ai and bj.t
The pair of segments with maximum similarity is found by first locating the
maximum element of H. The other matrix elements leading to this maximum value
are than sequentially determined with a traceback procedure ending with an
element of H equal to zero. This procedure identifies the segments as well as
produces the corresponding alignment. The pair of segments with the next best
similarity is found by applying the traceback procedure to the second largest,
element of H not associated with the first traceback.
A simple example is given in Figure 1. In this example the parameters s(aibj) and
W, required were chosen on an a priori statistical basis. A match, ai = bj, produced
an s(aibj) value of unity while a mismatch produced a minus one-third. These values have an average for long, random sequences over an equally probable four letter set
of zero. The deletion weight must be chosen to be at least equal to the difference
between a match and a mismatch. The value used here was Wk= 1=0-t-1/3*k.
A
0.0 0.0 0.0 0.0 04 0.0 0.0 0.0 0.0 04 0.0 04 04 04
A
0.0 0.0 1,o 0.0 04 04 04 0.0 04 0.0 0.0 0.0 1,o 04
A
0.0 0.0 1.0 0.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.7
L7
0.0 0.0 0.0 0.7 0.3 0.0 I.0 04 04 04 I.0 1.o 0.0 0.i
G
0.0 0.0 04
1.0 0.3 0.0 04
0.i
1.0 0.0 0.0 0.7 0.7 I .o
c
0.0 I .o 0.0 o-o 2.0 1.3 0.3 1.0 0.3 2.0 0.7 0.3 0.3 0.3
(
0.0 1.0 0.1 0.0 1 .o 3.0 1.7 1.3 I.0 1.3 1.i 0.3 0.0 04
A
0.0 0.0 2.0 0.1 0.3 1.7 2.7 I.3
1.0 0.i
1 4
1.3 I .3 0.0
u
0.0 0.0 0.7 1.7 0.3 E-
2.1 2.3 1.0 0.5 1.7 2.0 I 4
1.0
u
0.0 0.0 0.3 0.3 1.3 I .o 1.3 2.3 2.0 0.7 1.7 2.7 1.7 I .o
G
0.0 0.0 0.0 l-3 0.0 1 .o 1.0 G
3.3 2.0 1.7 1.3 1.3 2.i
A
0.0 0.0 1 .o 0.0 I.0 0.3 0.7 0.7 56 3.0 I .i I.3 2.3 2.1)
c
~ 0.0 1.0 0.0 0.7 1,O I.0
0.7 1 ,7 1.7 3.0 1.;
1.3 I.0 2.0
G
0.0 0.0 0.7 1.0 0.3 0.7 1.7 0.3 2.i
I.7 23
2.3 1.0 2.0
G
0.0 0.0 0.0 1.7 0.7 0.3 0.3 1.3 1 ,3 1.3 1.3 2.3 24 2.0
FK:, 1. Hij matrix generated from the application ofeqn (1) to the sequences A-4-U-G-(-(!-$-~-~~(~-.~~
C-G-G and C-A-G-C-C-U-C-G-C-U-U-A-G.
The underlined elements indicate the trackback path fkom the
maximal element 3.30.
t Zero need not be included unless there are negative values ofs(a.b)
LETTERS TO THE EDITOR
197
Note. in this simple example, that the alignment obtained:
-G-C-C-A-U-U-G-G-C-C-UU-C.G-
contains both a mismatch and an internal deletion. It is the identification of the latter which has not been previously possible in any rigorous manner.
This algorithm not only puts the search for pairs of maximally similar segments on a mathematically rigorous basis but it can be efficiently and simply programmed on a computer.
Northern Michigan University
T. F. SMITH
Los Alamos Scientific Laboratory P.0. Box 1663, Los Alamos N. Mex. 87545. U.S.A.
Received 14 July 1980
M. S. WATERMAN
REFERENCES
Beyer, W. A., Smith, T. F., Stein. M. L. & Ulam, S. M. (1979). Math. Biosci. 19, 9-25. Dayhoff. M. 0. (1969). Atlas of Protein Sequence and Structure, National Biomedical Research
Foundation, Silver Springs, Maryland. Fitch, W. M. (1966). J. Mol. Biol. 16, 9-13. Needleman, S. B. & Wunsch, C. D. (1970). J. Mol. Biol. 48, 443-453. Reich&. T. A., Cohen, D. N. & Wong, A. K. C. (1973). J. Theoret. Biol. 42, 245-261. Sankoff, D. (1972). Proc. Nat. Acud. Sci., U.S.A. 61, 44. Sellers. P. H. (1974). J. Appl. Math. (Siam), 26, 787-793. Smith, T. F., Waterman, M. S. & Fitch, W. M. (1981). J. Mol. Evol. In the press. Waterman. M. S., Smith, T. F. & Beyer, W. A. (1976). Advan. Math. 20, 367-387.
,Votp added in proof: A weighting similar to that given above was independently developed by Walter Goad of Los Alamos Scientific Laboratory.

View File

@@ -0,0 +1,13 @@
Title: PII: 0022-2836(81)90087-5
Creator: Acrobat 4.05 Capture Plug-in for Windows
Producer: Acrobat 4.05 Import Plug-in for Windows
CreationDate: 08/18/03 18:13:35
ModDate: 09/19/03 18:46:57
Tagged: no
Form: none
Pages: 3
Encrypted: no
Page size: 468 x 684 pts (rotated 0 degrees)
File size: 179287 bytes
Optimized: yes
PDF version: 1.3

View File

@@ -0,0 +1 @@
{"pageIndex":0,"scale":"page-width","top":795,"left":-8,"scrollMode":0,"spreadMode":0}

View File

@@ -0,0 +1 @@
{"pageIndex":54,"scale":190,"top":630,"left":-112,"scrollMode":0,"spreadMode":0}

View File

View File

@@ -0,0 +1,14 @@
Title: Binder3.pdf
Author: sschimke
Creator: PScript5.dll Version 5.2.2
Producer: Acrobat Distiller 6.0.1 (Windows)
CreationDate: 04/04/06 17:39:24
ModDate: 04/04/06 17:39:24
Tagged: no
Form: none
Pages: 4
Encrypted: no
Page size: 595 x 842 pts (A4) (rotated 0 degrees)
File size: 883254 bytes
Optimized: yes
PDF version: 1.4

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
Title: 457307_1_De_Print.indd
Author: 0012149
Creator: Adobe InDesign 15.0 (Windows)
Producer: Acrobat Distiller 10.1.16 (Windows)
CreationDate: 11/12/20 07:19:34
ModDate: 11/16/20 22:09:02
Tagged: no
Form: AcroForm
Pages: 371
Encrypted: no
Page size: 476.22 x 680.315 pts (rotated 0 degrees)
File size: 8087171 bytes
Optimized: yes
PDF version: 1.6

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
Producer: iTextSharpTM 5.5.14-SNAPSHOT ©2000-2020 iText Group NV (AGPL-version); modified using iTextSharpTM 5.5.14-SNAPSHOT ©2000-2020 iText Group NV (AGPL-version)
CreationDate: 11/15/23 20:55:13
ModDate: 11/17/23 16:01:19
Tagged: no
Form: none
Pages: 264
Encrypted: no
Page size: 439.37 x 666.142 pts (rotated 0 degrees)
File size: 3184225 bytes
Optimized: yes
PDF version: 1.4

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
Title: Foundations of Applied Statistical Methods
Author:
Producer: Adobe PDF Library 10.0.1
CreationDate: 11/20/23 17:55:02
ModDate: 11/21/23 16:13:53
Tagged: yes
Form: none
Pages: 191
Encrypted: no
Page size: 453.54 x 683.15 pts (rotated 0 degrees)
File size: 8372740 bytes
Optimized: yes
PDF version: 1.4

Binary file not shown.

View File

@@ -0,0 +1 @@
{"pageIndex":0,"scale":"page-width","top":595,"left":-4,"scrollMode":0,"spreadMode":0}

View File

@@ -0,0 +1,676 @@
See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/14269194
Disambiguating Complex Visual Information: Towards Communication of Personal Views of a Scene
Article in Perception · February 1996
DOI: 10.1068/p250931 · Source: PubMed
CITATIONS
118
3 authors, including:
Marc Pomplun University of Massachusetts Boston 169 PUBLICATIONS 3,799 CITATIONS
SEE PROFILE
READS
270
Boris M Velichkovsky Kurchatov Institute 191 PUBLICATIONS 4,282 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects: Human Factors and Ergonomics View project In search of the "I" View project
All content following this page was uploaded by Marc Pomplun on 27 May 2014.
The user has requested enhancement of the downloaded file.
Disambiguating Complex Visual Information: Towards Communication of Personal Views of a Scene
Marc Pompluna, Helge Rittera, Boris Velichkovskya;b
a Department of Neuroinformatics, University of Bielefeld, Germany b Unit of Applied Cognitive Research, Dresden University of Technology, Germany
email: impomplu@techfak.uni-bielefeld.de
Abstract. Two experiments on perception and eye-movement scanning of a set of
6 overtly ambiguous pictures are reported. In the rst experiment it was shown that speci c perceptual interpretations of an ambiguous picture usually correlate with parameters of the gaze-position distributions. In the second experiment these distributions were used for an image-processing of initial pictures in such a way that in regions which attracted less xations the brightness of all elements was lowered. The pre-processed pictures were then shown to a group of 150 na?ve subjects for an identi cation. The results of this experiment demonstrated that in 4 out of 6 pictures it was possible to in uence perception of other persons in the predicted way, i.e. to shift spontaneous reports of na?ve subjects in the direction of interpretations that accompanied gaze-position data used for the pre-processing of initial pictures. Possible reasons for a failure of such a communication of personal views in two cases are also discussed.
1 Introduction
Pictures and scenes are notoriously ambiguous. Culture, experience, attention, functional state and dozens of other factors determine that two persons may have completely di erent subjective perception of one and the same physical situation. For any educated psychologist this is a well-established basic fact which certainly deserves investigation but cannot be changed. There is a long tradition of illustrating this multistable and idiosyncratic character of individual perceptive consciousness with the help of ambiguous gures both in history of art (Gombrich, 1969; Chapman, 1987) and in experimental psychology where perception of ambiguous pictures became the goal of countless studies (Vicholkovska, 1906; Boring, 1942; Velichkovsky, Luria & Zinchenko, 1973; Cooper, 1994; Rock, Hall & Davis, 1994). In other disciplines like e.g. computer science pictures and scenes are processed and transformed but usually from a physicalist point of view, although active vision approach and neural computation paradigm can be regarded as signs of change in the tradition (see Lee & Bajcsy, 1992; Ritter, Martinetz & Schulten, 1992). In this paper we are going to demonstrate that an interdisciplinary convergence of these two lines of research is possible and welcomed on practical reasons: The transformation of physical pictures from the perspective of their perception by an active observer can support an unambiguous communication of the subjective views to other persons.
1
In order to approach this problem experimentally we used the most reliable (albeit certainly not ideal, see Zinchenko & Vergiles, 1972) objective index of visual perceptual activity, namely the data about eye movements of an observer. Since Yarbus' (1967) and other earlier investigation it is generally accepted that gaze position data are a fairly sensitive index of individual preferences and task attitudes. Our interest in eye movements was based on pragmatic considerations and had no direct relation to hypotheses about their possible casual role in detection, recognition and identi cation of visual information (e.g. Noton & Stark, 1971). In recent years there were several studies demonstrating the importance of clustering gaze position data (Nodine, Kungel, Toto & Krupinsky, 1992; Pillalamari, Barnette & Birkmire, 1993) for explication of subject's knowledge and strategies. However, these studies did not change the situation of a passive registration of eye movements in principle. The gaze-contingent change of local characteristics of visual displays in dependence on parameters of eye movements remained one of the paradigms of investigation that was predominantly used in the eld of reading research. (see e.g. Rayner, Well, Polatsek & Bertera, 1982).
Our intention was to make a further step: The use of the information about gaze position in order to process the picture/scene for reconstruction of its outlook as it could be available to the active observer who produced the eye-movements. In other words, we want to approach if not the famous question of a philosopher "What is it like to be a bat?" then at least "What is it like to be Mrs/Mr. Smith's (visual) perceptual homunculus?". The answer on this last question can be of practical importance as many forms of non-verbal expertise, for instance, in interpretation of medical images (Norman, Coblentz, Brooks & Babcook, 1992), are still hardly available to an objective analysis and public communication. Fluctuations in perception of classic ambiguous pictures seem to provide a suitable experimental model for the study, because variants of their perceptual interpretation are well known and, in addition, eye movements have been investigated in numerous previous studies. In particular, these studies have demonstrated that the eye movement parameters can be speci c to the di erent subjective interpretations of the ambiguous gures (e.g. Ellis & Stark, 1978; Gale & Findlay, 1983).
Recently Garcia-Perez (1992) proposed that eye movements during perception of ambiguous gures, such as the Necker cube and the Boring gure, can lead to a kind of spatial frequency ltration favoring the interpretation which corresponds to the location of gaze in a corresponding "focal area" of the gure (for other similar proposals, see Kawabata & Mori, 1992; Tsal & Kolbet, 1985). The method developed for the present investigation can be helpful in empirically proving hypotheses of this kind. The study was based on the use of an advanced imaging eye-tracker as well as on our previous work on eye-movement mediated communication of attention in cooperative problem solving (Velichkovsky, 1995).
2 Experiment 1: Eye-movement characteristics in perception of ambiguous pictures
This experiment was performed for collection of eye-movement data and evaluation of their speci city to di erent perceptual interpretations of ambiguous pictures.
2
2.1 Method
2.1.1 Apparatus
The system used in our experiments (Stampe, 1993) is an example of non-invasive imaging eye-trackers. It is based on the use of ISCAN RK-416PC pupil-tracking boards and two video cameras as inputs of information about the position of the head within the environment and the position of the pupil within the head. Fast calibration that remains stable over the whole period of study and does not su er from accidental blinks (which are detected and described as such), free head with permitted deviation from the straight-ahead
position up to 15o, and nally a practically unrestricted eld of view (80o in the horizontal dimension and 60o in the vertical) as well as the possibility to run experiments under nor-
mal illumination conditions made this eye-tracker to a perfect device for basic and applied studies. The average absolute precision of the gaze-position measurement with the help of
the eye-tracker lies within the range of 0:6 : : : 0:8o. By using a new calibration interface
based on parametrized arti cial neural networks, we improved the precision of measure-
ment by up to 0:4o. This made it possible to recruit even subjects wearing spectacles (see
Pomplun, Velichkovsky & Ritter, 1994).
2.1.2 Subjects
6 subjects na?ve about the purpose of the study participated in Experiment 1. They were students and co-workers of the computer science department at University of Bielefeld. 4 of them had a normal and 2 a corrected to normal vision.
2.1.3 Material and procedure
As the stimuli for this experiment we chose 6 pictures. These pictures are shown in Fig. 1 left. Two of them the Necker cube and the Boring gure are classical examples of ambiguous gures with a long history of investigation (Boring, 1942; Garcia-Perez, 1992, among many others). Two others were fragments of "Earth" by Giuseppe Arcimboldo and Maurits Cornelis Escher's "Circlelimit IV". Though popular as examples of perceptual bi-stability, these pictures were not used earlier in connection with eye-movement studies, as far as we know. Another picture was a fragment of Albrecht Duerer's "View of the Val d'Arco". Strictly speaking, this picture can hardly be considered as ambiguous, because the alternatives interpretations are unequal: Almost all observers rst see a landscape with the castle and discover only after long delay the possibility to see the rock on the left side as the pro le of a human face. It was included nevertheless, because of the realism of this situation (which made this picture especially interesting for a transfer of the method to such domains, as medical imaging). The last picture was the product of our-own morphing of a woman's and a man's faces.
We also prepared two unambiguous versions of each picture. They are shown in Fig. 1 in the middle and in the right row.
All stimuli were presented on a high-resolution 17" colour monitor (ViewSonic 7) with a screen resolution of 640 480 pixels. The distance of observation was 60 cm. The pictures were about 480 pixels high and from 330 (Boring gure) to 620 (Duerer painting) pixels wide. At the beginning of every session two unambiguous and one ambiguous version of the Necker cube were shown. They were used to introduce the task. After the explana-
3
? !"#$%&'
()*+,-./01 23456789:; <=>?@ABCDE FGHIJKLMNO PQRSTUVWXY Z \]^_`abc defghijklm
? nopqrstuvw
xyz{|}~
Figure 1: The original pictures (left column) and their unambiguous variants for interpretations A and B (middle and right column, respectively)
4
tion all pictures were shown in such a way that two unambiguous versions of a picture always preceded the corresponding ambiguous version. The presentation time of every unambiguous version was 20 sec; the time of presentation of an ambiguous picture was 60 sec. Intervals between the variants of the same picture were 10 sec, intervals between di erent classes of pictures - 60 sec. This time of 60 sec also included the time of re-calibrating of the eye-tracker which took less than 10 sec. The order of presentation of all pictures was counterbalanced across the subjects.
The subjects received the special task of manual reporting their perception while viewing the ambiguous version of each picture, and therefore had to put their hand on a two-button computer mouse. The task was to push the button on the left as soon as they saw a certain interpretation of the picture interpretation A and keep it pressed as long as this state of perception lasted. When seeing the interpretation B they had to push the button on the right. The experimenter told the subjects about the corresponding buttons for each interpretation shortly before the next ambiguous picture was shown.
After the experiment we divided the xations which were recorded during the presentation of the ambiguous pictures according to the button response data in two sets, namely the xations belonging to the interpretations A and B, respectively. With additional data obtained during the presentation of the unambiguous variants, there were four di erent xation sets derived from every thematic class of pictures: The sets A and B from the two unambiguous variants and the sets A' and B' which were obtained after dividing the pool of xation data from observation of the ambiguous picture.
2.2 Results
All subjects were able to di erentiate the perceptual states of all the pictures without apparent di culties. The transitions from one perceptual state to another as manifested in manual responses of the subjects were almost instantaneous, i.e. with temporal gaps or overlaps of less than 500 msec, in about 90% of cases. The intermediate state "not one/not other" extended over less than 5% of the observation time of ambiguous pictures. The duration of perceiving a constant interpretation was found between 3 and 13 seconds varying signi cantly between subjects, but not between pictures. In the following analysis we used as a reference point the moment of a button pushing signifying the transmission into the corresponding perceptual state.
In the few cases with extensive history of previous investigation with the help of eyemovement recording, our results partially replicated previous data (Ellis & Stark, 1978; Gale & Findlay, 1983). Thus, the perception of the Necker cube was mostly connected with the saccades along its main diagonal. The change of a perceptual state correlated with a shift of the xations to another "core area" of the picture. However, we could not con rm the previous suggestion that these phenomenal changes coincide with longer, socalled "organizational xations" or other parameters of individual xations or saccades (cf. Ellis & Stark, 1978). Corresponding data for xation length as well as average size of pupil are shown in Fig. 2 and Fig. 3, respectively. The same lack of correspondence between parameters of separate xations and the instants of phenomenal changes was typical also in the case of all other pictures. In order to evaluate stability and possible speci city of eye-movement patterns to perceptual interpretation of pictures in a more objective way a measure of similarity s between two xation sets was used, which yields similarity values
in the interval 0; 1]. This is described in detail in appendix A.
5
800 700 600 500 tF (ms) 400 300 200 100
-04000 -3000 -2000 -1000 0 1000 2000 3000 4000 tC (ms)
Figure 2: Average duration tF of xations as a function of the time tC relative to changes of interpretations
3000
2500
2000
AP (pixel) 1500
1000
500
-04000 -3000 -2000 -1000 0 1000 2000 3000 4000 tC (ms)
Figure 3: Average the digital picture
pouf pthileseizyeeAcaPmaesraa)function
of
tC
(measured
as
the
number
of
pixels
in
6
Comparison Necker Cube Duerer Boring Escher Faces Arcimboldo
A vs. B
64.3 45.4 76.1 15.2 72.2 40.5
A' vs. B' 77.5 27.7 48.5 28.6 34.9 67.5
A vs. A'
61.4 78.6 87.7 72.0 78.2 66.1
B vs. B'
37.5 93.5 88.1 88.2 64.8 83.0
A vs. B'
59.7 39.8 51.4 24.3 48.2 29.9
B vs. A'
48.8 35.6 71.3 15.8 50.3 62.9
Table 1: Similarities of xation sets in %
The degree of similarity of xation data for both variants of perception of the same picture was computed and compared between themselves and with the corresponding parameters for every unambiguous variant of the pictures. The computation was performed for individual and group data. The similarity of individual data for identical pictures was in the interval between 76% and 95%. The results of the comparison of group data (i.e. cumulated xation data across subjects) are presented in Table 1.
For almost all pictures the computed similarity coe cients demonstrate systematic changes which become more prominent when visualized as gray values in matrices shown in Fig. 4. Each 4 4 matrix shows the subset of similarity coe cients pertaining to the 4 4 pairings of the four variants A, B, A', B' of each picture (these matrices are symmetric since the order in a pair is irrelevant, and the main diagonal represents the pairings of each pattern with itself, which is not relevant for our discussion). The brightness of each matrix element increases with the similarity coe cient of the corresponding comparison.
If there was no signi cant di erence between the "statically" (A, B) and "dynamically" (A', B') derived xation patterns, but between xation patterns for di erent interpretations, the comparisons A vs. A' and B vs. B' should demonstrate higher similarity than all others. Obviously, in this case the matrices would present checker-board . patterns And in fact, the checker-board patterns can be easily seen in every box, with the sole exception of the box with data of the Necker cube. They are exactly those which can be expected on the basis of hypothesis about speci city of xation distributions to the type of phenomenal interpretation of a picture.
The e ect of higher similarities of A vs. A' and B vs. B' on the whole data set can be visualized also by a cumulative plot (Fig. 5). Here, the similarity coe cients for each class of comparison are presented in ascending order.
The computing of similarity coe cients nally allowed to approach the classic problem about objective indices of the phenomenal changes and the temporal relationships between a change of phenomenal state and the moment of manual report. For all the subjects and all the pictures, the minimal values of the similarity coe cient for xation patterns A' and B' during a speci c perceptual interpretation of an ambiguous picture were achieved if one takes into account a certain "response time" of approximately 900 1000 ms. In order to investigate the subject's response time, we changed the way of deriving the xation
7
?
$-%.&/'0(1)2!*3?"+#,
Figure 4: The similarity matrices of the six pictures
100
2
80 60
2
2
2
2 3
3+2?
3+? 4
s (%) 40
20
4+ 3?
43+?
43+?
4+?
4
AAAABB'
vvvvvvssssss......
ABBBBB'''''
3+2 4?
00
1
2
3
4
5
6
7
Position
Figure 5: Cumulative plot of similarity values s for the six classes of comparisons
8
100
80
60
s (%)
40
20
NAecrkciemDrBEbFCuosocareuhlicrbdneeeogerrs
-04000 -3500 -3000 -2500 -2000 -1500 -1000 -500 0 500 1000
tS (ms)
Figure 6: Similarity s of A' and B' for individual pictures and di erent "time shifts" tS
sets A' and B' from showing the ambiguous picture. We added a constant "time shift" to every manual report of all subjects, pretending the reports happenend earlier (negative time shift) or later (positive time shift) than registrated. Now the similarity of the xation sets A' and B' for individual pictures was computed using di erent time shifts.
Fig. 6 shows the average similarity function of the xation patterns A' and B' as a function of the time shift used for the separation of the xations. The Necker cube values demonstrate no signi cant dependence from the underlying time shift, but the other pictures indicate a more or less distinct "U"-shape. If one takes as a temporal reference point the moment located about 900 ms before the subject's manual report, then the similarity functions reach their absolute minimum.
The empirical data on the xation patterns A' and B' that corresponded to the di erent perceptual interpretations of the same pictures were further used in Experiment 2 of the study.
3 Experiment 2: Visualization and transfer of subjective views of the pictures
The aim of this experiment was to attempt an objective reconstruction of di erent subjective views of the ambiguous pictures on the basis of the eye-movement data collected in Experiment 1.
9
3.1 Method
3.1.1 Subjects
150 subjects na?ve about the purpose participated in this study All of them were students of natural sciences and mathematics at University of Bielefeld.
3.1.2 Material and procedure
In order to process pictures in a gaze-dependent way, one should decide what the form of the visibility function connected with such xations is. Three lines of research can be of relevance for the answer of this question: "useful eld of view" and "useful resolution" studies (Ball, Beard, Roenker, Miller & Griggs, 1988; Mackworth, 1976; Shioiri & Ikeda, 1989), investigation of asymmetry in dynamic distribution of attention in dependence on the direction of eye movements in reading (Rayner, Well, Polatsek & Bertera, 1982) and experiments with images stabilized on the retina that demonstrate a kind of dissociation between anatomical and "functional" fovea (Zinchenko & Vergiles, 1972). Unfortunately, it is impossible to use these data directly, because all of them were obtained under rather speci cconditions.Thereforewe assumedthe relativelyrestrictedand conservativehypothesis that the average e cient eld of view coincides with the idealized anatomical fovea (Hood & Finkelstein, 1986). According to this working hypothesis the visibility function is a two-dimensional Gaussian distribution with the center at the registered xation point and the standard deviation of one degree of visual angle.
Our further hypothesis was that the visibility functions of individual xations can be collapsed without taking into account their temporal order. The aim of our image processing is to emphasize the regions of a picture which received the highest attention from the subject. There are many methods to achieve this, for example:
lowering of brightness, enhancing of brightness, reduction of contrast, reduction of optical resolution in the "valleys" of attentional landscapes, i.e. outside of the highs of the gaze-position clusters. More information about our image processing can be found in appendix B. In this experiment we only used the method "lowering of brightness". The processing was based on the corresponding xation sets A' and B', respectively, derived from showing the ambiguous pictures in Experiment 1. The resulting pictures are presented in Fig. 7. These 12 pictures were used together with 6 originals as material in Experiment 2. Subjects were individually presented with counterbalanced subsets of 6 pictures which included 2 originals and 4 processed pictures representing all di erent thematic classes of pictures used in current study one and only one time. Subjects were asked to describe the content of the pictures. The descriptions were then subjected to a blind forced choice evaluation, so that a consistent " rst sight interpretation" for every stimulus and every subject was agreed between three experts.
10
?
#*18?FMTbi$+29@GNU\cj%,3:AHOV]dk&-4;BIPW^el'.5<CJQX_fm!(/6=DKRY`gn")07>ELSZaho
Figure 7: The "highlighted" pictures for each interpretation
11
Necker Cube Duerer Boring Escher Faces Arcimboldo
IA(O)
39
IA(A)
37
IA(B)
38
49 23 41 11 38
50 15 44 39 50
23 7 11 4
8
IB(O)
11
IB(A)
13
IB(B)
12
1 27 9 39
12
0 35 6 11
0
27 43 39 46
42
Table 2: Results of Experiment 2
3.2 Results
The results of this experiment are summarized in Table 2. The value of IA(O), e.g., tells us
how many of the subjects came to interpretation A when the original picture was shown
to them. Due to the fact that the decision always was either for A or B, the equation
IA(x) + IB(x) = 50 is true for each of the 18 presented pictures. Statistical analysis of
the data was performed with the help of a one-sided four elds 2 test (Lienert, 1973).
The analysis demonstrates that the processing of initial pictures in terms of distribution
of xations had a signi cant and predicted in uence on their further perception, although
this in uence was not documented in all cases. In particular, both variants of processing
(i.e. in the direction of the interpretations A or B) had no in uence on the perception of
the Necker cube (uA = 0:58, p > 0:05; uB = 0:23, p > 0:05). In the case of the Boring
gure the e ect was only signi cant for the enhancing of the interpretation "old woman"
(uB = woman
3:49, p rather
< 0; 001). Paradoxically, the diminished the frequency of
processing towards perception of the young this interpretation (uA = 1:65). In all other
cases, the e ect of transfer of perceptual experience was fairly strong. When the base-line
frequency was initially shifted towards one of the interpretations an appropriate processing
either made the hidden version obvious or, at least in a tendency, additionally enhanced
the dominating version of perception: Duerer's painting (uA = 1:43, :0 05 < p < 0:10; uB = 5:51, p < 0:001), Escher (uA = 1:11, :0 05 < p < 0:10; uB = 5:80, p < 0:001). For
the remaining p < 0:001; uB
two pictures the results = 1:96, p < 0:05) and
were even more homogeneous: Arcimboldo (uA = 3:87, p <
Faces 0:001;
(uuBA
= =
5:61, 5:81,
p < 0:001).
4 Discussion
The present study brought about some old as well as some new results. In the line with earlier work we were able to testify in Experiment 1 that in the case of several pictures allowing more than one interpretation there are speci c "focal areas" whose xation correlates with speci c perceptual interpretations (Gale & Findlay, 1983). In addition, we have demonstrated that a general change in distribution of gaze position patterns, as evalu-
12
ated with the help of a new wholistic measure of similarity, usually preceded the manual response about the change of phenomenal perception by a time of about 900 ms. For experiments on perceptual identi cation (see e.g. Posner, 1978) this is a reasonably long reaction time to suppose that the manual report indeed is a reaction on the phenomenal changes. The result in general corresponds to the introspective observation that phenomenal changes, while being expected, often slightly astonished observers. The phenomenal changes themselves, of course, can coincide, precede or perhaps follow the changes in eye movements. In contrast with one previous report, characteristics of separate saccades or xations (as well as uctuations of the pupil size) were insu cient for a di erentiation of alternative perceptual interpretations of pictures from our set (cf. Ellis & Stark, 1978).
In Experiment 2 we attempted to use the data about eye xation patterns of ambiguous pictures for the visualization of actual perception. This processing was done in such a way that the regions of the pictures which attracted the gaze xations during speci c interpretations were highlighted. In the present study this processing was based on the simplest assumption about the form and size of visibility function whereby we equated the parameters of the "functional fovea" with the idealized anatomical fovea, i.e. the Gaussian function with the standard deviation of one degree of visual angle. Despite this oversimpli cation the experiment was basically successful: In four out of six pictures we found a clear transfer e ect of such a processing on the perceptual interpretation of na?ve subjects. All the pictures that demonstrated this transfer were relatively complex, colorful stimuli with several levels of contrast.
From these data it seems to follow that both line drawings in our set the Necker cube and the Boring gure have a special status. Although exactly these gures were considered earlier from the perspective of their dependence on the eye movement based ltering of spatial frequencies (Garcia-Perez, 1992), the rather similar transformation used in the present study did not lead to the expected control of phenomenal experience. What are possible reasons for such a failure?
In the case of the Necker cube, for instance, there seems to be a built-in deceit: The very shift of the focus of attention to the "focal area" of an alternative interpretation creates a higher probability of reversal in the opposite direction. Indeed, in the middle of both "focal areas" one nds a vertex which has to be perceived as a component of the back(ground) plane of the corresponding 3D-interpretation. The xation of the vertex can however provide it with a gure status and therefore provoke the reversal of the whole con guration. In the Boring gure there was an unexpected shift of initially more or less evenly distributed probabilities of both interpretations to one of them as a result of the image processing. The shading-out of the surrounding information obviously limits the possibility to see a young woman. This is the perceptual interpretation which is mostly conveyed by global information about the posture of the body as a whole and not so much by details like eye or mouth. An additional reason for the relative failure of our procedure in the case of black-and-white line-drawings may lay in the fact that the introduced modulation of brightness was too weak to be integrated into the main graphical elements of such pictures.
This study is only a rst attempt of elicitation of perceptual experience on the basis of eye movement data. Several additional problems should be solved before the outlined approach could become a more reliable method. First of all, the shape of the visibility function has to be considered anew with the possibility that it can vary depending on objective and subjective factors. The second in the list is the problem of temporal char-
13
acteristics of processing to what extent can the temporal order information be ignored in such studies (cf. Hacisalihzade, Stark & Allen, 1992) and what is the possible window size of accumulation of xations to the "attention landscapes"? Another problem to be solved is an adjustment of our processing algorithms to the spatial frequency characteristics of pictures and to the corresponding perceptual attitudes of observers, e.g. as it would be necessary in the case of the Boring gure (for an investigation of related issues, see Caelli, 1988). A combination of our approach with methods of visual scene parsing and depth planes analysis from computer vision research (Ballard & Brown, 1982) could also be fruitful. Finally, one should of course be aware that not every xation is " lled with attention", so states of "empty gaze" have to be di erentiated. It seems that this problem could be solved on the basis of an analysis of eye movements themselves. However, the possible key to the solution may be situated in a slightly di erent domain, namely in the domain of micro eye movements (Gippenreiter & Romanov, 1972).
Non-verbal visual expertise plays an important role in everyday life, technology and medicine (see e.g. Norman, Coblentz, Brooks & Babcook, 1992; Velichkovsky, Pomplun & Rieser, 1995). The demonstrated fact that it is possible to convey to other persons a speci c perceptual interpretation made by other people even in the case of relatively complex pictures gives grounds to believe in an applied signi cance of the gaze-dependent processing approach. Being well aware of shortcomings of the present study, we believe that future methods which like ours unite traditional perceptual research with contemporary image processing possibilities will support a more subject-oriented phase in the development of information and communication technologies. This will in turn open the way to communication of not only declarative knowledge but also practical expertise.
Acknowledgements. We wish to thank Larry Stark, Vladimir Zinchenko, and last not
least Richard Gregory for discussing the results of this study and for encouraging us to present them to PERCEPTION. Two anonymous reviewers helped us in improving the nal version of the text. Thomas Clermont and Peter Munsche participated in supervision and running the experiments. Our special thanks are due to Eyal Reingold and Dave Stampe for the development of the eye-tracker used in our experiments. This study was supported by a grant from the German Science Foundation (DFG SFB 360/B4).
14
dAipstpreibnudtixioAns: oAf sixmaitliaornitsy measure for the comparison of
In order to derive a similarity measure for two xation patterns which depends on the
holistic distribution of attention and not on separate eye movements, we rst subdivided
the monitor screen which were located
iinnttohnexsqnuyarseqnu,ahreasd.
Then to be
cthalecsuulamtesdnfoorf
total duration each squaren,
nof=x1a:t:io: n(nsx2nFy)0.,
We obtained distribution vector ~v0 consisting of the values sn and therefore having nx ny
dimensions. Our hope was that this vector contained su cient information about how
much attention or at least dwell time was spent in each of the squares.
~v1
To and
compute the similarity ~v2, respectively, had to
of two xation be determined
sets F1 and F2, rst the distribution vectors in the way described above. Then the cosine
of the angle between these two vectors was calculated according to the following simple
equation:
cos
=
~v1 ~vj 1j
~v2 ~vj 2j
The value of cos was taken as the similarity measure. In fact, it has several important
features. It yields similarity values in the interval 0; 1], since both ~v1 and ~v2 have only
nonnegative components. It does not take into account the number of xations, but only
their distribution over the screen. In addition, it can be easily weighted or corrected for
duration of xations.
Nevertheless,thismeasurestillhas an unpleasantproperty:Its valuesdependon the size
and position of the squares on the picture. This dependency on position could be nearly
removed by calculating similarity coe cients for di erent x- and y-o sets of the whole
square grid and by taking the average similarity as the result. We used 10 equidistant
x-o sets, which were chosen in order to allow a maximum global shift of the length of one
square's side. These x-o sets were combined with 10 analogous y-o sets, so there have to
be computed 100 "elementary" similarities on the whole to derive the position-invariant
measure.
And how can we avoid the dependency on the square's size? Fig. 8 illustrates the
functional relationship between square size (or "granularity") and calculated similarity
coe cients for di erent xation patterns. As an example the data for the Boring and
the Arcimboldo picture are displayed. The Boring picture causes di erences between the
xation sets A' and B' on a small scale, the Arcimboldo picture on a large scale. This
fact will be discussed later in the text; at this point these sets should be considered as
"technical" examples.
Obviously all similarity values generally increase with the underlying square's size. This
fact can easily be explained by two extreme cases: If we used a square size of only one
pixel, the similarity would be very low, because only very few xations would be located
in corresponding squares. On the other hand, if we used squares as large as the screen, the
similarity value would always be 100%, because all xations would lay in the same (single)
square. Fig. 8 demonstrates another two important facts: First, the order of similarities
remains invariant for the four xation patterns with respect to granularity, at least for
the investigated range from 5 to 300 pixels. This con rms the stability of our measure.
Second, the maximum di erence between similarities A vs. A' and A' vs. B' varies with
the pictures. The Boring picture causes a maximum di erence at a granularity of about
25 pixels (small scale), the Arcimboldo picture at about 60 pixels (large scale). To derive
15
100
80
60 s (%)
40 20
AArrcciimmBBbboooorrililndndgogo AAAA vvvvssss AABB''
0 0 20 40 60 80 100 120 140
granularity of measure (pixels)
Figure 8: Similarity of speci c xation sets as a function of the granularity used for the similarity measure
a "fair" measure we decided to use the average similarity coe cient for comparison on 25, 40, and 64 pixel granularity, which is a geometric series in the relevant range. The use of smaller squares is not sensible, since the human foveal vision has a certain extent and, in addition, the eye-tracker accuracy itself is limited (see Pomplun, Velichkovsky & Ritter, 1994). Larger squares are not capable to improve the measure, because no further important information can be found on the scale of the presented pictures. Our de nite similarity measure now uses 300 elementary distribution vector comparisons. It has all desired properties and its stability was proved in various tests.
16
!2<1;0:/!(32<1;0!()432<1!()+5432()+,6543)+,-7654+,-.8765,-./9876-./0:987./01;:98 Figure 9: The original picture
Aprpopceenssdiinxg B: Methods of gaze-dependent image
The important precondition for the gaze-contingent image processing is a continuous "attention function" a(x; y) which is de ned all over the picture and is built on the basis of the recorded xations. In order to nd a suitable function we de ne a two-dimensional Gaussian distribution centered at the current xation point, where the standard deviation is one degree of visual angle. Then we simply sum up these Gaussian distributions for all recorded xations weighted for their durations to receive the desired function a(x; y).
In order to illustrate the procedure, let us consider a test picture (Fig. 9). Its accumulative "attentional landscape" is shown in Fig. 10. This form of representation is derived from empirical xations, and the peaks of this function corresponding to the eyes and the mouth in the woman's picture are signi cant.
The gaze-contingent processing can be realized in several di erent ways, depending on the chosen type of image processing function fP : A O ! P which combines the attentional landscape A and the original picture O to the resulting picture P. The e ect of four di erent functions is illustrated in Fig. 11 to 14, where the gaze-contingent processing of a prototype picture was coupled with (a) lowering of brightness, (b) enhancing of brightness, (c) reduction of contrast, or (d) reduction of optical resolution in regions with lower values of attentional landscape. The last of these possibilities was already considered as a prospective method of disambiguation of ambiguous pictures, however, without considering eye movements (see Shiori & Ikeda, 1989).
Many di erent combinations of these procedures are easily realizable either beetween themselves or with di erent modes of processing. For the present study we used the
17
?
!"#$%&'
Figure 10: "Attentional landscape" distributed over the monitor screen as obtained from a subject watching the picture shown in Fig. 9
rst of the described procedures: The brightness outside of attended regions was reduced
according to the following transformational equation (1), which is applied on every pixel
(x,y) of the picture:
~pxy = xy ~oxy
(1)
Here, ~pxy and ~oxy are the RGB-vectors (i.e. the red, , green and blue component of a colour) of pixel (x,y) in the processed and the original picture, respectively. The transformation factors xy can be calculated by equation (2):
xy
=
m
+
(1
?
m)
a(x; y)
amax
;
(2)
where a(x; y) is the value of "attentional landscape" for pixel (x,y), amax is the maximal
value in the whole picture, and m is a constant which determines the minimum brightness remaining in the processed picture. If m, e.g., is set to 0.1, the regions of the picture with
attention value 0 will keep 10% of their initial brightness, if m = 1 the picture will not change at all. In this experiment we always set m = 0:1.
18
!2<1;0:/!(32<1;0!()432<1!()+5432()+,6543)+,-7654+,-.8765,-./9876-./0:987./01;:98
Figure 11: After a partial decrease of brightness one of the face regions seems to be "highlighted" (variant a).
!2<1;0:/!(32<1;0!()432<1!()+5432()+,6543)+,-7654+,-.8765,-./9876-./0:987./01;:98
Figure 12: The less inspected areas seem to disappear behind a veil of mist after enhancing brightness (variant b).
19
!2<1;0:/!(32<1;0!()432<1!()+5432()+,6543)+,-7654+,-.8765,-./9876-./0:987./01;:98
Figure 13: The di erences in colour decrease in the peripheral regions after reducing contrast (variant c).
0:/!2<1;!1;0(32<!(2<1)43!()32+54()+43,65)+,54-76+,-65.87,-.76/98-./870:9./0981;:
Figure 14: The areas of lower attention are blurred, so the Figure looks like a camera picture focussing the woman's face (variant d).
20
Appendix C: The picture series
C.1 The Necker cube series
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
CUBE1.GIF
21
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
CUBE2.GIF
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
CUBE3.GIF
22
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
CUBE4.GIF
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
CUBE5.GIF
23
C.2 The Duerer series
!2<1;0:!(32<1;!()432<!()+543()+,654)+,-765+,-.876,-./987-./0:98./01;:9
DUERER1.GIF
24
!2<1;0:!(32<1;!()432<!()+543()+,654)+,-765+,-.876,-./987-./0:98./01;:9
DUERER2.GIF
!2<1;0:!(32<1;!()432<!()+543()+,654)+,-765+,-.876,-./987-./0:98./01;:9
DUERER3.GIF
25
!2<1;0:!(32<1;!()432<!()+543()+,654)+,-765+,-.876,-./987-./0:98./01;:9
DUERER4.GIF
!2<1;0:!(32<1;!()432<!()+543()+,654)+,-765+,-.876,-./987-./0:98./01;:9
DUERER5.GIF
26
C.3 The Boring series
!-27<,1!(.38-2()/49.3)+05:/4+,16;05
BORING1.GIF
27
!-27<,1!(.38-2()/49.3)+05:/4+,16;05
BORING2.GIF
!-27<,1!(.38-2()/49.3)+05:/4+,16;05
BORING3.GIF
28
!-27<,1!(.38-2()/49.3)+05:/4+,16;05
BORING4.GIF
!-27<,1!(.38-2()/49.3)+05:/4+,16;05
BORING5.GIF
29
C.4 The Escher series
+3;.!08,4</(19!-50)2:(.61+3;)/72,4<!+083-5(,194.6)-2:5/7
ESCHER1.GIF
30
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
ESCHER2.GIF
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
ESCHER3.GIF
31
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
ESCHER4.GIF
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5
ESCHER5.GIF
32
C.5 The faces series
+3;!08.,4<(19/!-5)2:0(+3;.61),4</72!+-5083(,.6194)-/72:5 FACES1.GIF
33
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5 FACES2.GIF
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5 FACES3.GIF
34
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5 FACES4.GIF
!08+3;.(19,4</!)2:-50(+3;.61),4</72!+-5083(,.6194)-/72:5 FACES5.GIF
35
C.6 The Arcimboldo series
+3;!08.6,4<(19/7!-5)2:08(+3;.619),4</72:!+-5083;(,.6194<!)-/72:5 ARCIMB1.GIF
36
!08+3;.6(19,4</7!)2:-508(+3;.619),4</72:!+-5083;(,.6194<!)-/72:5 ARCIMB2.GIF
!08+3;.6(19,4</7!)2:-508(+3;.619),4</72:!+-5083;(,.6194<!)-/72:5 ARCIMB3.GIF
37
!08+3;.6(19,4</7!)2:-508(+3;.619),4</72:!+-5083;(,.6194<!)-/72:5 ARCIMB4.GIF
!08+3;.6(19,4</7!)2:-508(+3;.619),4</72:!+-5083;(,.6194<!)-/72:5 ARCIMB5.GIF
38
References
Ball K K, Beard B L, Roenker D L, Miller R L, Griggs D S, 1988 "Age and visual search: Expanding the useful eld of view" Journal of the Optical Society of America A, 5 2210 2219 Ballard D, Brown C, 1982 Computer vision (Engliwood-Cli s: Prentice Hall) Boring E G, 1942 Sensation and perception in the history of experimental psychology (New York: Irvington) Caelli T M, 1988 "An adaptive computational model for texture segmentation " IEEE Transactions on Systems, Man, and Cybernetics 18 9 17 Chapman J (Ed), 1987 The Arcimboldo E ect: Transformation of the face from the sixteenth to twentieth century (Milano: Fratelli Fabri Editori) Cooper L, 1994 "Mental representation of visual objects and events" in International perspectives on psychological science: The state of the art Eds G d'Ydewalle, P Eelen & P Bertelson (Hove, UK/Hillsdale, NJ: Lawrence Erlbaum Associates) Ellis S R, Stark L, 1978 "Eye movements during the viewing of Necker cubes" Perception, 7 575 581 Gale A G, Findlay J M, 1983 "Eye movement patterns in viewing ambiguous gures" in Eye movements and psychological functions: International views Eds R Groner, C Menz, D F Fisher & R A Monty (Hillsdale, NJ: Lawrence Erlbaum Associates) Garcia-Perez M A, 1992 "Eye movements and perceptual multistability" in The role of eye movements in perceptual processes Eds E Chekaluk & K R Llowellyn (Amsterdam: North Holland) Gippenreiter Yu B, Romanov V Ya, 1972 "A method of investigation of the internal form of visual activity" in R MacLeod and H L Pick, Jr, 1974 Perception: Essays in honor of James J Gibson (Ithaca: Cornell University Press) Gombrich E H, 1969 Art and illusion: A study in the psychology of pictorial representation 2nd ed (Princeton, NJ: Princeton University Press) Hacisalihzade S S, Stark L W, Allen J S, 1992 "Visual perception and sequences of eye movement xations" IEEE Transactions on Systems, Man, and Cybernetics 22 474 481 Hood D C, Finkelstein M A, 1986 "Sensitivity to light" in Handbook of perception and human performance, Vol 1: Sensory processes and perception Eds K R Bo , L Kaufman, J P Thomas (New York: John Wiley and Sons)
39
Lee S W, Bajcsy R, 1992 "Detection of specularity using color and multiple views" Image and Vision Computing 10 643 653 Lienert G, 1973 Verteilungsfreie Methoden in der Biostatistik 2 Au age, Bd 1 (Meisenheim/Glan: Verlag Anton Hain) Mackworth N H, 1976 "Stimulus density limits the useful eld of view" in Eye movements and psychological processes Eds R A Monty, J W Senders (New York: John Wiley and Sons) Nodine C F, Kungel H L, Toto L C, Krupinsky E A, 1992 "Recording and analysing eye-position data using a microcomputer workstation" Behavioral Research Methods, Instruments, and Computers 24 475 485 Norman G R, Coblentz C L, Brooks L R, Babcook C J, 1992 "Expertise in visual diagnostics: A review of the literature" Academic Medicine Rime Supplement 67 78 83 Noton D, Stark L W, 1971 "Scanpaths in eye movements during pattern perception" Science 171 308 311 Pillalamari R S, Barnette B D, Birkmire D, 1993 "Cluster: A program for the identi cation of eye- xation-cluster characteristics" Behavioral Research Methods, Instruments, and Computers 25 9 15 Pomplun M, Velichkovsky B M, Ritter H, 1994 "An arti cial neural network for high precision eye movement tracking" in Lecture notes in arti cial intelligence: AI-94 Proceedings Eds B Nebel & L Dreschler-Fischer (Berlin: Springer Verlag) Posner M, 1978 Chronometric exploration of mind (Hillsdale, NJ: Lawrence Erlbaum Associates) Rayner K, Well A D, Polatsek A, Bertera J H, 1982 "The availability of useful information to the right of xation in reading" Perception and Psychophysics 31 537 550 Ritter H, Martinetz T, Schulten K, 1992 Neural computation and self-organizing maps (Reading, MA: Addison-Wesley) Rock I, Hall S, Davis J, 1994 "Why do ambiguous gures reverse?" Acta Psychologica 87 33 59 Stampe D M, 1993 "Heuristic ltering and reliable calibration methods for video-based pupil-tracking systems" Behavioral Research Methods, Instruments, and Computers 25 137 142 Stampe D M, Reingold E, 1993 "Eye movement as a response modality in psychological research" in Proceedings of the Seventh European Conference on Eye Movements, Durham University of Durham, 31st of August 3rd of September
40
Velichkovsky B M, 1995 "Communicating attention: Gaze-position transfer in cooperative problem solving" Pragmatics and Cognition 3(2), 199 222. Velichkovsky B M, Luria A R, Zinchenko V P, 1973 Psychology of perception (Moscow: Moscow University Press in Russian]) Velichkovsky B M, Pomplun M, Rieser J, 1995 in press "Attention and Communication: Eye-Movement-Based Research Paradigms" Visual Attention and Cognition Eds W H Zangemeister, H S Stiehl & C Freksa (Amsterdam: Elsevier Science Publishers) Vicholkovska A, 1906 "Illusion of reversible perspective" Psychological Review 13 276 290 Yarbus A, 1967 Eye movements and vision (New York: Plenum Press) Zinchenko V P, Vergiles N Yu, 1972 Formation of visual image: Studies of stabilized retinal images (New York: Plenum Press)
View publication stats
41

View File

@@ -0,0 +1,11 @@
Producer: ESP Ghostscript 815.02
CreationDate: 11/07/07 09:49:41
ModDate: 11/07/07 09:49:41
Tagged: no
Form: none
Pages: 42
Encrypted: no
Page size: 612 x 792 pts (letter) (rotated 0 degrees)
File size: 2896995 bytes
Optimized: no
PDF version: 1.3

View File

@@ -12,7 +12,7 @@
<category citation-format="author-date"/>
<category field="generic-base"/>
<summary>Harvard according to Cite Them Right, 11th edition.</summary>
<updated>2025-08-26T05:39:18+00:00</updated>
<updated>2025-10-29T11:57:22+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<locale xml:lang="en-GB">
@@ -67,7 +67,7 @@
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="article-newspaper article-magazine" match="any">
<if type="article-newspaper article-magazine article-journal" match="any">
<text variable="container-title" text-case="title" font-style="italic"/>
</if>
<else>
@@ -85,7 +85,7 @@
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="article-newspaper article-magazine" match="any">
<if type="article-newspaper article-magazine article-journal" match="any">
<text variable="container-title" text-case="title" font-style="italic"/>
</if>
<else>

View File

@@ -23,7 +23,7 @@
<category field="humanities"/>
<category field="literature"/>
<summary>MLA source citations, in-text citations system (chapter 6)</summary>
<updated>2025-08-27T19:32:57+00:00</updated>
<updated>2025-10-31T16:04:52+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<locale xml:lang="en">
@@ -83,9 +83,7 @@
4.6. Publication Date (MLA 5.68-83)
4.7. Location (MLA 5.84-99)
5. Supplemental Element Between Containers (MLA 5.119)
6. Container 2
6.1. Title of Container (MLA 5.31-37)
6.2. Location (MLA 5.84-99)
6. Container 2 (MLA 5.102)
7. Supplemental Element at End of Entry (MLA 5.110-118)
7.1. Date of access (MLA 5.111)
7.2. Medium of publication (MLA 5.112)
@@ -249,12 +247,9 @@
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="software">
<text variable="publisher"/>
</if>
<else-if type="standard">
<if type="standard">
<text variable="authority"/>
</else-if>
</if>
</choose>
<text macro="title"/>
</substitute>
@@ -271,12 +266,9 @@
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="software">
<text variable="publisher"/>
</if>
<else-if type="standard">
<if type="standard">
<text variable="authority"/>
</else-if>
</if>
</choose>
<text macro="title-short"/>
</substitute>
@@ -491,7 +483,7 @@
<choose>
<if type="personal_communication">
<!-- date and place of composition for letters -->
<text macro="event"/>
<text macro="container1-location-event"/>
</if>
<else-if match="any" variable="original-publisher original-publisher-place"/>
<else-if is-uncertain-date="original-date">
@@ -861,7 +853,10 @@
<else>
<choose>
<if is-uncertain-date="issued">
<date form="text" prefix="[" suffix="?]" variable="issued"/>
<group delimiter=" ">
<text term="circa" text-case="capitalize-first"/>
<date form="text" variable="issued"/>
</group>
</if>
<else>
<date form="text" variable="issued"/>
@@ -872,15 +867,74 @@
</macro>
<!-- 4.7. Location (MLA 5.84-99) -->
<macro name="container1-location">
<!-- location of a physical object or event (MLA 5.99) -->
<group delimiter=", ">
<choose>
<!-- serials cannot be part of an event -->
<if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book"/>
<!-- `event-date` supplies date of composition for letters, handled in `supplemental-original-date` -->
<else-if type="personal_communication"/>
<else-if type="paper-conference">
<choose>
<if match="none" variable="collection-editor compiler editor editorial-director issue page volume">
<!-- Don't print event info for conference papers published in a proceedings volume -->
<text macro="container1-location-event"/>
</if>
</choose>
</else-if>
<else>
<!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->
<text macro="container1-location-event"/>
</else>
</choose>
<text variable="archive"/>
<text variable="archive-place"/>
<text variable="archive_collection"/>
<text variable="archive_location"/>
<text macro="label-page"/>
<choose>
<if match="none" variable="source">
<text macro="URI"/>
<text macro="container1-location-URI"/>
</if>
</choose>
</group>
</macro>
<macro name="container1-location-event">
<group delimiter=", ">
<choose>
<if match="any" variable="event event-date event-title">
<!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->
<choose>
<if variable="event-title">
<text text-case="capitalize-first" variable="event-title"/>
</if>
<else>
<text text-case="capitalize-first" variable="event"/>
</else>
</choose>
<choose>
<if is-uncertain-date="issued">
<date form="text" prefix="[" suffix="?]" variable="event-date"/>
</if>
<else>
<date form="text" variable="event-date"/>
</else>
</choose>
<text variable="event-place"/>
</if>
</choose>
</group>
</macro>
<macro name="container1-location-URI">
<choose>
<if variable="DOI">
<text prefix="https://doi.org/" variable="DOI"/>
</if>
<else>
<text variable="URL"/>
</else>
</choose>
</macro>
<!-- 5. Supplemental Element Between Containers (MLA 5.119) -->
<macro name="supplemental-element-between">
<choose>
@@ -889,84 +943,19 @@
</if>
</choose>
</macro>
<!-- 6. Container 2 -->
<!-- 6. Container 2 (MLA 5.102) -->
<macro name="container2">
<group delimiter=", ">
<text macro="container2-title"/>
<text macro="container2-location"/>
</group>
</macro>
<!-- 6.1. Title of Container (MLA 5.31-37) -->
<macro name="container2-title">
<group delimiter=", ">
<!-- Title of Container -->
<text font-style="italic" variable="source"/>
<!-- Location -->
<choose>
<if type="personal_communication"/>
<!-- `event-date` supplies date of composition for letters, handled in `supplemental-original-date` -->
<else-if type="paper-conference">
<choose>
<if match="none" variable="collection-editor compiler editor editorial-director issue page volume">
<!-- Don't print event info for conference papers published in a proceedings -->
<text macro="event"/>
</if>
</choose>
</else-if>
<else>
<!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->
<text macro="event"/>
</else>
<if variable="source">
<text macro="container1-location-URI"/>
</if>
</choose>
<text variable="archive"/>
<text variable="archive-place"/>
<text variable="archive_collection"/>
<text variable="archive_location"/>
</group>
</macro>
<macro name="event">
<choose>
<if match="any" variable="event event-date event-title">
<choose>
<!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->
<if variable="event-title">
<text text-case="capitalize-first" variable="event-title"/>
</if>
<else>
<text text-case="capitalize-first" variable="event"/>
</else>
</choose>
<choose>
<if is-uncertain-date="issued">
<date form="text" prefix="[" suffix="?]" variable="event-date"/>
</if>
<else>
<date form="text" variable="event-date"/>
</else>
</choose>
<text variable="event-place"/>
</if>
</choose>
</macro>
<!-- 6.2. Location (MLA 5.84-99) -->
<macro name="container2-location">
<choose>
<if match="none" variable="source"/>
<else-if match="any" variable="DOI URL">
<group delimiter=", ">
<text font-style="italic" variable="source"/>
<text macro="URI"/>
</group>
</else-if>
</choose>
</macro>
<macro name="URI">
<choose>
<if variable="DOI">
<text prefix="https://doi.org/" variable="DOI"/>
</if>
<else>
<text variable="URL"/>
</else>
</choose>
</macro>
<!-- 7. Supplemental Element at End of Entry (MLA 5.110-118) -->
<macro name="supplemental-element-end">
<group delimiter=", ">

View File

@@ -0,0 +1,382 @@
{
"translatorID": "1a31e4c5-22ed-4b5b-a75f-55476db29a44",
"translatorType": 4,
"label": "Anarchist Library",
"creator": "Sister Baæ'l",
"target": "https://theanarchistlibrary\\.org/(latest|library|stats/popular|category/topic|category/author|special/index|search)",
"minVersion": "7.0",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2025-10-28 20:10:00"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2025 Dandelion Good and the righteous Anti Toil Theologians at Iliff
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
/*
***** BEGIN ATTRIBUTION BLOCK *****
This translator was developed by Dandelion Good.
If you do any work on this translator, please add yourself here <3.
*/
var allAttachmentTypes = {
"Plain PDF": { ext: ".pdf", mimeType: "application/pdf" },
"A4 PDF": { ext: ".a4.pdf", mimeType: "application/pdf" },
"Letter PDF": { ext: ".lt.pdf", mimeType: "application/pdf" },
EPub: { ext: ".epub", mimeType: "application/epub+zip" },
"Printer-friendly HTML": { ext: ".html", mimeType: "text/html" },
LaTeX: { ext: ".tex", mimeType: "application/x-tex" },
"Plain Text": { ext: ".muse", mimeType: "text/plain" },
"Source Zip:": { ext: ".zip", mimeType: "application/zip" },
Snapshot: { ext: "snapshot", mimeType: "text/html" }
};
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = doc.querySelectorAll("a.list-group-item");
for (let row of rows) {
let href = row.href;
let title = ZU.trimInternal(text(row, "strong"));
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
items[href] = title;
}
return found ? items : false;
}
async function scrape(doc, url = doc.location.href) {
// ToDo: get fancier here, allow other types
let item = new Zotero.Item('manuscript');
// These may be expanded on in the future
let attachmentTypes = {
PDF: allAttachmentTypes["Plain PDF"],
};
item.url = url;
item.language = attr(doc, "html", "lang");
let itemType = attr(doc, '[property~="og:type"]', 'content');
let tagNodeList = doc.querySelectorAll(`[property~="og:${itemType}:tag"]`);
let description = attr(doc, '[property~="og:description"]', 'content');
let author = attr(doc, `[property~="og:${itemType}:author"]`, 'content');
item.creators.push(ZU.cleanAuthor(author, "author"));
if (description) {
item.description = description;
// misses https://theanarchistlibrary.org/library/leo-tolstoy-the-complete-works-of-count-tolstoy-volume-12
let re = /(?<=[Tt]ranslated(?: +to [Ee]nglish)? +by ).*$/u;
let translatedMatch = description.match(re);
if (translatedMatch) {
item.creators.push(ZU.cleanAuthor(translatedMatch[0], "translator", translatedMatch[0].includes(",")));
}
}
let date = getPreambleVal(doc, "textdate");
let notes = getPreambleVal(doc, "preamblenotes");
// misses link here: https://theanarchistlibrary.org/library/margaret-killjoy-it-s-time-to-build-resilient-communities
let source = getPreambleVal(doc, "preamblesrc");
for (let tagNode of tagNodeList) {
item.tags.push({ tag: tagNode.content });
}
let title = attr(doc.head, '[property~="og:title"][content]', 'content');
item.title = title;
item.date = date;
if (notes) {
item.notes.push({ note: ZU.trimInternal(notes) });
}
if (source) {
item.notes.push({ note: `Source: ${ZU.trimInternal(source)}` });
}
for (let [typeName, typeInfo] of Object.entries(attachmentTypes)) {
let attachment = {
title: typeName,
url: `${doc.location.href}${typeInfo.ext}`,
mimeType: typeInfo.mimeType
};
if (typeInfo.ext == "snapshot") {
attachment.document = doc;
}
item.attachments.push(attachment);
}
item.complete();
}
var libraryRe = /library\//;
function detectWeb(doc, url) {
if (libraryRe.test(url)) {
return 'manuscript';
}
else if (getSearchResults(doc, true)) {
return 'multiple';
}
return false;
}
function getPreambleVal(doc, id) {
let preamble = doc.body.querySelector("div#preamble");
return text(preamble, `div#${id}`).slice(text(preamble, `span#${id}-label`).length);
}
async function doWeb(doc, url) {
if (detectWeb(doc, url) == 'multiple') {
let items = await Zotero.selectItems(getSearchResults(doc, false));
if (!items) return;
for (let url of Object.keys(items)) {
await scrape(await requestDocument(url));
}
}
else {
await scrape(doc, url);
}
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://theanarchistlibrary.org/library/abel-paz-durruti-in-the-spanish-revolution",
"items": [
{
"itemType": "manuscript",
"title": "Durruti in the Spanish Revolution",
"creators": [
{
"creatorType": "author",
"firstName": "Abel",
"lastName": "Paz"
},
{
"creatorType": "translator",
"firstName": "Chuck",
"lastName": "Morse"
}
],
"date": "1996",
"url": "https://theanarchistlibrary.org/library/abel-paz-durruti-in-the-spanish-revolution",
"language": "en",
"attachments": [
{
"title": "PDF",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "Buenaventura Durruti"
},
{
"tag": "Spanish Revolution"
},
{
"tag": "biography"
}
],
"notes": [
{
"note": "Translated to English by Chuck Morse"
},
{
"note": "Source: Published by AK Press in 2006 (please support the publisher!). Retrieved on 19th September 2020 from https://libcom.org/library/durruti-spanish-revolution"
}
],
"seeAlso": [],
"libraryCatalog": "Anarchist Library"
}
]
},
{
"type": "web",
"url": "https://theanarchistlibrary.org/library/errico-malatesta-the-general-strike-and-the-insurrection-in-italy",
"items": [
{
"itemType": "manuscript",
"title": "The General Strike and the Insurrection in Italy",
"creators": [
{
"creatorType": "author",
"firstName": "Errico",
"lastName": "Malatesta"
}
],
"date": "1914",
"language": "en",
"url": "https://theanarchistlibrary.org/library/errico-malatesta-the-general-strike-and-the-insurrection-in-italy",
"libraryCatalog": "Anarchist Library",
"attachments": [
{
"title": "PDF",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "General Strike"
},
{
"tag": "Italy"
},
{
"tag": "history"
},
{
"tag": "insurrection"
}
],
"notes": [
{
"note": "Freedom (London) 28, no. 303 (July 1914). In the article, written shortly after his escape from Italy and return to London, Malatesta provides an account of the Red Week, which broke out on 7 June 1914 in Ancona, where Malatesta lived."
},
{
"note": "Source: The Method of Freedom: An Errico Malatesta Reader, edited by Davide Turcato, translated by Paul Sharkey."
}
],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://theanarchistlibrary.org/library/ulrika-holgersson-britta-grondahl",
"items": [
{
"title": "Britta Gröndahl",
"itemType": "manuscript",
"creators": [
{
"firstName": "Ulrika",
"lastName": "Holgersson",
"creatorType": "author"
},
{
"firstName": "Alexia",
"lastName": "Grosjean",
"creatorType": "translator"
}
],
"notes": [
{
"note": "Translated by Alexia Grosjean."
},
{
"note": "Source: Retrieved on 11th March 2025 from www.skbl.se"
}
],
"tags": [
{
"tag": "Sweden"
},
{
"tag": "biography"
}
],
"date": "2018-03-08",
"seeAlso": [],
"libraryCatalog": "Anarchist Library",
"attachments": [
{
"title": "PDF",
"mimeType": "application/pdf"
}
],
"url": "https://theanarchistlibrary.org/library/ulrika-holgersson-britta-grondahl",
"language": "en"
}
]
},
{
"type": "web",
"url": "https://theanarchistlibrary.org/library/emile-armand-the-forerunners-of-anarchism",
"items": [
{
"itemType": "manuscript",
"title": "The Forerunners of Anarchism",
"creators": [
{
"creatorType": "author",
"firstName": "Emile",
"lastName": "Armand"
},
{
"creatorType": "translator",
"firstName": "",
"lastName": "Reddebrek"
}
],
"notes": [
{
"note": "Translated by Reddebrek."
},
{
"note": "Source: Provided by the translator."
}
],
"tags": [
{
"tag": "history"
},
{
"tag": "individualism"
},
{
"tag": "proto-anarchism"
}
],
"date": "1933",
"seeAlso": [],
"libraryCatalog": "Anarchist Library",
"attachments": [
{
"title": "PDF",
"mimeType": "application/pdf"
}
],
"url": "https://theanarchistlibrary.org/library/emile-armand-the-forerunners-of-anarchism",
"language": "en"
}
]
},
{
"type": "web",
"url": "https://theanarchistlibrary.org/search?query=kropotkin",
"items": "multiple"
},
{
"type": "web",
"url": "https://theanarchistlibrary.org/search?query=spirit",
"items": "multiple"
}
]
/** END TEST CASES **/

View File

@@ -24,7 +24,7 @@
},
"priority": 50,
"inRepository": false,
"lastUpdated": "2024-11-10"
"lastUpdated": "2024-11-29"
}
ZOTERO_CONFIG = {"GUID":"zotero@chnm.gmu.edu","ID":"zotero","CLIENT_NAME":"Zotero","DOMAIN_NAME":"zotero.org","PRODUCER":"Digital Scholar","PRODUCER_URL":"https://digitalscholar.org","REPOSITORY_URL":"https://repo.zotero.org/repo/","BASE_URI":"http://zotero.org/","WWW_BASE_URL":"https://www.zotero.org/","PROXY_AUTH_URL":"https://zoteroproxycheck.s3.amazonaws.com/test","API_URL":"https://api.zotero.org/","STREAMING_URL":"wss://stream.zotero.org/","SERVICES_URL":"https://services.zotero.org/","API_VERSION":3,"CONNECTOR_MIN_VERSION":"5.0.39","PREF_BRANCH":"extensions.zotero.","BOOKMARKLET_ORIGIN":"https://www.zotero.org","BOOKMARKLET_URL":"https://www.zotero.org/bookmarklet/","START_URL":"https://www.zotero.org/start","QUICK_START_URL":"https://www.zotero.org/support/quick_start_guide","PDF_TOOLS_URL":"https://www.zotero.org/download/xpdf/","SUPPORT_URL":"https://www.zotero.org/support/","SYNC_INFO_URL":"https://www.zotero.org/support/sync","TROUBLESHOOTING_URL":"https://www.zotero.org/support/getting_help","FEEDBACK_URL":"https://forums.zotero.org/","CONNECTORS_URL":"https://www.zotero.org/download/connectors","CHANGELOG_URL":"https://www.zotero.org/support/changelog","CREDITS_URL":"https://www.zotero.org/support/credits_and_acknowledgments","LICENSING_URL":"https://www.zotero.org/support/licensing","GET_INVOLVED_URL":"https://www.zotero.org/getinvolved","DICTIONARIES_URL":"https://download.zotero.org/dictionaries/"}

View File

@@ -16,7 +16,7 @@
"configOptions": {
"hash": "77a115370abf61ab3e5585cd66defb379bbddf3d310d647523cfb32072c59c2c"
},
"lastUpdated": "2024-11-19"
"lastUpdated": "2024-11-29"
}
ZOTERO_CONFIG = {"GUID":"zotero@chnm.gmu.edu","ID":"zotero","CLIENT_NAME":"Zotero","DOMAIN_NAME":"zotero.org","PRODUCER":"Digital Scholar","PRODUCER_URL":"https://digitalscholar.org","REPOSITORY_URL":"https://repo.zotero.org/repo/","BASE_URI":"http://zotero.org/","WWW_BASE_URL":"https://www.zotero.org/","PROXY_AUTH_URL":"https://zoteroproxycheck.s3.amazonaws.com/test","API_URL":"https://api.zotero.org/","STREAMING_URL":"wss://stream.zotero.org/","SERVICES_URL":"https://services.zotero.org/","API_VERSION":3,"CONNECTOR_MIN_VERSION":"5.0.39","PREF_BRANCH":"extensions.zotero.","BOOKMARKLET_ORIGIN":"https://www.zotero.org","BOOKMARKLET_URL":"https://www.zotero.org/bookmarklet/","START_URL":"https://www.zotero.org/start","QUICK_START_URL":"https://www.zotero.org/support/quick_start_guide","PDF_TOOLS_URL":"https://www.zotero.org/download/xpdf/","SUPPORT_URL":"https://www.zotero.org/support/","SYNC_INFO_URL":"https://www.zotero.org/support/sync","TROUBLESHOOTING_URL":"https://www.zotero.org/support/getting_help","FEEDBACK_URL":"https://forums.zotero.org/","CONNECTORS_URL":"https://www.zotero.org/download/connectors","CHANGELOG_URL":"https://www.zotero.org/support/changelog","CREDITS_URL":"https://www.zotero.org/support/credits_and_acknowledgments","LICENSING_URL":"https://www.zotero.org/support/licensing","GET_INVOLVED_URL":"https://www.zotero.org/getinvolved","DICTIONARIES_URL":"https://download.zotero.org/dictionaries/"}

View File

@@ -23,7 +23,7 @@
"browserSupport": "gcsv",
"priority": 199,
"inRepository": false,
"lastUpdated": "2024-11-10"
"lastUpdated": "2024-11-29"
}
ZOTERO_CONFIG = {"GUID":"zotero@chnm.gmu.edu","ID":"zotero","CLIENT_NAME":"Zotero","DOMAIN_NAME":"zotero.org","PRODUCER":"Digital Scholar","PRODUCER_URL":"https://digitalscholar.org","REPOSITORY_URL":"https://repo.zotero.org/repo/","BASE_URI":"http://zotero.org/","WWW_BASE_URL":"https://www.zotero.org/","PROXY_AUTH_URL":"https://zoteroproxycheck.s3.amazonaws.com/test","API_URL":"https://api.zotero.org/","STREAMING_URL":"wss://stream.zotero.org/","SERVICES_URL":"https://services.zotero.org/","API_VERSION":3,"CONNECTOR_MIN_VERSION":"5.0.39","PREF_BRANCH":"extensions.zotero.","BOOKMARKLET_ORIGIN":"https://www.zotero.org","BOOKMARKLET_URL":"https://www.zotero.org/bookmarklet/","START_URL":"https://www.zotero.org/start","QUICK_START_URL":"https://www.zotero.org/support/quick_start_guide","PDF_TOOLS_URL":"https://www.zotero.org/download/xpdf/","SUPPORT_URL":"https://www.zotero.org/support/","SYNC_INFO_URL":"https://www.zotero.org/support/sync","TROUBLESHOOTING_URL":"https://www.zotero.org/support/getting_help","FEEDBACK_URL":"https://forums.zotero.org/","CONNECTORS_URL":"https://www.zotero.org/download/connectors","CHANGELOG_URL":"https://www.zotero.org/support/changelog","CREDITS_URL":"https://www.zotero.org/support/credits_and_acknowledgments","LICENSING_URL":"https://www.zotero.org/support/licensing","GET_INVOLVED_URL":"https://www.zotero.org/getinvolved","DICTIONARIES_URL":"https://download.zotero.org/dictionaries/"}

View File

@@ -19,7 +19,7 @@
"browserSupport": "gcsv",
"inRepository": false,
"priority": 100,
"lastUpdated": "2024-11-10"
"lastUpdated": "2024-11-29"
}
ZOTERO_CONFIG = {"GUID":"zotero@chnm.gmu.edu","ID":"zotero","CLIENT_NAME":"Zotero","DOMAIN_NAME":"zotero.org","PRODUCER":"Digital Scholar","PRODUCER_URL":"https://digitalscholar.org","REPOSITORY_URL":"https://repo.zotero.org/repo/","BASE_URI":"http://zotero.org/","WWW_BASE_URL":"https://www.zotero.org/","PROXY_AUTH_URL":"https://zoteroproxycheck.s3.amazonaws.com/test","API_URL":"https://api.zotero.org/","STREAMING_URL":"wss://stream.zotero.org/","SERVICES_URL":"https://services.zotero.org/","API_VERSION":3,"CONNECTOR_MIN_VERSION":"5.0.39","PREF_BRANCH":"extensions.zotero.","BOOKMARKLET_ORIGIN":"https://www.zotero.org","BOOKMARKLET_URL":"https://www.zotero.org/bookmarklet/","START_URL":"https://www.zotero.org/start","QUICK_START_URL":"https://www.zotero.org/support/quick_start_guide","PDF_TOOLS_URL":"https://www.zotero.org/download/xpdf/","SUPPORT_URL":"https://www.zotero.org/support/","SYNC_INFO_URL":"https://www.zotero.org/support/sync","TROUBLESHOOTING_URL":"https://www.zotero.org/support/getting_help","FEEDBACK_URL":"https://forums.zotero.org/","CONNECTORS_URL":"https://www.zotero.org/download/connectors","CHANGELOG_URL":"https://www.zotero.org/support/changelog","CREDITS_URL":"https://www.zotero.org/support/credits_and_acknowledgments","LICENSING_URL":"https://www.zotero.org/support/licensing","GET_INVOLVED_URL":"https://www.zotero.org/getinvolved","DICTIONARIES_URL":"https://download.zotero.org/dictionaries/"}

View File

@@ -19,7 +19,7 @@
"browserSupport": "gcsv",
"priority": 800,
"inRepository": false,
"lastUpdated": "2024-11-10"
"lastUpdated": "2024-11-29"
}
ZOTERO_CONFIG = {"GUID":"zotero@chnm.gmu.edu","ID":"zotero","CLIENT_NAME":"Zotero","DOMAIN_NAME":"zotero.org","PRODUCER":"Digital Scholar","PRODUCER_URL":"https://digitalscholar.org","REPOSITORY_URL":"https://repo.zotero.org/repo/","BASE_URI":"http://zotero.org/","WWW_BASE_URL":"https://www.zotero.org/","PROXY_AUTH_URL":"https://zoteroproxycheck.s3.amazonaws.com/test","API_URL":"https://api.zotero.org/","STREAMING_URL":"wss://stream.zotero.org/","SERVICES_URL":"https://services.zotero.org/","API_VERSION":3,"CONNECTOR_MIN_VERSION":"5.0.39","PREF_BRANCH":"extensions.zotero.","BOOKMARKLET_ORIGIN":"https://www.zotero.org","BOOKMARKLET_URL":"https://www.zotero.org/bookmarklet/","START_URL":"https://www.zotero.org/start","QUICK_START_URL":"https://www.zotero.org/support/quick_start_guide","PDF_TOOLS_URL":"https://www.zotero.org/download/xpdf/","SUPPORT_URL":"https://www.zotero.org/support/","SYNC_INFO_URL":"https://www.zotero.org/support/sync","TROUBLESHOOTING_URL":"https://www.zotero.org/support/getting_help","FEEDBACK_URL":"https://forums.zotero.org/","CONNECTORS_URL":"https://www.zotero.org/download/connectors","CHANGELOG_URL":"https://www.zotero.org/support/changelog","CREDITS_URL":"https://www.zotero.org/support/credits_and_acknowledgments","LICENSING_URL":"https://www.zotero.org/support/licensing","GET_INVOLVED_URL":"https://www.zotero.org/getinvolved","DICTIONARIES_URL":"https://download.zotero.org/dictionaries/"}

View File

@@ -25,7 +25,7 @@
"browserSupport": "gcsv",
"priority": 49,
"inRepository": false,
"lastUpdated": "2024-11-10"
"lastUpdated": "2024-11-29"
}
ZOTERO_CONFIG = {"GUID":"zotero@chnm.gmu.edu","ID":"zotero","CLIENT_NAME":"Zotero","DOMAIN_NAME":"zotero.org","PRODUCER":"Digital Scholar","PRODUCER_URL":"https://digitalscholar.org","REPOSITORY_URL":"https://repo.zotero.org/repo/","BASE_URI":"http://zotero.org/","WWW_BASE_URL":"https://www.zotero.org/","PROXY_AUTH_URL":"https://zoteroproxycheck.s3.amazonaws.com/test","API_URL":"https://api.zotero.org/","STREAMING_URL":"wss://stream.zotero.org/","SERVICES_URL":"https://services.zotero.org/","API_VERSION":3,"CONNECTOR_MIN_VERSION":"5.0.39","PREF_BRANCH":"extensions.zotero.","BOOKMARKLET_ORIGIN":"https://www.zotero.org","BOOKMARKLET_URL":"https://www.zotero.org/bookmarklet/","START_URL":"https://www.zotero.org/start","QUICK_START_URL":"https://www.zotero.org/support/quick_start_guide","PDF_TOOLS_URL":"https://www.zotero.org/download/xpdf/","SUPPORT_URL":"https://www.zotero.org/support/","SYNC_INFO_URL":"https://www.zotero.org/support/sync","TROUBLESHOOTING_URL":"https://www.zotero.org/support/getting_help","FEEDBACK_URL":"https://forums.zotero.org/","CONNECTORS_URL":"https://www.zotero.org/download/connectors","CHANGELOG_URL":"https://www.zotero.org/support/changelog","CREDITS_URL":"https://www.zotero.org/support/credits_and_acknowledgments","LICENSING_URL":"https://www.zotero.org/support/licensing","GET_INVOLVED_URL":"https://www.zotero.org/getinvolved","DICTIONARIES_URL":"https://download.zotero.org/dictionaries/"}

185
translators/ChatGPT.js Normal file
View File

@@ -0,0 +1,185 @@
{
"translatorID": "d8a83346-164a-467d-8717-eb96d4dcce6f",
"translatorType": 4,
"label": "ChatGPT",
"creator": "Abe Jellinek",
"target": "^https://chatgpt\\.com/",
"minVersion": "5.0",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2025-10-27 15:50:00"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2025 Abe Jellinek
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
// Simple translator for ChatGPT that grabs the date and model info
// for private and public chats.
// Please don't take any of the translator authorship advice that ChatGPT
// gives in the test page. It's mostly wrong.
function detectWeb(doc, url) {
if (url.includes('/c/') || url.includes('/share/')) {
return 'webpage';
}
return false;
}
async function doWeb(doc, url) {
let item = new Zotero.Item('webpage');
item.title = doc.title;
item.websiteTitle = 'ChatGPT';
item.websiteType = 'Generative AI chat';
if (url.includes('/share/')) {
item.url = url;
}
item.creators.push({
creatorType: 'author',
lastName: 'OpenAI',
fieldMode: 1
});
item.attachments.push({
title: 'Snapshot',
document: doc
});
try {
await enrichItemWithAPI(doc, url, item);
}
catch (e) {
Zotero.debug(e);
}
item.complete();
}
async function enrichItemWithAPI(doc, url, item) {
let dataScript = [...doc.querySelectorAll('script')]
.find(script => script.textContent.startsWith('window.__reactRouterContext.streamController.enqueue('))
.textContent;
let extract = (key) => {
let formattedKey = `\\"${key}\\",\\"`;
let keyIndex = dataScript.indexOf(formattedKey);
if (keyIndex === -1) return null;
return dataScript.substring(keyIndex + formattedKey.length).split('\\"')[0];
};
let language = extract('locale');
let deviceID = extract('WebAnonymousCookieID');
let accessToken = extract('accessToken');
let clientVersion = doc.documentElement.dataset.build;
let id = url.match(/\/(?:c|share)\/([^#?/]+)/)[1];
let apiSlug;
if (url.includes('/c/')) {
apiSlug = 'conversation/' + id;
}
else {
apiSlug = 'share/' + id;
}
let apiURL = '/backend-api/' + apiSlug;
let headers = {
'OAI-Language': language,
'OAI-Device-Id': deviceID,
'OAI-Client-Version': clientVersion,
};
if (accessToken) {
headers.Authorization = `Bearer ${accessToken}`;
}
let json = await requestJSON(apiURL, { headers });
item.title = json.title;
let date = new Date((json.update_time || json.create_time) * 1000);
item.date = ZU.strToISO(date.toISOString());
if (json.model) {
item.websiteTitle += ` (${json.model.title})`;
}
if (url.includes('/c/')) {
// Private conversation: Add existing share URL if available
try {
let { items: shares }
= await requestJSON('/backend-api/shared_conversations?order=created', { headers });
let share = shares.find(share => share.conversation_id === id);
if (share) {
Zotero.debug('Conversation has been shared as ' + share.id);
if (new Date(share.update_time) >= date) {
Zotero.debug('Share is up to date');
item.url = `https://chatgpt.com/share/${share.id}`;
}
else {
Zotero.debug(`Out of date: ${share.update_time} < ${date}`);
}
}
else {
Zotero.debug('Not yet shared');
}
}
catch (e) {
Zotero.debug('Unable to find share');
Zotero.debug(e);
}
}
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://chatgpt.com/share/68fa640b-9fc8-8013-a803-3d5241df6556",
"items": [
{
"itemType": "webpage",
"title": "Write Zotero translator",
"creators": [
{
"creatorType": "author",
"lastName": "OpenAI",
"fieldMode": 1
}
],
"date": "2025-10-24",
"url": "https://chatgpt.com/share/68fa640b-9fc8-8013-a803-3d5241df6556",
"websiteTitle": "ChatGPT (GPT-5)",
"websiteType": "Generative AI chat",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

View File

@@ -1,21 +1,21 @@
{
"translatorID": "bf053edc-a8c3-458c-93db-6d04ead2e636",
"translatorType": 4,
"label": "EUR-Lex",
"creator": "Philipp Zumstein, Pieter van der Wees",
"target": "^https?://(www\\.)?eur-lex\\.europa\\.eu/(legal-content/[A-Z][A-Z]/(TXT|ALL)/|search\\.html\\?)",
"target": "^https://eur-lex\\.europa\\.eu/",
"minVersion": "3.0",
"maxVersion": "",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2021-12-31 02:00:49"
"lastUpdated": "2025-10-30 15:55:00"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2017-2021 Philipp Zumstein, Pieter van der Wees
Copyright © 2025 Abe Jellinek
This file is part of Zotero.
@@ -161,19 +161,14 @@ function scrape(doc, url) {
var type = detectWeb(doc, url);
var item = new Zotero.Item(type);
// determine the language in which we are currently viewing the document
var languageUrl = url.split("/")[4].toUpperCase();
if (languageUrl == "AUTO") {
languageUrl = autoLanguage || "EN";
}
var language = languageMapping[languageUrl].iso || "eng";
var viewingLanguage = (doc.documentElement.lang || "en").toUpperCase();
// Cases only return language; discard everything else
item.language = languageUrl.toLowerCase();
item.language = viewingLanguage.toLowerCase();
if (eliTypeUri) {
// type: everything with ELI (see var typeMapping: bill, statute, report)
item.title = attr(doc, 'meta[property="eli:title"][lang=' + languageUrl.toLowerCase() + "]", "content");
var uri = attr(doc, "#format_language_table_digital_sign_act_" + languageUrl.toUpperCase(), "href");
item.title = attr(doc, 'meta[property="eli:title"][lang=' + viewingLanguage.toLowerCase() + "]", "content");
var uri = attr(doc, "#format_language_table_digital_sign_act_" + viewingLanguage.toUpperCase(), "href");
if (uri) {
var uriParts = uri.split("/").pop().replace("?uri=", "")
.split(":");
@@ -207,7 +202,7 @@ function scrape(doc, url) {
}
item.legislativeBody = passedByArray.join(", ");
item.url = attr(doc, 'meta[typeOf="eli:LegalResource"]', "about") + "/" + language.toLowerCase();
item.url = attr(doc, 'meta[typeOf="eli:LegalResource"]', "about");
}
else if (item.itemType == "case") {
@@ -215,13 +210,13 @@ function scrape(doc, url) {
// pretty hacky stuff, as there's little metadata available
var docCourt = docType.substr(0, 1);
if (docCourt == "C") {
item.court = languageMapping[languageUrl].ECJ || languageMapping.EN.ECJ;
item.court = languageMapping[viewingLanguage].ECJ || languageMapping.EN.ECJ;
}
else if (docCourt == "T") {
item.court = languageMapping[languageUrl].GC || languageMapping.EN.GC;
item.court = languageMapping[viewingLanguage].GC || languageMapping.EN.GC;
}
else if (docCourt == "F") {
item.court = languageMapping[languageUrl].CST || languageMapping.EN.CST;
item.court = languageMapping[viewingLanguage].CST || languageMapping.EN.CST;
}
item.url = url;
@@ -253,10 +248,10 @@ function scrape(doc, url) {
}
// attachments
// type: all
var pdfurl = "https://eur-lex.europa.eu/legal-content/" + languageUrl + "/TXT/PDF/?uri=CELEX:" + celex;
var htmlurl = "https://eur-lex.europa.eu/legal-content/" + languageUrl + "/TXT/HTML/?uri=CELEX:" + celex;
item.attachments = [{ url: pdfurl, title: "EUR-Lex PDF (" + languageUrl + ")", mimeType: "application/pdf" }];
item.attachments.push({ url: htmlurl, title: "EUR-Lex HTML (" + languageUrl + ")", mimeType: "text/html", snapshot: true });
var pdfurl = "https://eur-lex.europa.eu/legal-content/" + viewingLanguage + "/TXT/PDF/?uri=CELEX:" + celex;
var htmlurl = "https://eur-lex.europa.eu/legal-content/" + viewingLanguage + "/TXT/HTML/?uri=CELEX:" + celex;
item.attachments = [{ url: pdfurl, title: "EUR-Lex PDF (" + viewingLanguage + ")", mimeType: "application/pdf" }];
item.attachments.push({ url: htmlurl, title: "EUR-Lex HTML (" + viewingLanguage + ")", mimeType: "text/html", snapshot: true });
item.complete();
}
@@ -276,7 +271,7 @@ var testCases = [
"codeVolume": "281",
"language": "en",
"legislativeBody": "EP, CONSIL",
"url": "http://data.europa.eu/eli/dir/1995/46/oj/eng",
"url": "http://data.europa.eu/eli/dir/1995/46/oj",
"attachments": [
{
"title": "EUR-Lex PDF (EN)",
@@ -300,20 +295,20 @@ var testCases = [
"items": [
{
"itemType": "statute",
"nameOfAct": "Règlement (CE) n° 2257/94 de la Commission, du 16 septembre 1994, fixant des normes de qualité pour les bananes (Texte présentant de l'intérêt pour l'EEE)",
"nameOfAct": "Commission Regulation (EC) No 2257/94 of 16 September 1994 laying down quality standards for bananas (Text with EEA relevance)",
"creators": [],
"dateEnacted": "1994-09-16",
"code": "OJ L",
"codeNumber": "245",
"language": "fr",
"url": "http://data.europa.eu/eli/reg/1994/2257/oj/fra",
"language": "en",
"url": "http://data.europa.eu/eli/reg/1994/2257/oj",
"attachments": [
{
"title": "EUR-Lex PDF (FR)",
"title": "EUR-Lex PDF (EN)",
"mimeType": "application/pdf"
},
{
"title": "EUR-Lex HTML (FR)",
"title": "EUR-Lex HTML (EN)",
"mimeType": "text/html",
"snapshot": true
}
@@ -369,15 +364,15 @@ var testCases = [
"title": "Bez námitek k navrhovanému spojení (Věc M.10068 — Brookfield/Mansa/Polenergia) (Text s významem pro EHP) 2021/C 14/01",
"creators": [],
"date": "2021",
"language": "cs",
"language": "nl",
"url": "https://eur-lex.europa.eu/legal-content/CS/TXT/?uri=uriserv%3AOJ.C_.2021.014.01.0001.01.CES&toc=OJ%3AC%3A2021%3A014%3ATOC",
"attachments": [
{
"title": "EUR-Lex PDF (CS)",
"title": "EUR-Lex PDF (NL)",
"mimeType": "application/pdf"
},
{
"title": "EUR-Lex HTML (CS)",
"title": "EUR-Lex HTML (NL)",
"mimeType": "text/html",
"snapshot": true
}
@@ -398,17 +393,17 @@ var testCases = [
"creators": [],
"dateDecided": "21 ta' Settembru 2011",
"abstractNote": "Trade mark Komunitarja - Proċedimenti għal dikjarazzjoni ta invalidità - Trade mark Komunitarja verbali SCOMBER MIX - Raġuni assoluta għal rifjut - Karattru deskrittiv - Artikolu 7(1)(b) u (ċ) tar-Regolament (KE) Nru 40/94 [li sar l-Artikolu 7(1)(b) u (c) tar-Regolament (KE) Nru 207/2009]",
"court": "Il-Qorti Ġenerali",
"court": "Gerecht EU",
"docketNumber": "Kawża T-201/09",
"language": "mt",
"language": "nl",
"url": "https://eur-lex.europa.eu/legal-content/MT/TXT/?uri=CELEX%3A62009TJ0201",
"attachments": [
{
"title": "EUR-Lex PDF (MT)",
"title": "EUR-Lex PDF (NL)",
"mimeType": "application/pdf"
},
{
"title": "EUR-Lex HTML (MT)",
"title": "EUR-Lex HTML (NL)",
"mimeType": "text/html",
"snapshot": true
}

View File

@@ -0,0 +1,811 @@
{
"translatorID": "3b163469-3e62-46d8-82a1-4f31e86bf6f4",
"translatorType": 4,
"label": "FAOLEX Database",
"creator": "Bin Liu",
"target": "^https?://www\\.fao\\.org/faolex/results/",
"minVersion": "5.0",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2025-10-30 15:45:00"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2025 Bin Liu and Abe Jellinek
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
function detectWeb(doc, url) {
if (/\/faolex\/results\/details\//.test(url)) {
// This matches the details page for a law
return 'statute';
}
else if (/\/faolex\/results\//.test(url)) {
if (getSearchResults(doc, true)) {
// Results/listing page with multiple laws
return 'multiple';
}
else {
Z.monitorDOMChanges(doc.body);
}
}
return false;
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = doc.querySelectorAll('.item-title > p > a');
for (let row of rows) {
let href = row.href;
let title = ZU.trimInternal(row.textContent);
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
items[href] = title;
}
return found ? items : false;
}
async function doWeb(doc, url) {
if (detectWeb(doc, url) == 'multiple') {
let items = await Zotero.selectItems(getSearchResults(doc, false));
if (!items) return;
for (let url of Object.keys(items)) {
await scrape(url);
}
}
else {
await scrape(url);
}
}
async function scrape(url) {
let language = url.match(/\/faolex\/results\/details\/([a-z]{2})\//)[1];
// Capitalize for JSON keys
language = language[0].toUpperCase() + language[1];
// Index of this language in #-separated strings
let languageIndex = ['En', 'Fr', 'Es', 'Ar', 'Ru', 'Zh'].indexOf(language);
if (languageIndex === -1) languageIndex = 0;
let id = url.match(/LEX-[^#?/]+/)[0];
let json = await requestJSON(`https://fao-faolex-prod.appspot.com/api/query`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: `faolexid:("${id}")`,
requestOptions: {
searchApplicationId: 'searchapplications/1be285f8874b8c6bfaabf84aa9d0c1be'
},
}),
});
let result = json.results[0];
let getValues = name => result.metadata.fields
.find(field => field.name === name)
?.textValues.values;
let getValuesJoined = name => getValues(name)?.join('') || '';
let getValuesLocalized = name => getValues(name + language)
|| getValues(name).map(val => val.split('#')[languageIndex])
|| getValues(name + 'En');
let getValue = name => getValues(name)?.[0] || '';
let getValueLocalized = name => getValue(name + language)
|| getValue(name).split('#')[languageIndex]
|| getValue(name + 'En');
let item = new Zotero.Item('statute');
item.extra = '';
item.nameOfAct = getValue('titleOfText').replace(/\s*\.$/, '');
if (getValue('originalTitleOfText')) {
item.extra += `Original Title: ${getValue('originalTitleOfText')}\n`;
}
item.creators.push({
lastName: getValueLocalized('country'),
creatorType: 'author',
fieldMode: 1
});
// Public Law Number: Use the value of "FAOLEX No"
item.publicLawNumber = getValue('faolexId');
// Date Enacted: Use the value of "Date of text"
item.dateEnacted = getValue('dateOfText');
item.language = getValue('documentLanguageEn');
item.abstractNote = getValuesJoined('abstract').replace(/\[BR_PLACEHOLDER\]/g, '\n');
let pdfFilename = getValue('linksToFullText');
if (pdfFilename) {
item.attachments.push({
title: 'Full Text PDF',
mimeType: 'application/pdf',
url: `https://faolex.fao.org/docs/pdf/${pdfFilename}`,
});
}
// Tags: Use the value of "Keywords"
for (let keyword of getValuesLocalized('keyword') || []) {
if (!keyword) continue;
item.tags.push({ tag: keyword.trim() });
}
item.url = url.replace(/\/$/, '');
item.complete();
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://www.fao.org/faolex/results/details/fr/c/LEX-FAOC238894/",
"items": [
{
"itemType": "statute",
"nameOfAct": "Fisheries Law",
"creators": [
{
"lastName": "Cambodge",
"creatorType": "author",
"fieldMode": 1
}
],
"dateEnacted": "2025-06-16",
"abstractNote": "This Law is formulated with the goal of effectively managing, conserving and developing the fisheries sector, aiming to ensure long-term food security and economic and environmental sustainability. It also aims to protect the rights and benefits of fishers, fishing communities, aquaculture operators and businesses, in line with socio-economic and technological developments, while promoting participation in the sustainable management and conservation of fishery resources within regional and international frameworks — particularly in combating illegal, unreported and unregulated (IUU) fishing.\nThe Law sets up a comprehensive legal framework, covering: the management, protection, conservation and sustainable development of fishery resources; the protection of the interests of those involved in the fishery supply chain; support measures for the implementation of sectoral strategic plans in line with government policy; measures to meet necessary standards and conditions to ensure compatibility with international legal instruments; aquaculture management measures; etc. A Fisheries Commission shall be established to oversee the management and sustainability of the fisheries sector. The Law also introduces expanded inshore exclusive zones.\nThe Law consists of 15 Chapters and 104 Articles, with two Annexes.",
"language": "Khmer",
"publicLawNumber": "LEX-FAOC238894",
"url": "https://www.fao.org/faolex/results/details/fr/c/LEX-FAOC238894",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "Pêche illicite, non déclarée et non réglementée (INN)"
},
{
"tag": "agriculture familiale"
},
{
"tag": "aquaculture"
},
{
"tag": "autorisation/permis"
},
{
"tag": "biodiversité"
},
{
"tag": "classement/déclassement"
},
{
"tag": "commerce international"
},
{
"tag": "commerce intérieur"
},
{
"tag": "coopération internationale"
},
{
"tag": "débarquement"
},
{
"tag": "développement durable"
},
{
"tag": "engins de pêche/méthodes de pêche"
},
{
"tag": "gestion communautaire"
},
{
"tag": "gestion et conservation des pêches"
},
{
"tag": "gestion intégrée"
},
{
"tag": "gouvernance"
},
{
"tag": "haute mer"
},
{
"tag": "infractions/sanctions"
},
{
"tag": "institution"
},
{
"tag": "loi-cadre"
},
{
"tag": "mariculture"
},
{
"tag": "mesures du ressort de lÉtat du port"
},
{
"tag": "mise en application/conformité"
},
{
"tag": "pêche continentale"
},
{
"tag": "pêche maritime"
},
{
"tag": "pêche étrangère"
},
{
"tag": "santé des animaux"
},
{
"tag": "transbordement"
},
{
"tag": "transformation/manutention"
},
{
"tag": "utilisation durable"
},
{
"tag": "zone marine"
}
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.fao.org/faolex/results/details/en/c/LEX-FAOC237255",
"items": [
{
"itemType": "statute",
"nameOfAct": "Climate Law (No. 7552)",
"creators": [
{
"lastName": "Türkiye",
"creatorType": "author",
"fieldMode": 1
}
],
"dateEnacted": "2025-07-02",
"abstractNote": "The Climate Law seeks to combat climate change in line with the green growth vision and net zero emissions target. It covers the reduction of greenhouse gas emissions and climate change adaptation activities, which are fundamental to combating climate change, as well as planning and implementation tools, revenues, permits, and inspections, and the procedures and principles of the related legal and institutional framework.\nThis Law adopts the approaches of equality, climate justice, precaution, participation, integration, sustainability, transparency, just transition, and progress. It obliges public institutions and organizations, as well as real and legal persons, to comply with and implement the measures and regulations to be taken in the public interest in accordance with this Law, in a timely manner. In the Nationally Determined Contributions (NDCs), the country's development priorities and special conditions will be taken into account in line with the net-zero emissions target, and measures will be taken within this framework.\nArticle 5 of the Climate Law lays down the activities to combat climate change, consisting of greenhouse gas emission reduction activities and climate change adaptation activities. Relevant public institutions and organizations are obligated to adapt, prepare, implement, monitor, and update planning tools containing medium- and long-term targets within the framework of greenhouse gas emission reduction activities. The public institutions and organizations are responsible for implementing mitigation measures, such as: (i) efficiency of energy, water, and raw material; (ii) preventing pollution at source; (iii) increasing the use of renewable energy; (iv) reducing the carbon footprint of products, businesses, institutions, and organizations; (v) using alternative clean or low-carbon fuels and raw materials; (vi) expanding electrification; and (vii) developing and increasing the use of clean technologies, in a manner consistent with the net-zero emissions target and the circular economy approach, in the sectors listed in the NDCs. Relevant institutions and organizations shall take measures to prevent carbon sink losses in forests, agricultural lands, pastures, and wetlands to offset emissions towards achieving the net-zero emissions target.\nThis Law provides for the establishment of the Emissions Trading System (ETS) and lays down provisions on the principles of allocations, the composition and duties of the Carbon Market Board, and voluntary carbon markets and offsets. It gives priority to climate-friendly investments with a high potential for reducing greenhouse gas emissions or adapting to climate change, as well as activities that contribute to meeting the research, development, and sectoral technological transformation needs required for green growth, and the mechanisms implemented within this scope. Article 14 sets out administrative sanctions, including but not limited to: violation of prohibitions or restrictions related to ozone-depleting substances, fluorinated greenhouse gases, hydrofluorocarbons and the monitoring greenhouse gas emissions, and businesses operating within the scope of the ETS without a greenhouse gas emission permit.",
"extra": "Original Title: İklim Kanunu (Kanun No. 7552).",
"language": "Turkish",
"publicLawNumber": "LEX-FAOC237255",
"url": "https://www.fao.org/faolex/results/details/en/c/LEX-FAOC237255",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "agricultural land"
},
{
"tag": "air quality/air pollution"
},
{
"tag": "allocation/quota"
},
{
"tag": "basic legislation"
},
{
"tag": "bioenergy"
},
{
"tag": "biofuel"
},
{
"tag": "business/industry/corporations"
},
{
"tag": "certification"
},
{
"tag": "circular economy"
},
{
"tag": "climate change"
},
{
"tag": "data collection/reporting"
},
{
"tag": "emissions"
},
{
"tag": "emissions pricing"
},
{
"tag": "energy conservation/energy production"
},
{
"tag": "enforcement/compliance"
},
{
"tag": "environmental planning"
},
{
"tag": "governance"
},
{
"tag": "green economy"
},
{
"tag": "hazardous substances"
},
{
"tag": "innovation"
},
{
"tag": "inspection"
},
{
"tag": "institution"
},
{
"tag": "insurance"
},
{
"tag": "investment"
},
{
"tag": "monitoring"
},
{
"tag": "offences/penalties"
},
{
"tag": "oil"
},
{
"tag": "ozone layer"
},
{
"tag": "policy/planning"
},
{
"tag": "pollution control"
},
{
"tag": "precautionary principle"
},
{
"tag": "protection of environment"
},
{
"tag": "renewable energy"
},
{
"tag": "research"
},
{
"tag": "risk assessment/management"
},
{
"tag": "sustainable development"
},
{
"tag": "water resources management"
},
{
"tag": "wetlands"
}
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.fao.org/faolex/results/details/ru/c/LEX-FAOC237135/",
"items": [
{
"itemType": "statute",
"nameOfAct": "Law No. 128 “Water Code”",
"creators": [
{
"lastName": "Кыргызстан",
"creatorType": "author",
"fieldMode": 1
}
],
"dateEnacted": "2025-06-27",
"abstractNote": "The Water Code establishes a comprehensive legal framework governing water relations, emphasizing the regulation of water use, protection, and development to ensure adequate and safe water supply for the population, environmental protection, and rational resource development. It underscores the state's ownership of water resources, the basin management approach, and principles such as stakeholder participation, environmental responsibility, and economic valuation of water. The document delineates the roles and competencies of various state bodies, including the President, Parliament, Cabinet of Ministers, and specialized councils, such as the National Water and Land Council and basin councils, with responsibilities ranging from policy formulation, legislation development, to water resource management and monitoring. Key measures include the development of national strategies and programs, basin plans, and water management policies aligned with international obligations. The Code specifies procedures for water allocation, permits, and contracts, prioritizing water use for drinking, household needs, irrigation, and energy generation. It details the regulation of groundwater extraction, the issuance of permits, and the transfer and extension of water use rights, alongside mechanisms for water pricing, exemptions, and liability for violations. The document also emphasizes environmental standards, pollution control, and the classification of water quality, along with establishing security zones, emergency response systems, and dam safety protocols. Institutional responsibilities for monitoring, enforcement, and stakeholder engagement are explicitly outlined, with timelines for periodic reviews and updates. Implementation mechanisms include the establishment of a unified water information system, state water inventories, and registers, with data collection, analysis, and reporting procedures governed by the Cabinet of Ministers. The Code prescribes institutional roles for water management authorities, environmental agencies, and local administrations, detailing procedures for permits, inspections, and dispute resolution. It also addresses international cooperation, stipulating principles for cross-border water relations, treaty compliance, and joint project financing. Overall, the document provides a detailed legal and institutional blueprint for water governance, emphasizing procedural clarity, stakeholder participation, and compliance with international standards.",
"extra": "Original Title: ВОДНЫЙ КОДЕКС КЫРГЫЗСКОЙ РЕСПУБЛИКИ от 27 июня 2025 года № 128.",
"language": "Russian",
"publicLawNumber": "LEX-FAOC237135",
"url": "https://www.fao.org/faolex/results/details/ru/c/LEX-FAOC237135",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "базовое законодательство"
},
{
"tag": "водоснабжение"
},
{
"tag": "возобновляемая энергия"
},
{
"tag": "государственная система водоснабжения"
},
{
"tag": "договоры"
},
{
"tag": "дозволение/разрешение"
},
{
"tag": "международное сотрудничество"
},
{
"tag": "мониторинг"
},
{
"tag": "орошение"
},
{
"tag": "охрана окружающей среды"
},
{
"tag": "питьевая вода"
},
{
"tag": "поверхностные воды"
},
{
"tag": "подземные воды"
},
{
"tag": "права на воду"
},
{
"tag": "приоритеты"
},
{
"tag": "производство гидроэлектроэнергии"
},
{
"tag": "процедурные вопросы"
},
{
"tag": "сбор данных/отчетность"
},
{
"tag": "стандарты"
},
{
"tag": "стандарты качества воды"
},
{
"tag": "управление водными ресурсами"
},
{
"tag": "устойчивое использование"
},
{
"tag": "устойчивое развитие"
}
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.fao.org/faolex/results/details/zh/c/LEX-FAOC231816/",
"items": [
{
"itemType": "statute",
"nameOfAct": "Regulations of the Ningxia Hui Autonomous Region on Ecological and Environmental Protection",
"creators": [
{
"lastName": "中国",
"creatorType": "author",
"fieldMode": 1
}
],
"dateEnacted": "2024-11-28",
"abstractNote": "The Regulations aim to protect and improve the ecological environment, prevent and control pollution and other public hazards, safeguard public health and ecological environment rights and interests, promote the construction of ecological civilization, and promote sustainable economic and social development. The Regulations consist of 8 Chapters: Chapter 1 General Provisions; Chapter 2 Supervision and Administration; Chapter 3: Protecting and Improving the Ecological Environment; Chapter 4 Prevention and Control of Pollution and Other Public Hazards; Chapter 5 Environmental Risk Prevention and Emergency Response; Chapter 6 Information Disclosure and Public Participation; Chapter 7 Legal Liability; Chapter 8 Supplementary Provisions.\nThe Regulations reflect a broader commitment to ecological civilization and align with national policies on environmental protection, emphasizing the importance of collaborative efforts among various governmental departments and stakeholders through comprehensive environmental governance with a multi-faceted approach. The People's Government of the Autonomous Region shall organize the preparation of a water pollution prevention and control plan for the Ningxia section of the Yellow River Basin and strengthen the construction of a natural conservation area system with national parks as the main body. Local governments are tasked to establish robust monitoring and management systems for pollution sources, enhance emergency response capabilities for environmental incidents, and conduct regular risk assessments. The Regulations emphasize the need for public participation in environmental protection initiatives, including education and awareness campaigns to foster a culture of ecological responsibility. Additionally, the Regulations make provisions on the establishment of compensation mechanisms for ecological protection and the promotion of green technologies and practices across sectors. In terms of food, agriculture, and natural resource management, the Regulations advocate for sustainable practices that protect biodiversity and prevent resource depletion. Specific measures include the prohibition of illegal hunting and harvesting of protected species, as well as the implementation of water pollution prevention plans in agricultural areas. The Regulations also call for the integration of ecological considerations into agricultural policies and practices, ensuring that food production does not compromise environmental integrity.",
"extra": "Original Title: 宁夏回族自治区生态环境保护条例.",
"language": "Chinese",
"publicLawNumber": "LEX-FAOC231816",
"url": "https://www.fao.org/faolex/results/details/zh/c/LEX-FAOC231816",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "保护区"
},
{
"tag": "公众参与"
},
{
"tag": "公共卫生"
},
{
"tag": "公共用水"
},
{
"tag": "内陆水域"
},
{
"tag": "再生能源"
},
{
"tag": "创新"
},
{
"tag": "危害"
},
{
"tag": "可持续利用"
},
{
"tag": "可持续发展"
},
{
"tag": "商业/工业/企业"
},
{
"tag": "土壤污染/质量"
},
{
"tag": "地下水"
},
{
"tag": "地表水"
},
{
"tag": "废弃物管理"
},
{
"tag": "废物处理"
},
{
"tag": "授权/许可"
},
{
"tag": "排放"
},
{
"tag": "排放定价"
},
{
"tag": "政策/计划"
},
{
"tag": "教育"
},
{
"tag": "数据收集/报告"
},
{
"tag": "栖息地保护"
},
{
"tag": "检查"
},
{
"tag": "森林管理/森林保护"
},
{
"tag": "水资源管理"
},
{
"tag": "污染控制"
},
{
"tag": "污染者付费原则"
},
{
"tag": "污水废水/排放"
},
{
"tag": "治理"
},
{
"tag": "沼泽地"
},
{
"tag": "淡水污染"
},
{
"tag": "物种保护"
},
{
"tag": "环境保护"
},
{
"tag": "环境影响评价"
},
{
"tag": "环境规划"
},
{
"tag": "生态友好的产品/生态友好型工艺"
},
{
"tag": "生态系统保护"
},
{
"tag": "生活垃圾"
},
{
"tag": "生物多样性"
},
{
"tag": "空气质量/空气污染"
},
{
"tag": "管理/保护"
},
{
"tag": "粮食安全"
},
{
"tag": "综合管理"
},
{
"tag": "绿色经济"
},
{
"tag": "节能/能源生产"
},
{
"tag": "融资"
},
{
"tag": "责任/补偿"
},
{
"tag": "跨界影响"
},
{
"tag": "运输/仓储"
},
{
"tag": "违法行为/处罚"
},
{
"tag": "非生活来源的废弃物"
},
{
"tag": "预警系统"
},
{
"tag": "预防浪费"
},
{
"tag": "风险评估/管理"
},
{
"tag": "饮用水"
}
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.fao.org/faolex/results/details/es/c/LEX-FAOC236786/",
"items": [
{
"itemType": "statute",
"nameOfAct": "Resolución 1415/2024 - Norma Técnica de Alimentos para Animales de la República Argentina",
"creators": [
{
"lastName": "Argentina",
"creatorType": "author",
"fieldMode": 1
}
],
"dateEnacted": "2024-12-03",
"abstractNote": "Por la presente Resolución se aprueba la Norma Técnica de Alimentos para Animales de la República Argentina, como marco normativo consolidado e integral para toda la temática de alimentos destinados a la alimentación animal. En particular, se mantiene el Registro de Productos destinados a la Alimentación Animal vigente, en el cual deben inscribirse todos los productos debidamente aprobados destinados a la alimentación animal que se elaboren, comercialicen, fraccionen, depositen, distribuyan, importen y/o exporten, los cuales deberán contar para ello con un establecimiento autorizado por el Servicio Nacional de Sanidad y Calidad Agroalimentaria(SENASA). Por otro lado, se establecen las condiciones generales de los productos que no requieren registro, así como también de aquellos productos elaborados a pedido.\nLa Norma Técnica asimismo contempla disposiciones detalladas en cuanto a las condiciones generales sobre la comercialización de los productos, las especificaciones completas de los niveles de garantía establecidas, los embalajes y rótulos.",
"language": "Spanish",
"publicLawNumber": "LEX-FAOC236786",
"url": "https://www.fao.org/faolex/results/details/es/c/LEX-FAOC236786",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "alimentos para animales/piensos"
},
{
"tag": "buenas prácticas"
},
{
"tag": "comercio interior"
},
{
"tag": "comercio internacional"
},
{
"tag": "higiene/procedimientos sanitarios"
},
{
"tag": "medicamentos"
},
{
"tag": "negocios/industria/corporaciones"
},
{
"tag": "resistencia a los antimicrobianos"
},
{
"tag": "sanidad animal"
},
{
"tag": "transporte/depósito"
}
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.fao.org/faolex/results/en/?query=test",
"defer": true,
"items": "multiple"
}
]
/** END TEST CASES **/

View File

@@ -0,0 +1,116 @@
{
"translatorID": "8a0e0cde-0d21-43f6-915b-d1aab9dd0520",
"translatorType": 4,
"label": "Google Gemini",
"creator": "Abe Jellinek",
"target": "^https://gemini\\.google\\.com/",
"minVersion": "5.0",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2025-10-27 16:00:00"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2025 Abe Jellinek
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
// It should go without saying, but please don't take Gemini's
// Shakespearean advice for Zotero translator development.
function detectWeb(doc, url) {
if (url.includes('/app/') || url.includes('/share/')) {
return 'webpage';
}
return false;
}
async function doWeb(doc, url) {
let item = new Zotero.Item('webpage');
item.title = ZU.ellipsize(text(doc, 'p.query-text-line'), 75);
item.websiteTitle = 'Gemini';
item.websiteType = 'Generative AI chat';
if (url.includes('/share/')) {
item.url = url;
let headline = doc.querySelector('.title-link');
if (headline) {
item.title = text(headline, 'h1 strong') || item.title;
item.url = attr(headline, '.share-link', 'href') || item.url;
item.date = ZU.strToISO(text(headline, '.publish-time-mode > :last-child'));
// This may break! But it isn't crucial and we don't have much to match on here.
item.websiteTitle += ' ' + text(headline, '.publish-time-mode > span:first-child > strong:only-child');
}
}
item.creators.push({
creatorType: 'author',
lastName: 'Google',
fieldMode: 1
});
item.attachments.push({
title: 'Snapshot',
document: doc
});
item.complete();
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://gemini.google.com/share/d59563f86c7b",
"defer": true,
"items": [
{
"itemType": "webpage",
"title": "Crafting Zotero Translators: Shakespearean Style",
"creators": [
{
"creatorType": "author",
"lastName": "Google",
"fieldMode": 1
}
],
"date": "2025-10-24",
"shortTitle": "Crafting Zotero Translators",
"url": "https://gemini.google.com/share/d59563f86c7b",
"websiteTitle": "Gemini 2.5 Flash",
"websiteType": "Generative AI chat",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

View File

@@ -1,15 +1,15 @@
{
"translatorID": "f20f91fe-d875-47e7-9656-0abb928be472",
"translatorType": 4,
"label": "HAL Archives Ouvertes",
"creator": "Sebastian Karcher",
"target": "^https://(hal\\.archives-ouvertes\\.fr|hal\\.science)\\b",
"label": "HAL",
"creator": "Sebastian Karcher and Abe Jellinek",
"target": "^https://([^/.]+\\.)?hal\\.science/",
"minVersion": "3.0",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2023-07-12 09:15:00"
"lastUpdated": "2025-10-23 17:10:00"
}
/*
@@ -36,11 +36,30 @@
*/
function detectWeb(doc, url) {
if (/\/search\/index\//.test(url)) return "multiple";
if (/\/hal-\d+/.test(url)) return findItemType(doc, url);
if (getSearchResults(doc, true)) {
return 'multiple';
}
else if (doc.querySelector('.typdoc')) {
return findItemType(doc, url);
}
return false;
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = doc.querySelectorAll('.results-table td > a:first-child');
for (let row of rows) {
let href = row.href;
let title = ZU.trimInternal(row.textContent);
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
items[href] = title;
}
return found ? items : false;
}
function findItemType(doc, url) {
var itemType = text(doc, '.typdoc')
// do some preliminary cleaning
@@ -82,73 +101,64 @@ function findItemType(doc, url) {
else return "journalArticle";
}
function doWeb(doc, url) {
var articles = [];
if (detectWeb(doc, url) == "multiple") {
var items = {};
var titles = doc.evaluate('//strong/a[@data-original-title="Display the resource" or @data-original-title="Voir la ressource"]', doc, null, XPathResult.ANY_TYPE, null);
var title;
while ((title = titles.iterateNext())/* assignment */) {
items[title.href] = title.textContent;
async function doWeb(doc, url) {
if (detectWeb(doc, url) == 'multiple') {
let items = await Zotero.selectItems(getSearchResults(doc, false));
if (!items) return;
for (let url of Object.keys(items)) {
await scrape(await requestDocument(url));
}
Zotero.selectItems(items, function (items) {
if (!items) {
return true;
}
for (var i in items) {
articles.push(i);
}
Zotero.Utilities.processDocuments(articles, scrape);
return true;
});
}
else if (/\/document$/.test(url)) { // work on PDF pages
var articleURL = url.replace(/\/document$/, "");
// Z.debug(articleURL)
ZU.processDocuments(articleURL, scrape);
else {
await scrape(doc, url);
}
else scrape(doc, url);
}
function scrape(doc, url) {
async function scrape(doc, url = doc.location.href) {
if (/\/document$/.test(url)) { // work on PDF pages
var articleURL = url.replace(/\/document$/, "");
// Z.debug(articleURL)
await scrape(await requestDocument(articleURL));
return;
}
var bibtexUrl = url.replace(/#.+|\/$/, "") + "/bibtex";
var abstract = text(doc, '.abstract-content');
var pdfUrl = attr(doc, "#viewer-detailed a[download]", "href");
// Z.debug("pdfURL " + pdfUrl)
ZU.doGet(bibtexUrl, function (bibtex) {
// Z.debug(bibtex)
var translator = Zotero.loadTranslator("import");
translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4");
translator.setString(bibtex);
translator.setHandler("itemDone", function (obj, item) {
if (abstract) {
item.abstractNote = abstract.replace(/^(Abstract|Résumé)\s*:/, "");
}
if (pdfUrl) {
item.attachments = [{
url: pdfUrl,
title: "HAL PDF Full Text",
mimeType: "application/pdf"
}];
}
else {
item.attachments = [{
document: doc,
title: "HAL Snapshot",
mimeType: "text/html"
}];
}
let detectedType = detectWeb(doc, url);
if (detectedType == "artwork" || detectedType == "presentation") {
item.itemType = detectedType;
}
if (detectedType == 'presentation' && text(doc, 'div.label-POSTER')) {
item.presentationType = 'Poster';
}
item.complete();
});
translator.translate();
let bibtex = await requestText(bibtexUrl);
// Z.debug(bibtex)
var translator = Zotero.loadTranslator("import");
translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4");
translator.setString(bibtex);
translator.setHandler("itemDone", function (obj, item) {
if (abstract) {
item.abstractNote = abstract.replace(/^(Abstract|Résumé)\s*:/, "");
}
if (pdfUrl) {
item.attachments = [{
url: pdfUrl,
title: "HAL PDF Full Text",
mimeType: "application/pdf"
}];
}
else {
item.attachments = [{
document: doc,
title: "HAL Snapshot",
mimeType: "text/html"
}];
}
let detectedType = detectWeb(doc, url);
if (detectedType == "artwork" || detectedType == "presentation") {
item.itemType = detectedType;
}
if (detectedType == 'presentation' && text(doc, 'div.label-POSTER')) {
item.presentationType = 'Poster';
}
item.complete();
});
await translator.translate();
}
/** BEGIN TEST CASES **/
@@ -197,19 +207,20 @@ var testCases = [
"creatorType": "author"
},
{
"firstName": "F.",
"firstName": "Fernand",
"lastName": "Karcher",
"creatorType": "author"
}
],
"date": "March 2006",
"date": "2006-03",
"DOI": "10.5194/acp-6-1033-2006",
"abstractNote": "The MOZAIC programme collects ozone and water vapour data using automatic equipment installed on board five long-range Airbus A340 aircraft flying regularly all over the world since August 1994. Those measurements made between September 1994 and August 1996 allowed the first accurate ozone climatology at 912 km altitude to be generated. The seasonal variability of the tropopause height has always provided a problem when constructing climatologies in this region. To remove any signal from the seasonal and synoptic scale variability in tropopause height we have chosen in this further study of these and subsequent data to reference our climatology to the altitude of the tropopause. We define the tropopause as a mixing zone 30 hPa thick across the 2 pvu potential vorticity surface. A new ozone climatology is now available for levels characteristic of the upper troposphere (UT) and the lower stratosphere (LS) regardless of the seasonal variations of the tropopause over the period 19942003. Moreover, this new presentation has allowed an estimation of the monthly mean climatological ozone concentration at the tropopause showing a sine seasonal variation with a maximum in May (120 ppbv) and a minimum in November (65 ppbv). Besides, we present a first assessment of the inter-annual variability of ozone in this particular critical region. The overall increase in the UTLS is about 1%/yr for the 9 years sampled. However, enhanced concentrations about 1015 % higher than the other years were recorded in 1998 and 1999 in both the UT and the LS. This so-called \"19981999 anomaly\" may be attributed to a combination of different processes involving large scale modes of atmospheric variability, circulation features and local or global pollution, but the most dominant one seems to involve the variability of the North Atlantic Oscillation (NAO) as we find a strong positive correlation (above 0.60) between ozone recorded in the upper troposphere and the NAO index. A strong anti-correlation is also found between ozone and the extremes of the Northern Annular Mode (NAM) index, attributing the lower stratospheric variability to dynamical anomalies. Finally this analysis highlights the coupling between the troposphere, at least the upper one, and the stratosphere, at least the lower one.",
"issue": "4",
"itemID": "thouret:hal-00328427",
"libraryCatalog": "HAL Archives Ouvertes",
"pages": "1051",
"publicationTitle": "Atmospheric Chemistry and Physics",
"url": "https://hal.archives-ouvertes.fr/hal-00328427",
"url": "https://hal.science/hal-00328427",
"volume": "6",
"attachments": [
{
@@ -233,7 +244,7 @@ var testCases = [
"creators": [
{
"firstName": "Henry",
"lastName": "De Lumley",
"lastName": "de Lumley",
"creatorType": "author"
},
{
@@ -248,7 +259,7 @@ var testCases = [
"libraryCatalog": "HAL Archives Ouvertes",
"numPages": "637 p.",
"publisher": "Éditions Recherche sur les Civilisations",
"url": "https://hal.archives-ouvertes.fr/hal-00472553",
"url": "https://hal.science/hal-00472553",
"attachments": [
{
"title": "HAL Snapshot",
@@ -280,11 +291,12 @@ var testCases = [
"creatorType": "author"
}
],
"date": "March 2014",
"date": "2014-03",
"abstractNote": "It seems that the Caisse des Dépôts et Consignations in partnership with the Conference of University Presidents have well taken the measure of this inexorable trend. That is why it \"is committed to supporting higher education institutions\" in the definition and implementation of their digital strategy and wider support them in their efforts to modernize. \" It is indeed in this modernization process that the University of Haute Alsace is committed to registration by engaging in a project to build a Learning Centre. The objective of this project is the modernization and rationalization of these support teaching and research services. There has to work at UHA innovation process its accompanying device in teaching learning and research which it is likely that this change will not be without effect on profit actors are students but also teachers. This research report aims to provide some ideas for reflection to support accompanying the opening of the Learning Centre to encourage future users to operate the premises.",
"itemID": "coulibaly:hal-00973502",
"libraryCatalog": "HAL Archives Ouvertes",
"shortTitle": "Learning Centre de l'UHA",
"url": "https://hal.archives-ouvertes.fr/hal-00973502",
"url": "https://hal.science/hal-00973502",
"attachments": [
{
"title": "HAL PDF Full Text",
@@ -292,14 +304,30 @@ var testCases = [
}
],
"tags": [
"Bibliothèque universitaire",
"ICT appropriation",
"Learning Centre",
"Pedagogy",
"University Library",
"appropriation TICE",
"innovation",
"pédagogie universitaire"
{
"tag": "Bibliothèque universitaire"
},
{
"tag": "ICT appropriation"
},
{
"tag": "Learning Centre"
},
{
"tag": "Pedagogy"
},
{
"tag": "University Library"
},
{
"tag": "appropriation TICE"
},
{
"tag": "innovation"
},
{
"tag": "pédagogie universitaire"
}
],
"notes": [
{
@@ -324,23 +352,33 @@ var testCases = [
"creatorType": "author"
}
],
"date": "March 2012",
"abstractNote": "Description : Children performing for a crowd of passersby in a park in Kunming. (Enfants jouant dans un parc à Kunming Photo d'enfants jouant dans un parc à Kunming",
"date": "2012-03",
"abstractNote": "Children performing for a crowd of passersby in a park in Kunming. (Enfants jouant dans un parc à Kunming Photo d'enfants jouant dans un parc à Kunming",
"itemID": "gipouloux:medihal-00772952",
"libraryCatalog": "HAL Archives Ouvertes",
"url": "https://medihal.archives-ouvertes.fr/medihal-00772952",
"url": "https://media.hal.science/medihal-00772952",
"attachments": [
{
"title": "HAL PDF Full Text",
"mimeType": "application/pdf"
"title": "HAL Snapshot",
"mimeType": "text/html"
}
],
"tags": [
"China",
"Kunming",
"children",
"park",
"town"
{
"tag": "China"
},
{
"tag": "Kunming"
},
{
"tag": "children"
},
{
"tag": "park"
},
{
"tag": "town"
}
],
"notes": [],
"seeAlso": []
@@ -349,7 +387,7 @@ var testCases = [
},
{
"type": "web",
"url": "https://hal.archives-ouvertes.fr/search/index/q/%2A/docType_s/THESE/",
"url": "https://hal.science/search/index?q=test",
"items": "multiple"
},
{
@@ -370,8 +408,7 @@ var testCases = [
"abstractNote": "First results about[i] in vitro[/i] bud neoformation on haploid apple leaves. The impact of biotechnology in agriculture. The meeting point between fundamental and applied in vitro culture research",
"extra": "Published: The impact of biotechnology in agriculture. The meeting point between fundamental and applied in vitro culture research",
"itemID": "duron:hal-01600136",
"presentationType": "Poster",
"url": "https://hal.archives-ouvertes.fr/hal-01600136",
"url": "https://hal.science/hal-01600136",
"attachments": [
{
"title": "HAL PDF Full Text",
@@ -424,6 +461,76 @@ var testCases = [
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://theses.hal.science/tel-05056628",
"items": [
{
"itemType": "thesis",
"title": "Modélisation et simulation des impacts de gouttes et de sprays sur des surfaces liquides",
"creators": [
{
"firstName": "Syphax",
"lastName": "Fereka",
"creatorType": "author"
}
],
"date": "2025-01",
"abstractNote": "Sprays are ubiquitous in various industrial applications, such as combustion, surface coating, and system cooling. Understanding the dynamics associated with these phenomena is crucial for energy optimization and industrial safety. Several aspects warrant further study and comprehension. However, this thesis primarily focuses on the interactions between sprays and deep liquid substrates, with particular attention to the disturbance of the liquid substrate (deposition and re-ejection).Classical modeling approaches for spray/surface interactions, often based on experimental data or empirical extrapolations from isolated droplet impact data, have limitations when applied across a wide range of regimes (substrate quality, We, Re, etc.). To overcome these constraints, we use multiphase numerical simulations with the in-house code Fugu, employing direct numerical simulation (DNS) at the droplet scale. This methodology provides precise control over key parameters (impact velocity, polydispersity, etc.) and enables an in-depth analysis of the associated physical and statistical phenomena. This thesis presents: (1) a literature review on droplet and spray impacts, (2) details of the numerical methods used, (3) validation of simulations for cases involving isolated or multiple droplet impacts, and (4) results on spray impacts on thick liquid films under various impact regimes. This work paves the way for a deeper understanding of spray/substrate interaction phenomena and advances in their numerical modeling",
"itemID": "fereka:tel-05056628",
"libraryCatalog": "HAL Archives Ouvertes",
"thesisType": "Theses",
"university": "Université Gustave Eiffel",
"url": "https://theses.hal.science/tel-05056628",
"attachments": [
{
"title": "HAL PDF Full Text",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "Bubbles"
},
{
"tag": "Bulles"
},
{
"tag": "Drops"
},
{
"tag": "Gouttes"
},
{
"tag": "Multi-Scale"
},
{
"tag": "Multi-Échelle"
},
{
"tag": "Multiphase flow"
},
{
"tag": "Spray"
},
{
"tag": "Spray"
},
{
"tag": "Vof"
},
{
"tag": "Volume of fluid"
},
{
"tag": "Écoulement polyphasique"
}
],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,21 @@
{
"translatorID": "1b052690-16dd-431d-9828-9dc675eb55f6",
"translatorType": 4,
"label": "Papers Past",
"creator": "Philipp Zumstein and Abe Jellinek",
"creator": "Philipp Zumstein, Abe Jellinek, and Jason Murphy",
"target": "^https?://(www\\.)?paperspast\\.natlib\\.govt\\.nz/",
"minVersion": "3.0",
"maxVersion": "",
"minVersion": "5.0",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2021-07-12 17:17:15"
"lastUpdated": "2025-10-21 16:40:00"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2017-2021 Philipp Zumstein and Abe Jellinek
Copyright © 2025 Philipp Zumstein, Abe Jellinek, and Jason Murphy
This file is part of Zotero.
@@ -35,15 +35,14 @@
***** END LICENSE BLOCK *****
*/
function detectWeb(doc, url) {
if (/\/newspapers\/.+\.\d+\.\d+/.test(url)) {
return "newspaperArticle";
}
if (/[?&]query=/.test(url) && getSearchResults(doc, true)) {
return "multiple";
}
else if (ZU.xpathText(doc, '//h3[@itemprop="headline"]')) {
if (url.includes('/newspapers/')) {
return "newspaperArticle";
}
if (url.includes('/periodicals/')) {
return "journalArticle";
}
@@ -57,14 +56,13 @@ function detectWeb(doc, url) {
return false;
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = doc.querySelectorAll('.search-results .article-preview__title a');
for (var i = 0; i < rows.length; i++) {
var href = rows[i].href;
var title = ZU.trimInternal(rows[i].textContent);
for (let row of rows) {
var href = row.href;
var title = ZU.trimInternal(row.textContent);
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
@@ -73,31 +71,108 @@ function getSearchResults(doc, checkOnly) {
return found ? items : false;
}
function doWeb(doc, url) {
async function doWeb(doc, url) {
if (detectWeb(doc, url) == "multiple") {
Zotero.selectItems(getSearchResults(doc, false), function (items) {
if (!items) {
return;
}
var articles = [];
for (var i in items) {
articles.push(i);
}
ZU.processDocuments(articles, scrape);
});
let items = await Zotero.selectItems(getSearchResults(doc, false));
if (!items) return;
for (let url of Object.keys(items)) {
scrape(await requestDocument(url));
}
}
else {
scrape(doc, url);
}
}
function scrape(doc, url = doc.location.href) {
var type = detectWeb(doc, url);
if (type == "newspaperArticle") {
scrapeNewspaper(doc, url);
}
else if (type) {
scrapeLegacy(doc, url);
}
}
function scrape(doc, url) {
function scrapeNewspaper(doc, url) {
var item = new Zotero.Item("newspaperArticle");
var ld = getJSONLD(doc);
var news = null;
for (var i = 0; i < ld.length; i++) {
if (/NewsArticle|Article/i.test(ld[i]['@type'])) {
news = ld[i];
break;
}
}
var meta = collectMeta(doc);
var titles = [];
if (news && news.headline) {
titles.push(ZU.trimInternal(news.headline));
}
if (meta.hw.citation_title) {
titles.push(ZU.trimInternal(meta.hw.citation_title));
}
if (meta.dc["DC.title"]) {
titles.push(ZU.trimInternal(meta.dc["DC.title"]));
}
var rawTitle = dedupeFirst(titles);
item.title = fixTitleCase(rawTitle);
item.publicationTitle = (news && news.isPartOf && news.isPartOf.name)
|| meta.hw.citation_journal_title
|| meta.dc["DC.publisher"]
|| meta.dc["DC.source"]
|| "";
item.date = ZU.strToISO((news && news.datePublished) || meta.hw.citation_date || meta.dc["DC.date"] || "");
var pageStart = (news && news.pageStart) || meta.hw.citation_firstpage || "";
var pageEnd = (news && news.pageEnd) || meta.hw.citation_lastpage || "";
var pagesMeta = meta.hw.citation_pages || "";
item.pages = pagesFrom(pageStart, pageEnd, pagesMeta);
item.language = (news && news.inLanguage) || meta.hw.citation_language || meta.dc["DC.language"] || "";
item.rights = (news && news.copyrightNotice) || meta.dc["DC.rights"] || "";
var cleanUrl = canonicalURL(doc) || (news && news.url) || meta.hw.citation_fulltext_html_url || meta.dc["DC.source"] || url;
item.url = cleanUrl.split('?')[0].split('#')[0];
var bib = parseBibliographicDetails(doc);
if (!item.publicationTitle && bib.publicationTitle) {
item.publicationTitle = bib.publicationTitle;
}
if (!item.date && bib.date) {
item.date = ZU.strToISO(bib.date);
}
if (!item.pages && bib.pages) {
item.pages = bib.pages;
}
var vol = (news && news.isPartOf && news.isPartOf.volumeNumber ? String(news.isPartOf.volumeNumber) : "") || meta.hw.citation_volume || bib.volume || "";
var iss = (news && news.isPartOf && news.isPartOf.issueNumber ? String(news.isPartOf.issueNumber) : "") || meta.hw.citation_issue || bib.issue || "";
var extraParts = [];
if (vol) extraParts.push("Volume: " + vol);
if (iss) extraParts.push("Issue: " + iss);
if (extraParts.length > 0) {
item.extra = extraParts.join("\n");
}
item.creators = [];
item.attachments = [{
title: "Snapshot",
document: doc
}];
item.libraryCatalog = "Papers Past";
item.complete();
}
function scrapeLegacy(doc, url) {
var type = detectWeb(doc, url);
var item = new Zotero.Item(type);
var title = ZU.xpathText(doc, '//h3[@itemprop="headline"]/text()[1]');
item.title = ZU.capitalizeTitle(title.toLowerCase(), true);
var title = doc.querySelector('[itemprop="headline"]').firstChild.textContent;
item.title = fixTitleCase(title);
if (type == "journalArticle" || type == "newspaperArticle") {
var nav = doc.querySelectorAll('#breadcrumbs .breadcrumbs__crumb');
@@ -126,7 +201,6 @@ function scrape(doc, url) {
if (type == "letter") {
var author = ZU.xpathText(doc, '//div[@id="researcher-tools-tab"]//tr[td[.="Author"]]/td[2]');
// e.g. 42319/Mackay, James, 1831-1912
if (author && !author.includes("Unknown")) {
author = author.replace(/^[0-9/]*/, '').replace(/[0-9-]*$/, '').replace('(Sir)', '');
item.creators.push(ZU.cleanAuthor(author, "author"));
@@ -136,29 +210,32 @@ function scrape(doc, url) {
recipient = recipient.replace(/^[0-9/]*/, '').replace(/[0-9-]*$/, '').replace('(Sir)', '');
item.creators.push(ZU.cleanAuthor(recipient, "recipient"));
}
item.date = ZU.xpathText(doc, '//div[@id="researcher-tools-tab"]//tr[td[.="Date"]]/td[2]');
item.language = ZU.xpathText(doc, '//div[@id="researcher-tools-tab"]//tr[td[.="Language"]]/td[2]');
}
item.abstractNote = text(doc, '#tab-english');
item.url = ZU.xpathText(doc, '//div[@id="researcher-tools-tab"]/input/@value');
if (!item.url) item.url = text('#researcher-tools-tab p');
if (!item.url || !item.url.startsWith('http')) item.url = url;
if (!item.url) {
item.url = text(doc, '#researcher-tools-tab p');
}
if (!item.url || !item.url.startsWith('http')) {
item.url = url;
}
item.libraryCatalog = "Papers Past";
item.attachments.push({
title: "Snapshot",
document: doc
});
let imagePageURL = attr(doc, '.imagecontainer a', 'href');
var imagePageURL = attr(doc, '.imagecontainer a', 'href');
if (imagePageURL) {
ZU.processDocuments(imagePageURL, function (imageDoc) {
item.attachments.push({
title: 'Image',
mimeType: 'image/jpeg',
title: "Image",
mimeType: "image/jpeg",
url: attr(imageDoc, '.imagecontainer img', 'src')
});
item.complete();
@@ -169,6 +246,111 @@ function scrape(doc, url) {
}
}
function getJSONLD(doc) {
var out = [];
var nodes = doc.querySelectorAll('script[type="application/ld+json"]');
for (var i = 0; i < nodes.length; i++) {
try {
var data = JSON.parse(nodes[i].textContent);
if (Array.isArray(data)) {
for (var j = 0; j < data.length; j++) {
out.push(data[j]);
}
}
else if (data) {
out.push(data);
}
}
catch (e) {}
}
return out;
}
function collectMeta(doc) {
var hw = {};
var dc = {};
var metas = doc.querySelectorAll("meta[name]");
for (var i = 0; i < metas.length; i++) {
var name = metas[i].getAttribute("name");
var content = metas[i].getAttribute("content") || "";
if (!name) continue;
if (/^citation_/i.test(name)) {
if (name === "citation_author") {
if (!hw[name]) hw[name] = [];
hw[name].push(content);
}
else {
hw[name] = content;
}
continue;
}
if (/^DC\./.test(name) || /^dc\./.test(name)) {
dc[name.replace(/^dc\./, "DC.")] = content;
}
}
return { hw: hw, dc: dc };
}
function parseBibliographicDetails(doc) {
var textContent = text(doc, '#researcher-tools-tab .citation, .tabs-panel .citation, p.citation') || "";
var out = { publicationTitle: "", volume: "", issue: "", date: "", pages: "" };
if (!textContent) return out;
var pubMatch = textContent.match(/^\s*([^,]+),/);
if (pubMatch) out.publicationTitle = ZU.trimInternal(pubMatch[1]);
var volMatch = textContent.match(/Volume\s+([^,]+),/i);
if (volMatch) out.volume = ZU.trimInternal(volMatch[1]);
var issMatch = textContent.match(/Issue\s+([^,]+),/i);
if (issMatch) out.issue = ZU.trimInternal(issMatch[1]);
var dateMatch = textContent.match(/Issue\s+[^,]+,\s*([^,]+),\s*Page/i) || textContent.match(/,\s*([^,]+),\s*Page/i);
if (dateMatch) out.date = ZU.trimInternal(dateMatch[1]);
var pageMatch = textContent.match(/Page\s+([0-9A-Za-z-]+)/i);
if (pageMatch) out.pages = ZU.trimInternal(pageMatch[1]);
return out;
}
function dedupeFirst(arr) {
return arr.find(Boolean) || "";
}
function fixTitleCase(str) {
if (!str) return str;
var letters = str.replace(/[^A-Za-z]/g, "");
if (!letters) return str;
var uppers = (letters.match(/[A-Z]/g) || []).length;
var upperRatio = uppers / letters.length;
if (upperRatio > 0.6) {
return ZU.capitalizeTitle(str.toLowerCase(), true);
}
return str;
}
function pagesFrom(start, end, meta) {
var s = ZU.trimInternal(start);
var e = ZU.trimInternal(end);
var m = ZU.trimInternal(meta);
if (m) return m;
if (s && e && s !== e) return s + "-" + e;
if (s) return s;
return "";
}
function canonicalURL(doc) {
var link = doc.querySelector('link[rel="canonical"]');
if (link && link.href) return link.href;
var og = doc.querySelector('meta[property="og:url"]');
if (og && og.content) return og.content;
return "";
}
/** BEGIN TEST CASES **/
var testCases = [
{
@@ -185,9 +367,11 @@ var testCases = [
"title": "Coup in Argentina",
"creators": [],
"date": "1944-02-18",
"extra": "Volume: CXXXVII\nIssue: 41",
"libraryCatalog": "Papers Past",
"pages": "5",
"publicationTitle": "Evening Post",
"rights": "Stuff Ltd is the copyright owner for the Evening Post. You can reproduce in-copyright material from this newspaper for non-commercial use under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International licence (CC BY-NC-SA 4.0). This newspaper is not available for commercial use without the consent of Stuff Ltd. For advice on reproduction of out-of-copyright material from this newspaper, please refer to the Copyright guide.",
"url": "https://paperspast.natlib.govt.nz/newspapers/EP19440218.2.61",
"attachments": [
{
@@ -203,17 +387,19 @@ var testCases = [
},
{
"type": "web",
"url": "https://paperspast.natlib.govt.nz/newspapers/NZH19360721.2.73.1?query=argentina",
"url": "https://paperspast.natlib.govt.nz/newspapers/MT19390701.2.6.3",
"items": [
{
"itemType": "newspaperArticle",
"title": "La Argentina",
"title": "Inter-School Basketball And Rugby Football",
"creators": [],
"date": "1936-07-21",
"date": "1939-07-01",
"extra": "Volume: 64\nIssue: 153",
"libraryCatalog": "Papers Past",
"pages": "9",
"publicationTitle": "New Zealand Herald",
"url": "https://paperspast.natlib.govt.nz/newspapers/NZH19360721.2.73.1",
"pages": "2",
"publicationTitle": "Manawatu Times",
"rights": "Stuff Ltd is the copyright owner for the Manawatu Times. You can reproduce in-copyright material from this newspaper for non-commercial use under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International licence (CC BY-NC-SA 4.0). This newspaper is not available for commercial use without the consent of Stuff Ltd. For advice on reproduction of out-of-copyright material from this newspaper, please refer to the Copyright guide.",
"url": "https://paperspast.natlib.govt.nz/newspapers/MT19390701.2.6.3",
"attachments": [
{
"title": "Snapshot",
@@ -259,7 +445,7 @@ var testCases = [
"items": [
{
"itemType": "letter",
"title": "1 Page Written 19 Jun 1873 by James Mackay in Hamilton City to Sir Donald Mclean in Wellington",
"title": "1 page written 19 Jun 1873 by James Mackay in Hamilton City to Sir Donald McLean in Wellington",
"creators": [
{
"firstName": "Mackay",
@@ -292,6 +478,32 @@ var testCases = [
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://paperspast.natlib.govt.nz/parliamentary/AJHR1899-I.2.4.2.3",
"items": [
{
"itemType": "report",
"title": "Rabbits and Rabbitskins, Exported from Colony During Years 1894 to 1898, and Number and Value Thereof.",
"creators": [],
"libraryCatalog": "Papers Past",
"url": "https://paperspast.natlib.govt.nz/parliamentary/AJHR1899-I.2.4.2.3",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
},
{
"title": "Image",
"mimeType": "image/jpeg"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

View File

@@ -3,12 +3,12 @@
"translatorType": 4,
"label": "Prime 9ja Online",
"creator": "VWF",
"target": "^https?://(www\\.)?prime9ja\\.com\\.ng/\\d{4}/\\d{2}/[^/]+\\.html",
"target": "^https?://(www\\.|pidgin\\.)?prime9ja\\.com\\.ng/",
"minVersion": "5.0",
"maxVersion": null,
"priority": 100,
"inRepository": true,
"lastUpdated": "2025-08-08 17:40:00"
"lastUpdated": "2025-10-24 19:45:00"
}
/*
@@ -34,38 +34,66 @@
***** END LICENSE BLOCK *****
*/
function detectWeb(doc, _url) {
let jsonLdNodes = doc.querySelectorAll('script[type="application/ld+json"]');
for (let node of jsonLdNodes) {
function meta(doc, nameOrProp) {
let m = doc.querySelector('meta[property="' + nameOrProp + '"]')
|| doc.querySelector('meta[name="' + nameOrProp + '"]');
return m ? m.getAttribute('content') : '';
}
function parseJSONLD(doc) {
let nodes = doc.querySelectorAll('script[type="application/ld+json"]');
for (let node of nodes) {
let txt = node.textContent.trim();
if (!txt) continue;
try {
let data = JSON.parse(node.textContent);
let type = data['@type'];
if (typeof type === 'string' && type.endsWith('NewsArticle')) {
return 'newspaperArticle';
let parsed = JSON.parse(txt);
let candidates = [];
if (Array.isArray(parsed)) {
candidates = parsed;
}
if (Array.isArray(type) && type.some(t => typeof t === 'string' && t.endsWith('NewsArticle'))) {
return 'newspaperArticle';
else if (parsed['@graph'] && Array.isArray(parsed['@graph'])) {
candidates = parsed['@graph'];
}
else if (parsed.mainEntity) {
candidates = [parsed.mainEntity, parsed];
}
else {
candidates = [parsed];
}
for (let cand of candidates) {
if (!cand) continue;
let t = cand['@type'] || cand.type;
if (!t) continue;
if (typeof t === 'string') {
if (t.includes('NewsArticle')) {
return cand;
}
}
else if (Array.isArray(t)) {
for (let tt of t) {
if (typeof tt === 'string' && tt.includes('NewsArticle')) {
return cand;
}
}
}
}
}
catch (e) {
// ignore JSON parsing errors
// ignore malformed JSON-LD
}
}
if (getSearchResults(doc, true)) {
return 'multiple';
}
return false;
return null;
}
function getSearchResults(doc, checkOnly) {
let items = {};
let found = false;
let rows = doc.querySelectorAll('a.entry-title[href*="/202"]');
// generic year pattern in path for article links
let rows = doc.querySelectorAll('a[href*="/20"]');
for (let row of rows) {
let href = row.href;
let title = ZU.trimInternal(row.textContent);
let title = ZU.trimInternal(row.textContent || row.title || '');
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
@@ -74,66 +102,186 @@ function getSearchResults(doc, checkOnly) {
return found ? items : false;
}
async function doWeb(doc, url) {
if (detectWeb(doc, url) === 'multiple') {
let items = await Zotero.selectItems(getSearchResults(doc, false));
if (!items) return;
for (let url of Object.keys(items)) {
await scrape(await requestDocument(url));
}
}
else {
await scrape(doc, url);
}
function isIndexURL(url) {
return url && url.includes('/search/label/');
}
async function scrape(doc, url = doc.location.href) {
let item = new Zotero.Item('newspaperArticle');
let jsonLdNodes = doc.querySelectorAll('script[type="application/ld+json"]');
let data = null;
function detectWeb(doc, url) {
url = url || doc.location.href;
for (let node of jsonLdNodes) {
try {
let parsed = JSON.parse(node.textContent);
let type = parsed['@type'];
if (
type && typeof type === 'string' && type.endsWith('NewsArticle')
|| Array.isArray(type) && type.some(t => typeof t === 'string' && t.endsWith('NewsArticle'))
) {
data = parsed;
break;
}
}
catch (e) {}
// 1) JSON-LD NewsArticle -> single article
let j = parseJSONLD(doc);
if (j) {
return 'newspaperArticle';
}
if (data) {
item.title = ZU.unescapeHTML(data.headline || text(doc, 'h1.entry-title'));
item.ISSN = '3092-8907';
item.abstractNote = ZU.unescapeHTML(data.description || '');
item.date = data.datePublished || '';
item.language = data.inLanguage || 'en';
item.url = data.url || url;
item.publicationTitle = (data.publisher && data.publisher.name) || 'Prime 9ja Online';
item.place = 'Nigeria';
// 2) explicit index/list URL
if (isIndexURL(url)) {
return 'multiple';
}
// 3) Use the standard getSearchResults() heuristic for listing pages
if (getSearchResults(doc, true)) {
// If page also clearly looks like an article, prefer article
if (meta(doc, 'article:published_time') || meta(doc, 'og:type') || text(doc, 'h1.entry-title') || doc.querySelector('[itemprop="articleBody"]')) {
return 'newspaperArticle';
}
return 'multiple';
}
// 4) meta-based hints
if (meta(doc, 'article:published_time')) {
return 'newspaperArticle';
}
let ogType = (meta(doc, 'og:type') || '').toLowerCase();
if (ogType === 'article') {
return 'newspaperArticle';
}
// 5) fallback selectors
if (text(doc, 'h1.entry-title')
|| text(doc, 'h1.s-title')
|| doc.querySelector('[itemprop="articleBody"]')
|| doc.querySelector('article.post')) {
return 'newspaperArticle';
}
return false;
}
async function doWeb(doc, url) {
url = url || doc.location.href;
let mode = detectWeb(doc, url);
if (mode === 'multiple') {
let items = getSearchResults(doc, false);
if (!items) return;
let selected = await Zotero.selectItems(items);
if (!selected) return;
for (let u of Object.keys(selected)) {
await scrape(await requestDocument(u));
}
}
else if (mode === 'newspaperArticle') {
await scrape(doc, url);
}
// else do nothing
}
async function scrape(doc, url) {
url = url || doc.location.href;
let item = new Zotero.Item('newspaperArticle');
let data = parseJSONLD(doc);
// If JSON-LD present, prefer it
if (data) {
item.title = ZU.unescapeHTML(
data.headline
|| data.name
|| meta(doc, 'og:title')
|| text(doc, 'h1.entry-title')
|| text(doc, 'h1.s-title')
|| ''
);
item.abstractNote = ZU.unescapeHTML(
data.description
|| meta(doc, 'og:description')
|| ''
);
item.url = data.url || meta(doc, 'og:url') || url;
item.language = data.inLanguage || meta(doc, 'og:locale') || 'en';
// --- date: use ZU.strToISO() to normalize if possible ---
let rawJsonDate = data.datePublished || data.dateCreated || '';
if (rawJsonDate) {
// Prefer Zotero's normalization (handles many formats and keeps timezone when present)
let isoFromZU = ZU.strToISO(rawJsonDate);
if (isoFromZU) {
item.date = isoFromZU;
}
else {
// if ZU couldn't parse, keep raw (often already ISO with TZ)
item.date = rawJsonDate;
}
}
// --- authors from JSON-LD (skip organisations) ---
if (data.author) {
if (Array.isArray(data.author)) {
for (let author of data.author) {
if (author.name) {
item.creators.push(ZU.cleanAuthor(author.name, 'author'));
let authors = Array.isArray(data.author) ? data.author : [data.author];
for (let a of authors) {
let name = (a && (a.name || a['@name'] || a)) || '';
if (name) {
let lower = name.toString().toLowerCase();
if (/news agency|agency|news desk|publish desk|prime 9ja|prime9ja|online media|media|staff|bureau/i.test(lower)) {
// skip org-like bylines
}
else {
item.creators.push(ZU.cleanAuthor(name.toString(), 'author'));
}
}
}
else if (data.author.name) {
item.creators.push(ZU.cleanAuthor(data.author.name, 'author'));
}
}
// DOM/meta fallbacks for anything missing
if (!item.title || !item.title.trim()) {
item.title = ZU.unescapeHTML(
meta(doc, 'og:title')
|| text(doc, 'h1.entry-title')
|| text(doc, 'h1.s-title')
|| text(doc, 'title')
|| ''
);
}
if (!item.abstractNote || !item.abstractNote.trim()) {
item.abstractNote = ZU.unescapeHTML(
meta(doc, 'og:description')
|| meta(doc, 'description')
|| ''
);
}
// If date still empty, try article:published_time meta (often ISO)
if (!item.date || !item.date.trim()) {
let metaDate = meta(doc, 'article:published_time');
if (metaDate) {
let isoDate = ZU.strToISO(metaDate);
if (isoDate) {
item.date = isoDate;
}
else {
item.date = metaDate;
}
}
else {
let authorText = text(doc, 'span[itemprop="name"]');
if (authorText) {
item.creators.push(ZU.cleanAuthor(authorText, 'author'));
}
}
if (!item.url || !item.url.trim()) {
item.url = meta(doc, 'og:url') || url;
}
if (!item.publicationTitle) {
item.publicationTitle = 'Prime 9ja Online';
}
if (!item.ISSN) {
item.ISSN = '3092-8907';
}
// If no creators yet, try common DOM byline selectors (skip org-like)
if (item.creators.length === 0) {
let cand = meta(doc, 'article:author')
|| text(doc, '.meta-author-author')
|| text(doc, '.meta-author')
|| text(doc, '.author-name')
|| text(doc, '.byline a')
|| text(doc, '.meta-el.meta-author a');
if (cand && !/news agency|agency|news desk|publish desk|prime 9ja|prime9ja|online media|media|staff|bureau/i.test(cand.toLowerCase())) {
item.creators.push(ZU.cleanAuthor(cand, 'author'));
}
}
@@ -142,6 +290,8 @@ async function scrape(doc, url = doc.location.href) {
title: 'Snapshot'
});
item.place = 'Nigeria';
item.complete();
}
@@ -161,10 +311,9 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2025-05-24T18:10:00+01:00",
"date": "2025-05-24",
"ISSN": "3092-8907",
"abstractNote": "AKURE —  The Ondo State Governorship Election Petitions Tribunal will deliver its verdict on June 4 in the series of suits challenging the election of Governor Lucky Aiyedatiwa, who emerged victorious in the last gubernatorial poll. Justice Benson Ogbu, wh…",
"language": "en",
"abstractNote": "AKURE —  The Ondo State Governorship Election Petitions Tribunal will deliver its verdict on June 4 in the series of suits challenging the e...",
"libraryCatalog": "Prime 9ja Online",
"place": "Nigeria",
"publicationTitle": "Prime 9ja Online",
@@ -195,10 +344,9 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2025-05-27T01:11:00+01:00",
"date": "2025-05-27",
"ISSN": "3092-8907",
"abstractNote": "On “CFMF” — the fourth track from Davidos 2025 album 5ive —\n the artist trades club-ready bravado for inward reflection. Featuring\n songwriting contributions from DIENDE and Victony, the track is a slow,\n measured entry in the Afro-R&B lane, b…",
"language": "en",
"abstractNote": "On “CFMF” — the fourth track from Davidos 2025 album 5ive the artist trades club-ready bravado for inward reflection. Featuri...",
"libraryCatalog": "Prime 9ja Online",
"place": "Nigeria",
"publicationTitle": "Prime 9ja Online",
@@ -230,10 +378,9 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2025-05-23T22:38:00+01:00",
"date": "2025-05-23",
"ISSN": "3092-8907",
"abstractNote": "ABUJA — A major network of cybercriminals allegedly responsible for infiltrating the Computer-Based Testing (CBT) infrastructure of Nigerias national examinations has been dismantled, with over 20 suspects currently in custody, security officials have c…",
"language": "en",
"abstractNote": "ABUJA — A major network of cybercriminals allegedly responsible for infiltrating the Computer-Based Testing (CBT) infrastructure of Nigeria...",
"libraryCatalog": "Prime 9ja Online",
"place": "Nigeria",
"publicationTitle": "Prime 9ja Online",
@@ -250,40 +397,6 @@ var testCases = [
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.prime9ja.com.ng/2025/03/china-begins-trial-of-mrna-tb-vaccine.html",
"items": [
{
"itemType": "newspaperArticle",
"title": "China Begins Trial of mRNA TB Vaccine",
"creators": [
{
"firstName": "News Agency of",
"lastName": "Nigeria",
"creatorType": "author"
}
],
"date": "2025-03-24T16:58:00+01:00",
"ISSN": "3092-8907",
"abstractNote": "A newly developed mRNA vaccine for tuberculosis, created in China, has entered clinical trials at Beijing Chest Hospital. The trial, which commenced on Monday, marks a significant step in the countrys efforts to combat tuberculosis, according to the Bei…",
"language": "en",
"libraryCatalog": "Prime 9ja Online",
"place": "Nigeria",
"publicationTitle": "Prime 9ja Online",
"url": "https://www.prime9ja.com.ng/2025/03/china-begins-trial-of-mrna-tb-vaccine.html",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

View File

@@ -9,7 +9,7 @@
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2025-09-17 16:40:00"
"lastUpdated": "2025-11-06 20:40:00"
}
/*
@@ -59,7 +59,7 @@ function doWeb(doc, url) {
}
var pmcids = [];
for (var i in ids) {
pmcids.push(i.replace("PMC", ""));
pmcids.push(i);
}
lookupPMCIDs(pmcids);
return true;
@@ -86,7 +86,7 @@ function doWeb(doc, url) {
}
function getPMCID(url) {
var pmcid = url.match(/\/articles\/PMC([\d]+)/);
var pmcid = url.match(/\/articles\/(PMC[\d]+)/);
return pmcid ? pmcid[1] : false;
}
@@ -104,8 +104,7 @@ function getSearchResults(doc, checkOnly) {
let href = row.href;
let title = ZU.trimInternal(row.textContent);
if (!href || !title) continue;
// Prefix with PMC to stop the keys from being sorted numerically...
let pmcid = "PMC" + getPMCID(href);
let pmcid = getPMCID(href);
if (!pmcid) continue;
if (checkOnly) return true;
found = true;
@@ -137,10 +136,11 @@ function lookupPMCIDs(ids, pdfLink) {
}
}
for (var i in articles) {
var i
for (let articleOuter of articles) {
var newItem = new Zotero.Item("journalArticle");
var journal = ZU.xpath(articles[i], 'front/journalmeta');
var journal = ZU.xpath(articleOuter, 'front/journalmeta');
newItem.journalAbbreviation = ZU.xpathText(journal, 'journalid[@journalidtype="nlmta"]');
@@ -160,14 +160,14 @@ function lookupPMCIDs(ids, pdfLink) {
newItem.ISSN = issn;
}
var article = ZU.xpath(articles[i], 'front/articlemeta');
var articleMeta = ZU.xpath(articleOuter, 'front/articlemeta');
var abstract;
if ((abstract = ZU.xpathText(article, 'abstract/p'))) {
if ((abstract = ZU.xpathText(articleMeta, 'abstract/p'))) {
newItem.abstractNote = abstract;
}
else {
var abstractSections = ZU.xpath(article, 'abstract/sec');
var abstractSections = ZU.xpath(articleMeta, 'abstract/sec');
abstract = [];
for (const j in abstractSections) {
abstract.push(ZU.xpathText(abstractSections[j], 'title') + "\n" + ZU.xpathText(abstractSections[j], 'p'));
@@ -175,18 +175,20 @@ function lookupPMCIDs(ids, pdfLink) {
newItem.abstractNote = abstract.join("\n\n");
}
newItem.DOI = ZU.xpathText(article, 'articleid[@pubidtype="doi"]');
newItem.DOI = ZU.xpathText(articleMeta, 'articleid[@pubidtype="doi"]');
newItem.extra = "PMID: " + ZU.xpathText(article, 'articleid[@pubidtype="pmid"]') + "\n";
newItem.extra = newItem.extra + "PMCID: PMC" + ids[i];
newItem.extra = "PMID: " + ZU.xpathText(articleMeta, 'articleid[@pubidtype="pmid"]') + "\n";
newItem.title = ZU.trim(ZU.xpathText(article, 'titlegroup/articletitle'));
var pmcid = ZU.xpathText(articleMeta, 'articleid[@pubidtype="pmcid"]');
newItem.extra = newItem.extra + "PMCID: " + pmcid;
newItem.title = ZU.trim(ZU.xpathText(articleMeta, 'titlegroup/articletitle'));
newItem.volume = ZU.xpathText(article, 'volume');
newItem.issue = ZU.xpathText(article, 'issue');
newItem.volume = ZU.xpathText(articleMeta, 'volume');
newItem.issue = ZU.xpathText(articleMeta, 'issue');
var lastPage = ZU.xpathText(article, 'lpage');
var firstPage = ZU.xpathText(article, 'fpage');
var lastPage = ZU.xpathText(articleMeta, 'lpage');
var firstPage = ZU.xpathText(articleMeta, 'fpage');
if (firstPage && lastPage && (firstPage != lastPage)) {
newItem.pages = firstPage + "-" + lastPage;
}
@@ -195,13 +197,13 @@ function lookupPMCIDs(ids, pdfLink) {
}
// use elocationid where we don't have itemIDs
if (!newItem.pages) {
newItem.pages = ZU.xpathText(article, 'elocationid');
newItem.pages = ZU.xpathText(articleMeta, 'elocationid');
}
var pubDate = ZU.xpath(article, 'pubdate[@pubtype="ppub"]');
var pubDate = ZU.xpath(articleMeta, 'pubdate[@pubtype="ppub"]');
if (!pubDate.length) {
pubDate = ZU.xpath(article, 'pubdate[@pubtype="epub"]');
pubDate = ZU.xpath(articleMeta, 'pubdate[@pubtype="epub"]');
}
if (pubDate) {
if (ZU.xpathText(pubDate, 'day')) {
@@ -215,9 +217,9 @@ function lookupPMCIDs(ids, pdfLink) {
}
}
var contributors = ZU.xpath(article, 'contribgroup/contrib');
var contributors = ZU.xpath(articleMeta, 'contribgroup/contrib');
if (contributors) {
var authors = ZU.xpath(article, 'contribgroup/contrib[@contribtype="author"]');
var authors = ZU.xpath(articleMeta, 'contribgroup/contrib[@contribtype="author"]');
for (const j in authors) {
var lastName = ZU.xpathText(authors[j], 'name/surname');
var firstName = ZU.xpathText(authors[j], 'name/givennames');
@@ -231,7 +233,7 @@ function lookupPMCIDs(ids, pdfLink) {
}
}
var linkurl = "https://pmc.ncbi.nlm.nih.gov/articles/PMC" + ids[i] + "/";
var linkurl = "https://pmc.ncbi.nlm.nih.gov/articles/" + pmcid + "/";
newItem.url = linkurl;
newItem.attachments = [{
url: linkurl,
@@ -243,10 +245,10 @@ function lookupPMCIDs(ids, pdfLink) {
let pdfFileName;
if (pdfLink) {
Zotero.debug("Got PDF link from page");
pdfFileName = pdfLink[ids[i]];
pdfFileName = pdfLink[pmcid];
}
else {
pdfFileName = `https://pmc.ncbi.nlm.nih.gov/articles/PMC${ids[i]}/pdf`;
pdfFileName = `https://pmc.ncbi.nlm.nih.gov/articles/${pmcid}/pdf`;
}
if (pdfFileName) {
@@ -318,16 +320,16 @@ var testCases = [
"libraryCatalog": "PubMed Central",
"pages": "37",
"publicationTitle": "Respiratory Research",
"url": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2377243/",
"url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC2377243/",
"volume": "9",
"attachments": [
{
"title": "PubMed Central Link",
"title": "Catalog Page",
"mimeType": "text/html",
"snapshot": false
},
{
"title": "PubMed Central Full Text PDF",
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
@@ -406,16 +408,16 @@ var testCases = [
"libraryCatalog": "PubMed Central",
"pages": "2767-2777",
"publicationTitle": "Statistics in medicine",
"url": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3139813/",
"url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC3139813/",
"volume": "30",
"attachments": [
{
"title": "PubMed Central Link",
"title": "Catalog Page",
"mimeType": "text/html",
"snapshot": false
},
{
"title": "PubMed Central Full Text PDF",
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
@@ -474,16 +476,16 @@ var testCases = [
"libraryCatalog": "PubMed Central",
"pages": "e8653",
"publicationTitle": "PLoS ONE",
"url": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2801612/",
"url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC2801612/",
"volume": "5",
"attachments": [
{
"title": "PubMed Central Link",
"title": "Catalog Page",
"mimeType": "text/html",
"snapshot": false
},
{
"title": "PubMed Central Full Text PDF",
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],
@@ -538,16 +540,16 @@ var testCases = [
"pages": "88-102",
"publicationTitle": "Immunological Reviews",
"shortTitle": "The human immune response to tuberculosis and its treatment",
"url": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4368415/",
"url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC4368415/",
"volume": "264",
"attachments": [
{
"title": "PubMed Central Link",
"title": "Catalog Page",
"mimeType": "text/html",
"snapshot": false
},
{
"title": "PubMed Central Full Text PDF",
"title": "Full Text PDF",
"mimeType": "application/pdf"
}
],

View File

@@ -9,7 +9,7 @@
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2024-07-22 19:10:00"
"lastUpdated": "2025-11-06 16:05:00"
}
/*
@@ -35,9 +35,10 @@
***** END LICENSE BLOCK *****
*/
// eslint-disable-next-line no-unused-vars
const ID_RE = /\/search\/(\d+)/;
function detectWeb(doc, url) {
if (doc.querySelector('.artwork-details')) {
if (ID_RE.test(url)) {
return 'artwork';
}
else if (getSearchResults(doc, true)) {
@@ -79,56 +80,28 @@ async function doWeb(doc, url) {
// eslint-disable-next-line no-unused-vars
async function scrape(doc, url = doc.location.href) {
let id = url.match(ID_RE)[1];
let json = await requestJSON(`https://collectionapi.metmuseum.org/public/collection/v1/objects/${id}`);
let item = new Zotero.Item('artwork');
item.title = text(doc, '.artwork__title--text');
let meta = doc.querySelectorAll('.artwork-tombstone--item');
for (let elem of meta) {
let heading = text(elem, '.artwork-tombstone--label');
heading = heading.toLowerCase().substr(0, heading.length - 1);
let content = text(elem, '.artwork-tombstone--value');
// Z.debug(heading + content);
switch (heading) {
case 'date':
case 'medium':
item[heading] = content;
break;
case 'dimensions':
item.artworkSize = content;
break;
case 'accession number':
item.callNumber = content;
break;
case 'classification':
case 'period':
case 'culture':
item.tags.push(content);
break;
case 'artist': {
let cleaned = content.replace(/\(.*\)$/, '').trim();
if (cleaned.split(' ').length > 2) {
item.creators.push({ lastName: content, creatorType: 'artist', fieldMode: 1 });
}
else {
item.creators.push(ZU.cleanAuthor(cleaned, "artist"));
}
break;
}
}
}
item.abstractNote = text(doc, '.artwork__intro__desc');
item.title = json.title;
item.date = json.objectDate;
item.artworkMedium = json.medium;
item.artworkSize = json.dimensions;
item.callNumber = json.accessionNumber;
item.tags = [json.classification, json.period, json.culture]
.filter(Boolean)
.map(tag => ({ tag }));
item.creators.push(ZU.cleanAuthor(json.artistAlphaSort, 'artist', true));
item.abstractNote = text(doc, '[class^="object-overview_label"] span');
item.libraryCatalog = 'The Metropolitan Museum of Art';
item.url = attr(doc, 'link[rel="canonical"]', 'href');
item.url = `https://www.metmuseum.org/art/collection/search/${id}`;
// Non-open-access items still have the (invisible) download button with seemingly valid, but 404-ing, URL.
// Filter those out via the "not-openaccess" class set on the <section/> containing the button.
let download = attr(doc, 'section:not(.artwork--not-openaccess) .artwork__interaction--download a', 'href');
if (download) {
if (json.primaryImage) {
item.attachments.push({
title: 'Met Image',
url: download
title: 'Image',
mimeType: 'image/jpeg',
url: json.primaryImage
});
}
item.attachments.push({
@@ -158,7 +131,8 @@ var testCases = [
"url": "https://www.metmuseum.org/art/collection/search/328877",
"attachments": [
{
"title": "Met Image"
"title": "Image",
"mimeType": "image/jpeg"
},
{
"title": "Snapshot",
@@ -195,7 +169,8 @@ var testCases = [
"url": "https://www.metmuseum.org/art/collection/search/328877",
"attachments": [
{
"title": "Met Image"
"title": "Image",
"mimeType": "image/jpeg"
},
{
"title": "Snapshot",
@@ -238,7 +213,8 @@ var testCases = [
"url": "https://www.metmuseum.org/art/collection/search/436243",
"attachments": [
{
"title": "Met Image"
"title": "Image",
"mimeType": "image/jpeg"
},
{
"title": "Snapshot",

View File

@@ -9,7 +9,7 @@
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2024-12-03 16:00:00"
"lastUpdated": "2025-11-12 15:50:00"
}
/*
@@ -388,7 +388,8 @@ function parseSingleEntry(entry) {
.filter(Boolean);
newItem.tags.push(...categories);
let arxivURL = text(entry, "id").replace(/v\d+/, '');
let versionedArXivURL = text(entry, "id");
let arxivURL = versionedArXivURL.replace(/v\d+/, '');
let doi = text(entry, "doi");
if (doi) {
newItem.DOI = doi;
@@ -407,7 +408,7 @@ function parseSingleEntry(entry) {
newItem.extra = "arXiv:" + articleID + " " + articleField;
}
let pdfURL = attr(entry, "link[title='pdf']", "href");
let pdfURL = versionedArXivURL.replace("/abs/", "/pdf/");
newItem.attachments.push({
title: "Preprint PDF",

View File

@@ -9,13 +9,13 @@
"priority": 100,
"inRepository": true,
"browserSupport": "gcsibv",
"lastUpdated": "2024-07-22 19:10:00"
"lastUpdated": "2025-10-20 16:20:00"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2010-2023 Jonas Schrieb and contributors
Copyright © 2010-2025 Jonas Schrieb and contributors
This file is part of Zotero.
@@ -154,7 +154,7 @@ async function scrape(doc, url = doc.location.href) {
case "ps":
// There are entries where a format button is present, but the URL points to the ePrint home page
if (format.href.slice(-3) != ".ps") continue;
attachment.mimeType = "application/ps";
attachment.mimeType = "application/postscript";
break;
default:
// For security reasons, avoid adding unknown formats (allowlist approach)
@@ -520,7 +520,7 @@ var testCases = [
"url": "https://eprint.iacr.org/2002/195",
"attachments": [
{
"mimeType": "application/ps",
"mimeType": "application/postscript",
"title": "Full Text PS"
}
],
@@ -580,7 +580,7 @@ var testCases = [
"title": "Full Text PDF"
},
{
"mimeType": "application/ps",
"mimeType": "application/postscript",
"title": "Full Text PS"
}
],

Binary file not shown.

BIN
zotero.sqlite-journal Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.