| Algorithm 2: Rules of convex defect |
| 1.foreach defects (i) in defects 2. if defects (i) (3) > distance 3. then compute angle of defects 4. if angle>=75 &&angle<=120 5. then push the defects (i) into the finalDefects. 6. end 7. end 8.end 9.if the size of finalDefects is 1 10. then p1=farthest point, p2=average of start and end points 11. if p2.y<p1.y 12. return 3 13. end 14. else if p2.y>p1.y 15. return 1 16. end 17. else 18. return false 19. end 20.end 21.else if the size of defects is 2 22. return 2 23.end 24.end |