翻转式由远到近效果实现

 

void __fastcall TCbwAnimationEffect_RotateToNear::BuildDisplayMat

    (cv::Mat& destMat, cv::Mat& srcMat, TRect displayRect) {

    double angle = -45 * (1-double(FCurrentIndex + 1) / FTotalFramesInOnePeriod); // 旋转角度

    if (clockwiseFlag)

        angle *= -1;

    double scale = 0.5 * (1+double(FCurrentIndex + 1) / FTotalFramesInOnePeriod); // 缩放尺度

    cv::Mat rotateMat = cv::getRotationMatrix2D(center, angle, scale);

    cv::warpAffine(srcMat, destMat, rotateMat, srcMat.size());

}

 

演示效果

基于OpenCV的视频图像组态 (12): 翻转式由远到近动画效果

 

相关文章:

  • 2021-12-15
  • 2021-08-30
  • 2021-12-20
  • 2022-01-05
  • 2021-05-12
  • 2021-04-03
  • 2021-05-28
  • 2021-04-02
猜你喜欢
  • 2021-04-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-06-27
相关资源
相似解决方案