"lib/engines/sglang/src/worker.rs" did not exist on "05765cd4be22bbed3340200aea87171ad07f78b0"
connected_component.h 793 Bytes
Newer Older
limm's avatar
limm committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) OpenMMLab. All rights reserved

#ifndef FAST_CC__CONNECTED_COMPONENT_H_
#define FAST_CC__CONNECTED_COMPONENT_H_

#include <cstdint>
#include <memory>
#include <utility>
#include <vector>

#include "opencv2/core.hpp"

namespace mmdeploy {

class ConnectedComponents {
 public:
  explicit ConnectedComponents(void* stream);

  ~ConnectedComponents();

  void Resize(int height, int width);

  int GetComponents(const uint8_t* d_mask, int* h_label);

  void GetContours(std::vector<std::vector<cv::Point>>& corners);

  void GetStats(const uint8_t* d_mask, const float* d_score, std::vector<float>& scores,
                std::vector<int>& areas);

 private:
  struct Impl;
  std::unique_ptr<Impl> impl_;
};

}  // namespace mmdeploy

#endif  // FAST_CC__CONNECTED_COMPONENT_H_