Skip to main content
. Author manuscript; available in PMC: 2017 May 24.
Published in final edited form as: Lab Chip. 2016 May 24;16(11):2069–2078. doi: 10.1039/c6lc00340k

Algorithm 1: Steps for analyzing urinalysis dipstick video

Initialization
Step 1: Create template image
Step 2: Measure relative offsets between dipstick pads and timing sticker
  (a) straighten image
  (b) determine offsets
Step 3: Capture and store reference chart data
Analysis
Step 1: Correct aspect ratio of video
 if aspect ratio <= 1
  then rotate image by 90°
 end
Step 2: Identify start time and correct video orientation
 for each frame
  Calculate normalized cross-correlation (NCC)
  if maximum of NCC >= threshold (0.85)
   start timer
   correct orientation
   continue
  end
 end
Step 3: Record and analyze the results
 for each dipstick pad
  (a) identify frame for readout time
  (b) straighten image
  (c) locate dipstick pad and record color
  (d) compare measured color to reference chart end
 end