//
// Created by 阳坤 on 2022/3/2.
//


#ifndef BYTESFLOW_OPENCV_MEDIA_IMAGE_FINGERPRINT_H
#define BYTESFLOW_OPENCV_MEDIA_IMAGE_FINGERPRINT_H


extern "C" {
#include "libswscale/swscale.h"
#include <libavutil/frame.h>
#include <libavutil/imgutils.h>
}

#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;

int avframeToCvmat(cv::Mat &mat,const AVFrame * frame);
AVFrame* cvmatToAvframe(cv::Mat* image, AVFrame * frame);


int fingerprintFromFFAVFrame(FILE *file,AVFrame *frame,char image_hash[64]);
int fingerprintFromFFAVFrameV2(FILE *file,AVFrame *frame,char image_hash[64]);

/**
 * 指纹相识度
 * @param arr
 * @param arr2
 * @param len
 * @return
 */
float fingerprint_compare(const char * arr,const char * arr2,int len);

char *fingerprintFromImagePath(const char *path);

#endif //BYTESFLOW_OPENCV_MEDIA_IMAGE_FINGERPRINT_H
