Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warp_perspective 输出图像全黑 #215

Open
fengyanWang opened this issue Dec 3, 2024 · 0 comments
Open

warp_perspective 输出图像全黑 #215

fengyanWang opened this issue Dec 3, 2024 · 0 comments

Comments

@fengyanWang
Copy link

您好,我这边基于get_perspective_transform和warp_perspective,对图像做仿射变换,但是输出的图像一直是全黑的,相关代码如下,期待您的回复!

  fcv::Point2f src_points[4];
  fcv::Point2f dst_points[4];
  int target_height = 0, target_width = 0;
  .......
  
  fcv::Mat transform = fcv::get_perspective_transform(src_points, dst_points);

  fcv::Mat fcv_src(img_w, img_h, fcv::FCVImageType::PKG_RGBA_F32, imgData.data);
  fcv::Mat fcv_dst;
  fcv::warp_perspective(fcv_src, fcv_dst, transform);

  cv::Mat opencvMat(img_h, img_w, CV_8UC(fcv_dst.channels()),fcv_dst.data());
  std::string res_path = "/data/local/tmp/flycv_res.jpg";
  cv::imwrite(res_path, opencvMat);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant