mvgorcum / Sessile.drop.analysis

Python script to analyse sessile drops by measuring contact angle, drop volume and contact line speed

Home Page:https://www.drop-analysis.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Script breaks when the edge is too close to the edge of the frame using errorfunction fit

mvgorcum opened this issue · comments

Solvable by a proper crop, assuming the source picture is large enough. Can be fixed by an error message, or by using less input points for the errorfunction fit in case the drop is too close to the edge.
Note that this still breaks when the drop grows outside the frame. This probably needs to be caught in some way, but if a single edge grows out of frame, the data can still be usefull.

Pseudocode:

if leftedge==0 or rightedge==framesize
   skip subpixel correction
elif leftegde-fitsample<0 or rightedge+fitsample>framesize
    fitparts=image[y,range(0,leftedge+fitsample)]
    fitparts=image[y,range(rightedge-fitsample,framesize)]

Fixed a while ago. Note that for the errorfunction subpixel correction all subpixel correction is removed when the edge is closer than erffitsize (which is 40 pixels, changable in edge_detection.py) This does decrease the accuracy of the measured contact angle, position and speed, but it won't break.