Re: [darktable-dev] Deconvolution and Python framework

2017-05-03 Thread Aurélien PIERRE
Hi,

I got critics so I made it better ;-) My Richardson-Lucy implementation
now allows to set a mask. This mask is intended to specify the zone
where the focus is supposed to be, and thus compute the deconvolution
matrix estimation only there. This matrix is then used to deconvolute
the whole picture. I got faaar better results regarding the general
smudginess/sharpness ratio :
https://github.com/aurelienpierre/Image-Cases-Studies/commit/bfaf6930abd873e568ee12f90427dad0206d6de6

I don't know how much the community is interested in my experiments
though or if it's relevant here, so just tell me if I spam.

Have a nice day,

*Aurélien PIERRE*
aurelienpierre.com 



Le 2017-05-03 à 04:42, Aurélien PIERRE a écrit :
>
> Hi,
>
> being a Darktable user since 2010 (0.9 if I recall), a photographer
> for many years and an almost engineer, I have looked for a long time
> to get involved into DT development. I know 10 programming languages
> but I'm still a newbie in C…
>
> Following my last email on adaptative deconvolution, I started a
> Python framework to experiment on image processing algorithms. The
> Github repos is here :
> https://github.com/aurelienpierre/Image-Cases-Studies
>
> I already have 3 case studies, with algorithms and before/after pictures :
>
>   * Unsharp masking with bilateral filter in LAB space
>   * Defringing with bilateral filter in LAB space
>   * Focus correction/restoration with Richardson-Lucy deconvolution in
> RGB and LAB spaces.
>
> I'm trying to keep my code as clean as possible to make it easy to
> understand and possible to translate into C and (hopefully) into
> Darktable modules. The framework is packaged with a Python setup file
> and optimized with Cython and parallel computing.
>
> I will continue to experiment on deconvolution but any comment, code
> review, scientific article, or contribution is welcome.
>
> Have a nice day,
> -- 
>
> *Aurélien PIERRE*
> aurelienpierre.com 
>
> 
>
>
> ___
> darktable developer mailing list to unsubscribe send a mail to
> darktable-dev+unsubscr...@lists.darktable.org


___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

Re: [darktable-dev] Problem with register_lib in lua API

2017-05-03 Thread Jefferson Ferreira
Hi,

I found the real problem. The problem occurs when I add the following line
in darktablerc:

lighttable/ui/single_module=TRUE

If I remove this line, my lua code works perfectly, and the darktable does
not break when I click on the export module.

[]'s

On Wed, May 3, 2017 at 3:46 AM, Tobias Ellinghaus  wrote:

> Am Dienstag, 2. Mai 2017, 16:37:20 CEST schrieb Jefferson Ferreira:
> > Hi,
> >
> > This link has the content of gdb.txt with the output of gdb. My luarc has
> > just the code that I mentioned at the first email.
> >
> > https://www.dropbox.com/s/pjydo45jrndu8o5/gdb.txt?dl=0
>
> Thanks, that looks familiar. Initially I had that, too, but somehow never
> got
> it again. It seems to be due to how lua handles its objects internally. I
> will
> ask Jeremy for advice.
>
> For those curious, the relevant part is
>
> Thread 1 (Thread 0x77ee0ac0 (LWP 15239)):
> #0  get_position_description (cur_view=0x2295300, gui_data=0x26c73d0) at /
> home/jeff/Tools/Darktable/darktable/src/lua/lualib.c:94
> position_description = 
> iter = 0x1
> #1  0x77ab7314 in container_wrapper (self=) at
> /home/
> jeff/Tools/Darktable/darktable/src/lua/lualib.c:104
> cur_view = 
> gui_data = 0x26c73d0
> position_description = 
> #2  0x77a9d36b in _lib_plugin_header_button_press (w= out>,
> e=, user_data=0x26c4c00) at /home/jeff/Tools/Darktable/
> darktable/src/libs/lib.c:929
> m = 0x2cb0b70
> it = 0x2067840
> v = 0x2295300
> all_other_closed = 1
> container = 4
> w = 
> user_data = 0x26c4c00
> e = 
> module = 0x26c4c00
>
> where iter is suddenly "1" instead of a valid pointer. To me it looks like
> somewhere the struct holding the lib data is copied without taking into
> account that there are pointers inside.
>
> > Thanks in advance.
>
> Tobias
>
> [...]




-- 
Jefferson Ferreira

___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

Re: [darktable-dev] Lua combobox bug?

2017-05-03 Thread William Ferguson
The only way I've found to do this is to rewrite the whole list of choices,
trimming any extras off the end.

local function update_combobox_choices(combobox, choice_table, selected)
  local items = #combobox
  local choices = #choice_table
  for i, name in ipairs(choice_table) do
