History

libavfilter: Add dehaze-filter option in existing derain.

Add the support of dehaze filter in existing derain filter source code. As the processing procedure in FFmpeg is the same for current derain and dehaze, we reuse the derain filter source code. The model training and generation scripts are in repo https://github.com/XueweiMeng/derain_filter.git

Xuewei Meng committed 7 years ago

Commit f0c97d61 parent 43458852 files · +16 −0Browse files

Unified · Split

2 files
  1. doc/filters.texi +12 −0
  2. libavfilter/vf_derain.c +4 −0
doc/filters.texi+12−0
@@ -8449,6 +8449,18 @@ files (.pb) by using tools/python/convert.py · 8448 unmodified lines
8449The filter accepts the following options:8449The filter accepts the following options:
8450 8450
8451@table @option8451@table @option
8452@item filter_type
8453Specify which filter to use. This option accepts the following values:
8454
8455@table @samp
8456@item derain
8457Derain filter. To conduct derain filter, you need to use a derain model.
8458
8459@item dehaze
8460Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
8461@end table
8462Default value is @samp{derain}.
8463
8452@item dnn_backend8464@item dnn_backend
8453Specify which DNN backend to use for model loading and execution. This option accepts8465Specify which DNN backend to use for model loading and execution. This option accepts
8454the following values:8466the following values:
libavfilter/vf_derain.c+4−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
34typedef struct DRContext {34typedef struct DRContext {
35 const AVClass *class;35 const AVClass *class;
36 36
37 int filter_type;
37 char *model_filename;38 char *model_filename;
38 DNNBackendType backend_type;39 DNNBackendType backend_type;
39 DNNModule *dnn_module;40 DNNModule *dnn_module;
@@ -46,6 +47,9 @@ typedef struct DRContext { · 6 unmodified lines
46#define OFFSET(x) offsetof(DRContext, x)47#define OFFSET(x) offsetof(DRContext, x)
47#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM48#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
48static const AVOption derain_options[] = {49static const AVOption derain_options[] = {
50 { "filter_type", "filter type(derain/dehaze)", OFFSET(filter_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "type" },
51 { "derain", "derain filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "type" },
52 { "dehaze", "dehaze filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "type" },
49 { "dnn_backend", "DNN backend", OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },53 { "dnn_backend", "DNN backend", OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
50 { "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },54 { "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },
51#if (CONFIG_LIBTENSORFLOW == 1)55#if (CONFIG_LIBTENSORFLOW == 1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t