Code Monkey home page Code Monkey logo

dic-simulator's People

Contributors

francklab avatar mohakpatel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dic-simulator's Issues

"decorr2a" Subscripts out of bounds

Good Afternoon!

I'm working on an engineering capstone project to implement a low-cost DIC system on a Raspberry Pi in order to visualize strain fields for a fixed beam under deflection. While reviewing the efforts of previous semesters on this project, we realized that the speckle pattern may be significantly contributing to measurement error. In looking to assess the quality of the speckle pattern, I came across your MATLAB scripts and paper for your DIC Simulator, seems to be a powerful solution to this concern. With that, we are very appreciative for your work on this program.

Working with your algorithm, I have unfortunately been getting the following error:

Subscript indices must either be real positive integers or logicals.

Error in DIC_simulator>decorr2a (line 906)
cc=c(dv-1:dv+1,du-1:du+1);

Error in DIC_simulator>dvc_full_2d (line 856)
[du dv dc]=decorr2a(dm0,dm1);

Error in DIC_simulator>run2dic (line 827)
[ud,vd]=dvc_full_2d(ia,ib,x,y,ua,va,w0,inc);

Error in DIC_simulator>gobutton_Callback (line 317)
[ut vt] = run2dic(handles.dicw,handles.dicd,handles.pic,handles.tpic);

Error in gui_mainfcn (line 95)
feval(varargin{:});

Error in DIC_simulator (line 47)
gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)DIC_simulator('gobutton_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating UIControl Callback.

What is interesting is that the algorithm stops at different times depending upon the choice of subset size, spacing, and x-translation. It appears that in the decorr2a function, elements of variables dv and du can sometimes be 1, causing cc=c(dv-1:dv+1,du-1:du+1); to index out of bounds.

I added the following lines before the "cc" variable definition above, which fixes the error and the code runs to completion, but I'm not sure whether or how this affects the results of the algorithm.

[minimumval, indexofmin]=min(dv);
if minimumval == 1
dv(indexofmin)=dv(indexofmin)+1;
end
[minimumval, indexofmin]=min(du);
if minimumval == 1
du(indexofmin)=du(indexofmin)+1;
end

I'm wondering if this is a bug or if I haven't chosen appropriate parameters. I've attached an example image I've used with subset size = 60, step length = 20, applied strain = 0.02, and x-displacement = 20.

Thank you in advance!

final-000_00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.