[FFmpeg-devel] [PATCH] [GSOC] libavfilter/vf_colorconstancy.c : Adding weighted greyedge

Michael Niedermayer michael at niedermayer.cc
Wed Apr 15 14:23:02 EEST 2020


On Wed, Apr 15, 2020 at 01:32:16AM +0530, YATENDRA SINGH wrote:
> Signed-off-by: Yatendra Singh <yatendras at iitbhilai.ac.in>
> ---
>  libavfilter/Makefile            |   1 +
>  libavfilter/allfilters.c        |   1 +
>  libavfilter/vf_colorconstancy.c | 265 +++++++++++++++++++++++++++-----
>  3 files changed, 232 insertions(+), 35 deletions(-)
> 
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index e6cfcd9487..c90aadae98 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -447,6 +447,7 @@ OBJS-$(CONFIG_VSTACK_FILTER)                 +=
> vf_stack.o framesync.o
>  OBJS-$(CONFIG_W3FDIF_FILTER)                 += vf_w3fdif.o
>  OBJS-$(CONFIG_WAVEFORM_FILTER)               += vf_waveform.o
>  OBJS-$(CONFIG_WEAVE_FILTER)                  += vf_weave.o
> +OBJS-$(CONFIG_WEIGHTED_GREYEDGE_FILTER)      += vf_colorconstancy.o
>  OBJS-$(CONFIG_XBR_FILTER)                    += vf_xbr.o
>  OBJS-$(CONFIG_XFADE_FILTER)                  += vf_xfade.o
>  OBJS-$(CONFIG_XFADE_OPENCL_FILTER)           += vf_xfade_opencl.o opencl.o
> opencl/xfade.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 501e5d041b..594b497f0b 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -426,6 +426,7 @@ extern AVFilter ff_vf_vstack;
>  extern AVFilter ff_vf_w3fdif;
>  extern AVFilter ff_vf_waveform;
>  extern AVFilter ff_vf_weave;
> +extern AVFilter ff_vf_weighted_greyedge;
>  extern AVFilter ff_vf_xbr;
>  extern AVFilter ff_vf_xfade;
>  extern AVFilter ff_vf_xfade_opencl;
> diff --git a/libavfilter/vf_colorconstancy.c
> b/libavfilter/vf_colorconstancy.c
> index eae62204b5..49508ae65e 100644
> --- a/libavfilter/vf_colorconstancy.c
> +++ b/libavfilter/vf_colorconstancy.c
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (c) 2018 Mina Sami
> + * Copyright (c) 2020 Yatendra Singh
>   *
>   * This file is part of FFmpeg.
>   *
> @@ -26,6 +27,14 @@
>   *
>   * @cite
>   * J. van de Weijer, Th. Gevers, A. Gijsenij "Edge-Based Color Constancy".
> + *
> + * @cite
> + * J. van de Weijer, Th. Gevers, and J. Geusebroek,
> + * “Edge and corner detection by photometric quasi-invariants”.
> + *
> + * @cite
> + * A. Gijsenij, Th. Gevers, J. van de Weijer,
> + * "Improving Color Constancy by Photometric Edge Weighting".
>   */
> 
>  #include "libavutil/imgutils.h"
> @@ -40,8 +49,10 @@
>  #include <math.h>
> 
>  #define GREY_EDGE "greyedge"
> +#define WEIGHTED_GREY_EDGE "weighted_greyedge"
> 
>  #define SQRT3 1.73205080757
> +#define NORAMAL_WHITE 1/SQRT3
> 
>  #define NUM_PLANES    3
>  #define MAX_DIFF_ORD  2
> @@ -83,6 +94,11 @@ typedef struct ColorConstancyContext {
>      int planeheight[4];
>      int planewidth[4];
> 
> +    double min_err;
> +    int max_iters;
> +
> +    double *weight_info[2];
> +
>      int filtersize;
>      double *gauss[MAX_DIFF_ORD+1];
> 
> @@ -552,32 +568,6 @@ static void normalize_light(double *light)
>      }
>  }
> 
> -/**
> - * Redirects to corresponding algorithm estimation function and performs
> normalization
> - * after estimation.

this patch is corrupted by newlines

Applying: libavfilter/vf_colorconstancy.c : Adding weighted greyedge
error: corrupt patch at line 12
error: could not build fake ancestor
Patch failed at 0001 libavfilter/vf_colorconstancy.c : Adding weighted greyedge




[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200415/de1e4643/attachment.sig>


More information about the ffmpeg-devel mailing list