apputilities.cpp 567 B

123456789101112131415161718192021222324
  1. #include <opencv2/opencv.hpp>
  2. #include <opencv2/core/core.hpp>
  3. #include <opencv2/highgui/highgui.hpp>
  4. #include <opencv2/imgproc/imgproc.hpp>
  5. #include <iostream>
  6. #include <fstream>
  7. using namespace cv;
  8. using namespace std;
  9. #include "apputilities.h"
  10. int show_frame_image(void *mat, int height, int width)
  11. {
  12. Mat dis_mat;
  13. dis_mat.create(height * 3 / 2, width, CV_8UC1);
  14. dis_mat.data = (uchar *)mat;
  15. cvtColor(dis_mat, dis_mat, CV_YUV2BGRA_I420);
  16. namedWindow("camera local i420");
  17. imshow("camera local i420", dis_mat);
  18. waitKey(1);
  19. dis_mat.release();
  20. return 0;
  21. }