vitis::ai::Segmentation8UC1 - 2.5 日本語

Vitis AI ライブラリ ユーザー ガイド (UG1354)

Document ID
UG1354
Release Date
2022-06-15
Version
2.5 日本語
Segmentation8UC1 のクラス。このクラスの run 関数 run(const cv::Mat& image) は、cv_8UC1 タイプの cv::Mat を返します。サンプル コード:
   auto det =
vitis::ai::Segmentation8UC1::create(vitis::ai::SEGMENTATION_FPN);
  auto img = cv::imread("sample_segmentation.jpg");
   int width = det->getInputWidth();
   int height = det->getInputHeight();
   cv::Mat image;
   cv::resize(img, image, cv::Size(width, height), 0, 0,
              cv::INTER_LINEAR);
   auto result = det->run(image);
   for (auto y = 0; y < result.segmentation.rows; y++) {
     for (auto x = 0; x < result.segmentation.cols; x++) {
           result.segmentation.at<uchar>(y,x) *= 10;
       }
   }
   cv::imwrite("segres.jpg",result.segmentation);

関数クイック リファレンス

次の表に、vitis::ai::Segmentation8UC1 クラスに定義されているすべての関数を示します。

表 1. 関数クイック リファレンス
タイプ メンバー 引数
std::unique_ptr< Segmentation8UC1 > create
  • const std::string & model_name
  • bool need_preprocess
int getInputWidth
  • void
int getInputHeight
  • void
size_t get_input_batch
  • void
SegmentationResult run
  • const cv::Mat & image
std::vector< SegmentationResult > run
  • const std::vector< cv::Mat > & images