您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

28 行
465B

  1. package cfar
  2. // New creates a CFAR detector for the given mode.
  3. // Returns nil if mode is ModeOff or empty.
  4. func New(cfg Config) CFAR {
  5. if cfg.TrainCells <= 0 {
  6. return nil
  7. }
  8. if cfg.GuardCells < 0 {
  9. cfg.GuardCells = 0
  10. }
  11. if cfg.ScaleDb <= 0 {
  12. cfg.ScaleDb = 6
  13. }
  14. switch cfg.Mode {
  15. case ModeCA:
  16. return newCA(cfg)
  17. case ModeOS:
  18. return newOS(cfg)
  19. case ModeGOSCA:
  20. return newGOSCA(cfg)
  21. case ModeCASO:
  22. return newCASO(cfg)
  23. default:
  24. return nil
  25. }
  26. }