User login

Navigation

You are here

Multi-Scale Digital Image Correlation and Tracking with MATLAB

chris's picture

C. Eberl, D. S. Gianola, R. J. Thompson (in alphabetic order)

 

With this contribution we would like to point to a free MATLAB tool which uses digital image correlation and tracking techniques to measure strain from a series of digital images. The code can be found on the ‘MATLAB central file exchange’ as well as the documentation, example images and some slides. We use the code on a daily basis for micro- and nanoscale measurements and present it here to be used and further developed by the community. Since it was posted at the end of september the code is now ranked place one or two in google and has been downloaded about 1000 times.

 

The accurate measurement of displacement and strains during deformation of advanced materials and devices endures as a primary challenge to designers and experimental mechanicians.  The increasing complexity of technological devices with stringent space requirements leads to imperfect boundary conditions that have to be properly accounted for.  The push toward miniaturizing devices down to nanometer length scales imparts additional difficulties in measuring strains as the application of conventional extensometers and resistance foil gages are cumbersome, damaging, or even impossible.  Compounding this problem is also the fact that compliance of small-scale testing machines precludes the use of the displacement of external actuators for estimating specimen strain.  As a consequence, a technique with the following features is extremely desirable: i) no contact with the specimen required, ii) sufficient strain resolution to measure locally at the region of interest, iii) the ability to capture non-uniform full-field deformations, and iv) a direct measurement that does not require recourse to a numerical or analytical model.

 

Digital image correlation (DIC) techniques have been increasing in popularity, especially in micro- and nano-scale mechanical testing applications due to its relative ease of implementation and use.  Advances in digital imaging and increasing computational resources have been the enabling technology for this method and while white-light optics has been the predominate approach, DIC has recently been extended to SEM/FIB and AFM.  Above and beyond the ability of image-based methods to provide a “box-seat” to the events that are occurring during deformation, these techniques were applied to the testing of freestanding thin films for this thesis work also because it offers a full-field description and is relatively robust at tracking a wide range of “markers” and varying surface contrast.

 

For these reasons this code was written together with Rob Thompson and Dan Gianola during my stay in the group of Kevin J. Hemker at the Johns Hopkins University in Baltimore, MD, USA.  This code is not meant to be a direct competitor to commercial code since our intention was not to develop ‘slick’ user interfaces, but rather useful code with the advantages of being ‘free’, ‘flexible’ and ‘scalable’.  ‘Free’ in terms of free access even though we would like to ask you to cite our code if you use it and ‘free’ again although you need MATLAB together with some toolboxes.  Since most research institutions have access to this important tool I think we still can call it ‘free’.  ‘Flexible’ in terms of the relative ease in which you can enhance this MATLAB code as a script language where you can add either other toolboxes or your own code to flex it around your application.  We would appreciate it if you as a user could share your own code with all of us out here so the community can learn from your creativity. Finally, ‘scalable’ since you can easily start several sessions to process your images on more than one processor (core) and because there is a good chance that we will be able to use Graphic Processing Units (GPU = the graphics processor on a graphics card) or other add-on boards to enhance processing speed in the next few years.

 

It is also important to emphasize that this tool is scale-free, since it only requires digital images, formed by AFM, SEM, TEM or white-light optics, etc.  Deformation of structures and materials at all length scales, from bridges and buildings to nanometer scales can be analyzed.

We also would like to acknowledge K. J. Hemker and W. N. Sharpe for their support and help.

Comments

Hi Christoph,

Thank you so much for the valuable code. I have contact some companies to purchase their DIC softwares, but they were too expensive for my budget.

Your DIC code will be a great help for me.

 

Jae-Hyun

chris's picture

Hi Jae-Hyun,

