IDE@L version 1.0 “Image DEndrochronology @ Liama” Joseph Morlier1*, Thierry Fourcaud2 LRBB,UMR 5103, CNRS/INRA/Université Bordeaux 1, domaine de l’Hermitage, 69 route d’Arcachon, 33612 Cestas cedex, France 2 LIAMA-CASIA, Institute of Automation Chinese Academy of Sciences, PB 2728, Beijing 100080, P.R. CHINA 1 Abstract: IDE@L is a toolbox for Matlab dealing with Tree rings detection by image processing. This is a Graphical User Interface (GUI) which can help wood scientists in extracting tree rings coordinates. Version 1.0 runs under Matlab 65 (R13) and needs image processing toolbox for “Canny” edge detection. The outputs are detected rings coordinates (.xls) which can be used by FEM software. Keywords: Tree rings, image processing, morphological segmentation, pixel labelling, finite element reconstruction. Aknowledgements: The MATLAB Central File Exchange, http://www.mathworks.com/matlabcentral/fileexchange, which contains thousands of files contributed by users and developers of MATLAB, Simulink and related products. Some of these toolboxes files are a compilation of MATLAB Central files. MATLAB and Octave Functions for Computer Vision and Image Processing, http://www.csse.uwa.edu.au/~pk/research/matlabfns/ by Peter Kovesi (School of Computer Science & Software Engineering, The University of Western Australia,Crawley, Western Autralia. 6009). Chapter Edge linking and line segment fitting. Henri D. Grissino-Mayer's Ultimate Tree-Ring Web Pages, http://web.utk.edu/~grissino/gallery.htm for original tree rings images support. IDE@L Matlab Toolbox • Description • Requirements • FAQ • Functions List • Tutorial #1 *contact: jmorlier@lrbb.u-bordeaux.fr Description Matlab is a commercial software package for numeric computation, graphics, visualization, and high-level programming. Matlab is available from The MathWorks, Inc. The basic Matlab package has many functions generally useful for tree-ring studies. Matlab "toolboxes" with specialized functions can also purchased from The MathWorks, Inc. Toolboxes are available for signal processing, mapping, image processing, neural networks, statistics, and many other topics. Many additional userwritten functions are available over the Web. One excellent source is http://www.mathtools.net. The "IDE@L" is not a commercially available Matlab toolbox Requirements To use the IDE@L Toolbox, you must have Matlab (version 5.3 or later) installed on your computer or network. Depending on which functions you intend to use, you may also need to have one or more "Matlab toolboxes" (e.g. image for edge detection) installed. Note: The code for canny's edge detector is from Matlab 6.5's image processing toolbox. To use the IDE@L Toolbox, you must also have its toolbox functions in a directory on your Matlab path. FAQ: Why the analysis is very long sometimes ? For high resolution image (1.jpg ~100 ko or 535x545 pixels) the analysis will take several minutes and few seconds for low resolution (mini1.jpg~20 ko or 267x272 pixels) but less ring can be detected ... Why using Canny method for edge detection? The Canny method finds edges by looking for local maxima of the gradient of I. The gradient is calculated using the derivative of a Gaussian filter. The method uses two thresholds, to detect strong and weak edges, and includes the weak edges in the output only if they are connected to strong edges. This method is therefore less likely than the others to be "fooled" by noise, and more likely to detect true weak edges. Default threshold is: [0.1 0.2] For more details try [0.1 0.15] For high details [0.05 0.1] Figure 1: Maxima above value 25 of rings indicator are detected How works partial reconstruction of Rings ? Just pick interested points of a the ring and finished with ‘e’ on the keyboard. Then an excel sheet appears with your data. Copy and paste ...or save. ... left-click : Mark a point 'e' : End No wavelets ?? Curvelets ?? for edge detection Not at this time ... List of Functions IDEAL/ File: IDE@L.doc Directory: IMAGES File: Ring_label2.m File: Ring_label_save.m File: ait_imneg.m File: loadfile.m File: IDEAL_gui.m File: edge_parameter.m File: edgelink.m File: maxlinedev.m File: mergeseg.m File: perimeter_parameter.m File: xlswrite.m File: Ring_Reconstruction.m How classified rings from curvature of labelled region? Each extracted labelled region are threshold by an indicator of ring curvature (second derivative) Rings Indicators length( ) a “circular like” ring. to see if this region is really Empirical value for “circle like” ring indicator is 25 (Figure 1) Try 10 or less to detect more rings! *contact: jmorlier@lrbb.u-bordeaux.fr List of Functions not yet implemented Processing Menu: 'Del False Ring ', ... 'Del Double Ring ', ... 47 KB 760KB 2 KB 2 KB 2 KB 1 KB 3 KB 1 KB 8 KB 3 KB 6 KB 1 KB 5 KB 1 KB Tutorial #1 The best way of describing this code is by way of example. To find out what's in the IDE@L Matlab Toolbox, check out the list of functions. From the processing menu, you can pick manually the interested ring, an excel sheet open with the extracted data. Type on matlab prompt >> IDEAL_gui From the File menu, load an image, for example mini3.jpg in the image directory (CTRL+F). From the Analysis menu, Ring, Ring Detection (CTRL+R analysis with default parameters). You obtain 9 detected rings (Figure 2, R1 to R9), that you can save with the menu export data to excel (CTRL+S). If the you know the real size of the image, enter in the expected zone. Figure 4: In red picked points with the mouse Don’t forget to add the partial ring reconstruction data in the saved file ! Problems #1 For saving the data in case of 2 steps detection (change in parameters between 2 analysis) a problem occurs: ??? Improper assignment with rectangular empty matrix. Figure 2: detected rings with default parameters Now you can clear the interface (CTRL+A) and setup the analysis with better threshold for edge detection: Setup edge detection (CTRL+D): [0.05 0.1] The new detected rings are numbered from R10 to R28 (Figure 3). See problem #1 for saving data. Error in ==> e:\matlab\work\IDEAL\Ring_export.m On line 16 ==> mp(j)=max(find(m1(:,1)~=0)); Relaunch the GUI, setup the good parameters, launch the analysis (only one step) and then the data will be saved with no problems. #2 The exported data are completed with zero in last rings detected. In excel you could do Selected the rows Data > Filter > Automatic Personnalised Different to : select 0 *** Future works will be to correct bugs, improve detection (curvelets...) and to develop IDE@L for Scilab and Matlab. *** Figure 3: More detected rings with high details for edge detection *contact: jmorlier@lrbb.u-bordeaux.fr