You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

95 lines
4.4 KiB

#if 1
#pragma once
#ifndef IVSC_H_
#define IVSC_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "define_inc.h"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "test_nnctrl_live.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
#include "nweb.h"
#include "utility.h"
#define MAX_SHORT_TERM_TEST 15 //25 //由於時間計算的關係,MAX_SHORT_TERM要是大約MAX_LONG_TERM的一半,這樣不管是一開始背景學習的時間,還是物件融入背景,到bounding_box消失後,仍需維持一樣的時間,這兩者時間會是盡量一致
#define MAX_LONG_TERM_TEST 15 //51 //假設背景學習100秒,則bounding_box融入背景可能只需51秒,但是還大約需要再等待49秒(長背景融入的部分),合計大約100秒。
#define MAX_TIME_LENGTH_TEST 15 //63
#define MAX_LENGTH_COLOR 25
#define NUM_STRINGS_COLOR 11
#define MAX_SHORT_TERM 25 //25 //由於時間計算的關係,MAX_SHORT_TERM要是大約MAX_LONG_TERM的一半,這樣不管是一開始背景學習的時間,還是物件融入背景,到bounding_box消失後,仍需維持一樣的時間,這兩者時間會是盡量一致
#define MAX_LONG_TERM 51 //51 //假設背景學習100秒,則bounding_box融入背景可能只需51秒,但是還大約需要再等待49秒(長背景融入的部分),合計大約100秒。
#define MAX_TIME_LENGTH 57 //63
#define TEMPERING_MANY_TIMES 50 //check_if_tempering_many_times
#define TEMPERING_HAPPENED 25 //check_if_tempering_happened
#define BORDER_WIDTH_TO_IGNORE 25
#define BORDER_WIDTH_TO_IGNORE_IVS 1
#define TIME_INTERVAL_WITH_MSEC 20000 //20000
#define MAX_NUM_OBJECT 128
#define TOF_MAX_TIME_LENGTH 5 //83
#define BLUR_SIZE 5
#define MAX_SLICE_SIZE 7
#define MAX_QUEUE_HASH_SIZE 128
//int get_g_progress_bar();
void set_g_progress_bar(int progress_bar);
int get_g_progress_bar();
void initial_ivs();
int differ_image_test(char *output_image, int* image_size, char * snaphd_image_buffer, int snaphd_image_size, int i_InSourceOri_w, int i_InSourceOri_h);
int get_store_img_background_array_length_test();
extern int g_framesize_width;
extern int g_framesize_height;
extern int g_IsPTZDevice;
extern int g_check_if_OK_thermal;
#if defined GY_OS_AMBA || defined GY_OS_NOVA
extern pthread_mutex_t mutex_compute_median;
//extern pthread_mutex_t mutex_long_term;
//extern pthread_mutex_t mutex_short_term;
//extern pthread_mutex_t mutex_long_term_yuv;
//extern pthread_mutex_t mutex_short_term_yuv;
extern ChannelInfo viewChannelData[MAX_AI_ENGINE_VIEW];
extern HeartbeatInfo heartbeatData;
//extern MotionAreaInfo g_Motion_Area_Data[MAX_MOTION_AREA];
int differ_image(char *output_image, int* image_size, char * snaphd_image_buffer, int snaphd_image_size, detection_pos* PosInfo, int i_InSourceOri_w, int i_InSourceOri_h,int draw_img_long,int draw_img_short, int* no_tempering,int not_to_show_tempering);
int mog2_image(char *output_image, int* image_size, char * snaphd_image_buffer, int snaphd_image_size, detection_pos* PosInfo, int i_InSourceOri_w, int i_InSourceOri_h, int draw_img_long, int draw_img_short, int* no_tempering, int not_to_show_tempering);
void clear_g_ivs_hash_record();
int crop_image_ivs(char *output_image, int* image_size, char * snaphd_image_buffer, int snaphd_image_size, detection_pos* pNext, int i_InSourceOri_w, int i_InSourceOri_h);
void release_img_background();
//void *compute_median_thread(void *ptr);
void run_compute_median();
int crop_zone_image_ivs(char *output_image, int* image_size, char * snaphd_image_buffer, int snaphd_image_size, int snaphd_image_width, int snaphd_image_height, int min_x_temp, int min_y_temp, int max_x_temp, int max_y_temp);
int find_zone_color(/*char *output_image, int* image_size, */char * snaphd_image_buffer, int snaphd_image_size, int snaphd_image_width, int snaphd_image_height, int min_x_temp, int min_y_temp, int max_x_temp, int max_y_temp);
#endif
int resize_image_ivs(char *output_image, int* image_size, char * snaphd_image_buffer, int snaphd_image_size, int snaphd_image_width, int snaphd_image_height, int resize_width, int resize_height);
#if defined GY_OS_AMBA
int convert_to_general_image_for_lpr(char *output_image, int* image_size, char* __input_rgb_array__, int __width__, int __pitch__, int __height__, int __element_interleaved__,int *sec_color_id);
//int tof_differ_image(char *output_image, int* image_size, char * snaphd_image_buffer, int snaphd_image_size, detection_pos* PosInfo, int i_InSourceOri_w, int i_InSourceOri_h, int draw_img_long, int draw_img_short);
#endif
#ifdef __cplusplus
}
#endif
#endif
#endif