code

  // show contour points.
  cv::Scalar color(rand()&255, rand()&255, rand()&255); 
  // cv::Mat showimg1 = cv::Mat::zeros(cv::Size(out_w_, out_h_), CV_8UC3);  
  // std::cout << "show contour points: " << contour_point.size() << std::endl;
  // drawContours(showimg1, contour_, -1, color, -1, 8, hierarchy);
  for(int i=0; i<contour_point.size(); i++)
  {
    cv::circle(showimg, contour_point[i], 2, color);
  }
  // // get ROI with line.
  // color = cv::Scalar(rand()&255, rand()&255, rand()&255); 
  // cv::rectangle(showimg, roi_, color, 1, cv::LINE_8, 0);
  // cv::line(showimg, cv::Point(0.5*out_w_, 0.5*out_h_),
  //   cv::Point(0.5*out_w_, out_h_), color, cv::LINE_8, 0);
  cv::imshow("contour_", showimg);
  cv::waitKey(1);
  sprintf(output_path_, "../output/%04d_contour_points.png", idx_);
  cv::imwrite(output_path_, showimg);
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2021-08-21
  • 2022-12-23
  • 2021-09-26
  • 2021-12-04
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案