combobox[i] = name
  end
  if choices < items then
for j = items, choices + 1, -1 do
  combobox[j] = nil
end
  end
  combobox.value = selected
end


Regards,

Bill

On Wed, May 3, 2017 at 2:07 PM, Holger Klemm 
wrote:

> Hello,
> I want to remove in my Lua script entries from a combobox during runtime.
> Removes entries by setting them to nil does not work! What am I doing
> wrong?
> See attachement
>
> Holger
> 
> ___
> darktable developer mailing list
> to unsubscribe send a mail to darktable-dev+unsubscribe@
> lists.darktable.org

___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

[darktable-dev] Lua combobox bug?

2017-05-03 Thread Holger Klemm
Hello,
I want to remove in my Lua script entries from a combobox during runtime. 
Removes entries by setting them to nil does not work! What am I doing wrong?
See attachement

Holger
___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org--[[


darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

darktable is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with darktable.  If not, see .
]]


local dt = require "darktable"
local gettext = dt.gettext
dt.configuration.check_version(...,{4,0,0})



test_combobox = dt.new_widget("combobox")
{
label = 'test combobox', 
tooltip ='',
value = 1,
editable=true,
"1","2","3","4","5",
reset_callback = function(self_reset)
   self_reset.value = 1
end
} 



add_button = dt.new_widget("button")
{
  label = 'change combobox',
  clicked_callback = function (xxx)
test_combobox{nil}
test_combobox{"XX","YY",nil,nil,nil,}
 dt.print("combobox changed")
  end
}




local import_widget =   dt.new_widget("box") {
test_combobox,
add_button,

 }


dt.register_lib("test", "test", true, true, {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_LEFT_CENTER", 900}}, import_widget, nil, nil)



[darktable-dev] Deconvolution and Python framework

2017-05-03 Thread Aurélien PIERRE
Hi,

being a Darktable user since 2010 (0.9 if I recall), a photographer for
many years and an almost engineer, I have looked for a long time to get
involved into DT development. I know 10 programming languages but I'm
still a newbie in C…

Following my last email on adaptative deconvolution, I started a Python
framework to experiment on image processing algorithms. The Github repos
is here : https://github.com/aurelienpierre/Image-Cases-Studies

I already have 3 case studies, with algorithms and before/after pictures :

  * Unsharp masking with bilateral filter in LAB space
  * Defringing with bilateral filter in LAB space
  * Focus correction/restoration with Richardson-Lucy deconvolution in
RGB and LAB spaces.

I'm trying to keep my code as clean as possible to make it easy to
understand and possible to translate into C and (hopefully) into
Darktable modules. The framework is packaged with a Python setup file
and optimized with Cython and parallel computing.

I will continue to experiment on deconvolution but any comment, code
review, scientific article, or contribution is welcome.

Have a nice day,
-- 

*Aurélien PIERRE*
aurelienpierre.com 




___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

Re: [darktable-dev] Problem with register_lib in lua API

2017-05-03 Thread Tobias Ellinghaus
Am Dienstag, 2. Mai 2017, 16:37:20 CEST schrieb Jefferson Ferreira:
> Hi,
> 
> This link has the content of gdb.txt with the output of gdb. My luarc has
> just the code that I mentioned at the first email.
> 
> https://www.dropbox.com/s/pjydo45jrndu8o5/gdb.txt?dl=0

Thanks, that looks familiar. Initially I had that, too, but somehow never got 
it again. It seems to be due to how lua handles its objects internally. I will 
ask Jeremy for advice.

For those curious, the relevant part is

Thread 1 (Thread 0x77ee0ac0 (LWP 15239)):
#0  get_position_description (cur_view=0x2295300, gui_data=0x26c73d0) at /
home/jeff/Tools/Darktable/darktable/src/lua/lualib.c:94
position_description = 
iter = 0x1
#1  0x77ab7314 in container_wrapper (self=) at /home/
jeff/Tools/Darktable/darktable/src/lua/lualib.c:104
cur_view = 
gui_data = 0x26c73d0
position_description = 
#2  0x77a9d36b in _lib_plugin_header_button_press (w=, 
e=, user_data=0x26c4c00) at /home/jeff/Tools/Darktable/
darktable/src/libs/lib.c:929
m = 0x2cb0b70
it = 0x2067840
v = 0x2295300
all_other_closed = 1
container = 4
w = 
user_data = 0x26c4c00
e = 
module = 0x26c4c00

where iter is suddenly "1" instead of a valid pointer. To me it looks like 
somewhere the struct holding the lib data is copied without taking into 
account that there are pointers inside.

> Thanks in advance.

Tobias

[...]

signature.asc
Description: This is a digitally signed message part.