LordLadybug / LaserTracker

Laser tracking program that moves camera to keep laser pointer in focus; crude visual encoder for making measurements along a ruler.
GNU General Public License v3.0
0 stars 0 forks source link

Miscellaneous issues with contouring #3

Open LordLadybug opened 3 years ago

LordLadybug commented 3 years ago

Must add code to deal with issues when image that results from thresholding results in a blank image(black or white). 1 of 2 things has happened so far when fed a blank image:

LordLadybug commented 3 years ago

grab video frame TEST: is frame valid?

  1. is the frame variable empty?
  2. is it a proper 3-channel NumPy array?
  3. does it convert correctly to hsv?

masking and thresholding TEST: does mask capture a laser dot?

  1. does pattern resemble dot? (round shape)
  2. how much of screen does dot take up?
  3. is dot highlighted or background highlighted?
  4. do other similar-colored objects throw off our finding?

return center TEST: are the coordinates returned on dot center?

  1. do centroid calculations work? a. off-center? b. division by zero? c. return x-y coordinates? d. returned coordinates are in-frame?
  2. does contouring work? a. is contour list empty? b. do contours center on dot? c. are contours thrown off of dot by other parts that make it through threshold?
LordLadybug commented 3 years ago

Tests above are converted into a python module, will need further fleshing out. A few tests have already been filled out.

Will also have to consult the unit testing docs in official docs to make sure this is structured correctly.

LordLadybug commented 3 years ago

All but two tests have been written in some capacity; currently 12 tests fail as of the last time the testing suite ran. Still need to put something for the contours center on dot test and the contours thrown off by other parts of image test.