---
# System prepended metadata

title: Embedded CV

---


# Embedded CV

1. fitElliips
2. findContour

precision error
a = 0.0000000002328306

# Errors

# SVD
Good

# backsub

-21.9216106932838990
-143.0006939375632555
3.8134959448732229
14.4630607975568424
-20.1868153820923730

-21.9216101867994766
-143.0006906336252825
3.8134958567640780
14.4631101619478830
-20.1866507714695196

# fitEllips (double)
about 0~8 / 1000000
center = 98.968727 / 44.976013, size = 36.015713 / 92.059372, angle = 90.901993
center = 98.968730 / 44.976014, size = 36.015713 / 92.059373, angle = 90.901993
center = 217.370895 / 77.822464, size = 78.901093 / 133.113312, angle = 179.930923
center = 217.370900 / 77.822467, size = 78.901095 / 133.113313, angle = 179.930921
center = 367.232178 / 78.163750, size = 79.443207 / 132.380798, angle = 134.748199
center = 367.232166 / 78.163751, size = 79.443211 / 132.380800, angle = 134.748197

# fitEllips (float)
about 0~15 / 1000000
center = 98.968727 / 44.976013, size = 36.015713 / 92.059372, angle = 90.901993
center = 98.968735 / 44.976013, size = 36.015717 / 92.059372, angle = 90.902000
center = 217.370895 / 77.822464, size = 78.901093 / 133.113312, angle = 179.930923
center = 217.370895 / 77.822464, size = 78.901100 / 133.113327, angle = 179.930923
center = 367.232178 / 78.163750, size = 79.443207 / 132.380798, angle = 134.748199
center = 367.232178 / 78.163750, size = 79.443199 / 132.380798, angle = 134.748215

# findContour
CV function:
```=cpp
void cv::findContours( InputArray _image, OutputArrayOfArrays _contours,
                   OutputArray _hierarchy, int mode, int method, Point offset )
                   
in contours.cpp
```

current mode  = cv2.RETR_TREE
current method = cv2.CHAIN_APPROX_TC89_KCOS, cv2.CHAIN_APPROX_NONE


# 
```
0. detect_frame
1. check_frame
2. find_pupil_circle_marker
3. find_concentric_circles
    findContours -> 
    get_nested_clusters -> 
    (node>min)&&(node_num<max) -> 
    fitEllipse ->
        concentirc + 
```


fit
accu

numpy.sklearn no open source:
(最小平方法求解線性方程)http://blog.fens.me/r-lsm-regression/
https://ithelp.ithome.com.tw/articles/10186400
(逆矩陣求法)https://www.codesansar.com/numerical-methods/matrix-inverse-using-gauss-jordan-method-c-program.htm
