|
@@ -257,11 +257,10 @@ const char *get_video_similarity_list(const char *inputjson) {
|
|
|
return ret_json;
|
|
|
}
|
|
|
|
|
|
-static int *list_sim_compare(std::vector<ImageHashModel *> a, std::vector<ImageHashModel *> b) {
|
|
|
+static int list_sim_compare(vector<ImageHashModel *> a, vector<ImageHashModel *> b, int arr[2] ) {
|
|
|
int minFrames = MIN(a.size(), b.size());
|
|
|
int maxFrames = MAX(a.size(), b.size());
|
|
|
int sim_frame_count = 0;
|
|
|
- int arr[2];
|
|
|
//比较帧指纹
|
|
|
for (int k = 0; k < minFrames; ++k) {
|
|
|
float v_sim = fingerprint_compare(a[k]->image_hash, b[k]->image_hash,
|
|
@@ -272,7 +271,7 @@ static int *list_sim_compare(std::vector<ImageHashModel *> a, std::vector<ImageH
|
|
|
}
|
|
|
arr[0] = sim_frame_count;
|
|
|
arr[1] = maxFrames;
|
|
|
- return arr;
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
float get_video_similarity_value(const char *src_json, const char *dst_json) {
|
|
@@ -286,7 +285,8 @@ float get_video_similarity_value(const char *src_json, const char *dst_json) {
|
|
|
int src_v_count = 0;
|
|
|
int dst_v_count = 0;
|
|
|
for (int g = 0; g < min_count; ++g) {
|
|
|
- int *cur_sim = list_sim_compare(src_vs->clips[g]->hashs, dst_vs->clips[g]->hashs);
|
|
|
+ int cur_sim[2]={0};
|
|
|
+ list_sim_compare(src_vs->clips[g]->hashs, dst_vs->clips[g]->hashs, cur_sim);
|
|
|
int a = cur_sim[0];
|
|
|
int b = cur_sim[1];
|
|
|
src_v_count += a;
|