I experienced the same need when I was at the Max Planck Institute for Metals Research. A friend of mine, Steffen Orso, worked with in situ techniques to study mechanical properties of hairy attachment systems of beetles and geckos and wood fibers in the group of Eduard Arzt. We got stuck when we tried to measure the tensile strain in a 30 micron long and 2 micron wide seta from Focused Ion Beam Images. That was the time when I figured that there had to be a way to program this. Thanks to Dan Gianola and Rob Thompson I was not only introduced to matlab but also found great help from both of them. Since then it is our bread and butter code (e. g. Dan's measurement of nano-crystalline Al).

Since we all three and also Kevin believed in the mechanics community we decided to open the code to anybody who would like to use it.

If you have suggestions or further questions we will be happy to help you.

Chris.

Ying Li's picture

Thank you for your code. It is useful for me. But when I use it for less than 3 figs, it will eject an error message. What I want to know is that  it can be used for less than 3 figs?

Lee

Dan Gianola's picture

Hi Lee,

 While the code was written to extract strains/displacements for a series of images (a typical quasi-static experiment for us usually generates on the order of 1000 images), it absolutely has the capability of correlating or tracking shifts between a reference and a deformed image (3 or less as you mentioned). If this is something you wish to do, then you would have to open the main scripts (automate_image.m for correlation and peak_labelling.m for tracking) and simply remove the main loops that cycle through images given in filenamelist.mat. For the correlation code (automate_image.m), your 'base' image would be your first image and the 'input' image would be the second.

 Of course, as with any image correlation, you are subject to the usual constraint of small shifts between consecutive images. If the shifts are too large, then the software will not be able to correlate the images. This is why we take many images during the course of deforming our specimens.

 I hope this answers your question and helps you out!

 

-Dan

Ying Li's picture

I see. Thank you for your reply. I use your code for some of my SEM figs and it works very well, especially in the continuous deformation. But I want to know the accuracy of your method. I always use the business software DSCM to calculate the deformation and there is something different between your code’s result and the DSCM’s.

Dan Gianola's picture

Hi Lee,

First of all, let me say that it is always great to hear that our code is of some use to the community and that it is being applied to a diverse set of problems. An older version of the code was applied to SEM images during deformation by Chris and his colleagues and inspired further development, but we have not used it for this purpose since. It would be great if you could at some time provide some examples of its use with SEM images either here or off line.

In terms of accuracy, this of course depends on many factors including, but not limited to, system optics, image resolution, and marker/contrast morphology. A discussion of our system accuracy was addressed in a talk given by Chris at Nanomech 2006 -- the slides can be found at a sister posting on the Matlab file exchange server. Please keep us up to date on how this compares to the commercial code you are using as we are constantly trying to improve this software.

Thanks!

-Dan

Hi

i am using your code to get strain calculation.. i am running into problems with qhull precision. basically when i use displacement.m, it gives an error when it calls griddata. I am running for the same copies of images for understanding purpose. I am in Linux with matlab 7.4 in 64 bit. (error is meshplot in line 670). 

i observed that if i use only two images (by commenting the code for loopimages), it gives an error that 'matirix exceeds dimensions' at validx(:,3:10) ...etc

 can you please help me?

regards

Vikas 

Hi

I found that the package needs a private program called findpeak.m.. can you please tell me the way in which i can get this file?. without that, its not possible to get this working for me

thank you!

regards

Vikas 

It's a part of the imaging toolbox I think.  It fits a second order polynomial to the data and reports the peak.  What seems strange to me is this portion of it:

    % return only one-tenth of a pixel precision
    x_offset = round(10*x_offset)/10;
    y_offset = round(10*y_offset)/10;  

So it appears that this is limiting the precision of the correlation to 1/10th pixel, and since this function is what is called on by cpcorr.m the change suggested in the users guide to this software won't do anything more then carry the decimal points form the original grid positions through the corrletion.

Changing it to 1/100 produced some strange looking results with similar precision as before.  I'm still working on figuring out why.

  

I've modified the above code in findpeak.m to:

    % return only one-hundredth of a pixel precision
    x_offset = round(1000*x_offset)/1000;
    y_offset = round(1000*y_offset)/1000; 

And then undid the second change to cpcorr that Christoph described in the correlation_guide_2 document to lines 134 and 135 (the ones that start "input_fractional_offset=. . ." and "base_fractional_offset=. . ."

I did some correlations on computer generated sub-pixel movements and proved these modifications to vastly increase sub-pixel accuracy.

Qhullmx error

a

Hi,

The timedim function in the statement

[h,m,s] = hms2mat(timedim(estimatedtime,'seconds','hms'));

gives the error:

??? Undefined command/function 'timedim'.

Error in ==> automate_image at 135
    [h,m,s] = hms2mat(timedim(estimatedtime,'seconds','hms'));

Has anyone run into this?  I am using large images that I have converted from jpeg to tif using irfanview

 

Thanks in advance!

chris's picture

 Hi Todd,

that's some historical code which is not supported by matlab any more. I took it out in the newest upload on the matlab server. Cheers, Chris. 

 

 

Dr. Christoph Eberl
Nachwuchsgruppenleiter (DFG gefördert)
Universität Karlsruhe (TH)
Institut für Zuverlässigkeit von Bauteilen und Systemen
Kaiserstr. 12
D-76131 Karlsruhe, Germany
Forschungszentrum Karlsruhe GmbH
Institut fuer Materialforsc

I am having a problem when running peak_labelling. The error message is

??? Undefined function or variable "cropxy".

Error in ==> peak_labelling at 127
fitcountertemp=size(cropxy); % number off peaks to cycle through

 can any body help me....

 

chris's picture

Hi Shafqat,

I think it could be that peak_labelling does not find any good peaks any more. What does the image look like during analysis? Where there still peaks marked?

Chris. 

 

Dr. Christoph Eberl
Nachwuchsgruppenleiter (DFG gefördert)
Universität Karlsruhe (TH)
Institut für Zuverlässigkeit von Bauteilen und Systemen
Kaiserstr. 12
D-76131 Karlsruhe, Germany
Forschungszentrum Karlsruhe GmbH
Institut fuer Materialforsc

H.Ghadbeigi's picture

Hi chris,

first of all, thank you for your generocity,

then i have got some problem when running your matlab code, would you please tell me what to do to solve them?

1- i couldnt find "cpcorr.m" file in the attached zip foldes

2 when i run grid_genrator i will get the following messages:

??? Undefined function or method 'imshow' for input arguments of type
'uint8'.

Error in ==> grid_generator>gridtypeselection at 46
imshow(im_grid,'truesize');

Error in ==> grid_generator at 35
[grid_x,grid_y,FileNameBase,PathNameBase] = gridtypeselection(FileNameBase,
PathNameBase, im_grid);

 i have to mention that i am using MATLAB R2008 on my X64 windows workstation.

Regards

Hassan, Sheffield 

chris's picture

Hi Hassan,

do you have the image processing toolbox installed? Sounds like it is missing as all described errors are are connected to funtion which are part of it. 

Cheers, Chris. 

 

Dr. Christoph Eberl
Nachwuchsgruppenleiter (DFG gefördert)
Universität Karlsruhe (TH)
Institut für Zuverlässigkeit von Bauteilen und Systemen
Kaiserstr. 12
D-76131 Karlsruhe, Germany
Forschungszentrum Karlsruhe GmbH
Institut fuer Materialforsc

Siva P V Nadimpalli's picture

 

Dear Chris, Rob and Dan,

Thank you all for providing this software free of cost. It is a big help.

I have one question regarding rigidbody rotations. If the specimen rotates or translates significantly during testing (due to loading arrangements), how can this be taken into account while using this correlation software.

Thanks once again.

Siva 

 

Mohammad R.Yadegari's picture

Dear Dr Eberl

I tryed to go to that site for downloading DIC code for my master of science thesis.But unfortunatly I couldnt find that.could you please help me or send it for me to my mail.

 sincerely

M R Yadegari

m.yadegari@ut.ac.ir

Dear Chris, Dan and Rob:

 

I am trying to use your code to analyze a series of high-speed images obtained as part of a low-velcotiy impact test procedure. Due to the limitations of the available equipment, I am able to capture one image at 50 µs intervals. As such, I have a set of 10 useful images. These images were acquired without any speckle pattern on them. The deformations are rather large and change significantly from one frame to the next. Also, I have observed that the results vary appreciably depending on the algorithm I use for deleting badly tracked markers. Could you please suggest the 'best' algorithm for this purpose based on your experience? Given the above background, could I still use your code to correlate the images and compute strains?

 

Many thanks for your feedback.

 

Best,

 

Prabhakar

Pandi.Pitchai's picture

Dear friends,

I am PhD students and I need to construct the finite element model in abaqus from SEM image of composite materials. If any one knows how transform SEM image into abaqus please let me know as soon as possible. I am not finding any solution in search mode. I tried to import the SEM via MATLAB using imread MATLAB command. It provides pixel index but with this data, I really dont know how to import into abaqus and even I am not sure about this data to distigusih between matrix and inclusion. Please help me

Regrads

Hi.dear Dr eberl.i tryed to go to that site for downloading DIC code for my master of science thesis.But unfortunatly I couldnt download that.could you please help me or send it for me to my mail.rasool.azari1983@yahoo.com

 sincerely

Subscribe to Comments for "Multi-Scale Digital Image Correlation and Tracking with MATLAB"

Recent comments

More comments

Syndicate

Subscribe to Syndicate
Error | iMechanica

Error

The website encountered an unexpected error. Please try again later.