[Bug 700977] opencv: add colour image enhancement element based on Retinex algorithm
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Sat May 25 11:05:16 PDT 2013
https://bugzilla.gnome.org/show_bug.cgi?id=700977
GStreamer | gst-plugins-bad | 1.x
--- Comment #2 from Miguel (elmiguelao) Casas-Sanchez <miguelecasassanchez at gmail.com> 2013-05-25 18:05:12 UTC ---
New patch coming.
(In reply to comment #1)
> Review of attachment 245277 [details]:
>
> ::: ext/opencv/gstretinex.c
> @@ +104,3 @@
> +}
> +
> +G_DEFINE_TYPE (GstRetinex, gst_retinex, GST_TYPE_VIDEO_FILTER);
>
> Why plain GstVideoFilter and not GstOpenCvVideoFilter?
I have developed this in the (near) past and used VideoFilter. Should I change
it?
>
> @@ +179,3 @@
> +{
> + filter->method = METHOD_BASIC;
> + filter->scales = 3;
>
> Above you said default is 4, but you initialize to 3. Best is to create some
> #defines for the default values at the very top
Indeed, done.
>
> @@ +250,3 @@
> + if (retinex->scales != 0) {
> + retinex->weights = (double *) malloc (sizeof (double) * retinex->scales);
> + retinex->sigmas = (double *) malloc (sizeof (double) * retinex->scales);
>
> These are not freed anywhere. Should probably be handled separately from
> set_caps
>
> In transform you could check if the value of retinex->scales has changed since
> last time, and if so free() the memory and reallocate. And in stop always free
> the memory.
>
stop() releases them, and then I allocated via realloc() in set_property(),
since any change of this parameter should go via this function, as far as I
know.
> @@ +298,3 @@
> +
> + if (TRUE != gst_buffer_map (buf, &info, GST_MAP_READWRITE))
> + return GST_FLOW_ERROR;
>
> This error path leaks the outbuf you've mapped above already. Also you probably
> want to map the outbuf WRITE-only and the inbuf READ-only? Or do in-place
> transformation as your result is in RGBin anyway
Changed to in_place and hopefully sorted out.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list