patchGNU Octave - Patches: patch #8571, [octave forge] (image): three...

 
 

patch #8571: [octave forge] (image): three deconvolution routines (Wiener, RL, RLTV)

Submitter:  None
Submitted:  Mon 17 Nov 2014 02:03:02 PM UTC
   
 
Category:  Forge : new function Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 20 Jan 2020 03:24:31 PM UTC, comment #5: 

Quoting "Christoph Dalitz" mail:

> Hello Kai,
>
> I wonder what this message is about?
>
> When I had submitted the patch, it was rejected because it implemented deconvolution
> routines not identical to and with different names than routines in Matlab. The submission
> instead implemented the routines from the following paper (open > access), which back then
> was not considered appropriate for octave-forge:
>
> http://dx.doi.org/10.1109/TUFFC.2014.006717
>
> Is it now nevertheless included with octave-forge?
>
> Christoph



Dear Christoph,

Sorry for the noise.  I just updated the summary and category of your patch to make it easier for others to find.  Unfortunately, I am not the maintainer of the image package.  Thus I cannot help you with merging your contribution.

One update had happened in the meantime.  In OF image 2.10.0 (2018/12/26) the function "deconvwnr" had found it's way into the OF package.  But I am unaware of the details.  See:

https://octave.sourceforge.io/image/NEWS.html

https://octave.sourceforge.io/image/function/deconvwnr.html

Kai

Kai Torben Ohlhus <siko1056>
Group Member
Thu 19 Feb 2015 12:53:33 AM UTC, comment #4: 

Wed 18 Feb 2015 08:35:57 GMT, comment #3:

>> I don't want to end up with 6 deconvolution functions
>> that are very similar but not quite.
>>
>
> I had thought that the problem currently is not that there are too many deconvolution function in Octave, but that there is none at all.


Yes, that is true now. But adding then now to have them removed one day when we get a Matlab compatible version, that will create problems.


> If you have a matlab compatible deconvolution implementation however, I agree that this should be included instead, even though it does not support regularization for Richardson-Lucy deconvolution, AFAIK.
>
> It might be best to provide our deconvolution routines not as part of the image package, but as a separate optional addon, because they are complementary to what matlab has built in, and are thus also useful for matlab users. Is there any other repository for octave contributions?


If there are something these implementations can do, I will try to merge them into Matlab compatible versions. Kinda like graythresh has an extra option to select different algorithms.

> Concerning the dimension, I wonder whether there is a way to avoid the discrimination of two cases, because Octave has different convolution functions for one and two dimensionc ([fft]conv versus [fft]conv2).


It also has convn which you can use when you want to support N dimensions. The image package also now has a corresponding fftconvn.

Carnë Draug <carandraug>
Group Member
Wed 18 Feb 2015 08:35:57 AM UTC, comment #3: 


> I don't want to end up with 6 deconvolution functions
> that are very similar but not quite.
>

I had thought that the problem currently is not that there are too many deconvolution function in Octave, but that there is none at all.

If you have a matlab compatible deconvolution implementation however, I agree that this should be included instead, even though it does not support regularization for Richardson-Lucy deconvolution, AFAIK.

It might be best to provide our deconvolution routines not as part of the image package, but as a separate optional addon, because they are complementary to what matlab has built in, and are thus also useful for matlab users. Is there any other repository for octave contributions?

Thanks for pointing me to padarray.

Concerning the dimension, I wonder whether there is a way to avoid the discrimination of two cases, because Octave has different convolution functions for one and two dimensionc ([fft]conv versus [fft]conv2).

Christoph Dalitz <dalitz>
Tue 17 Feb 2015 05:06:18 PM UTC, comment #2: 

I am unsure of accepting this patch since Matlab has equivalent functions and you are already telling us that your functions behave different. I don't want to end up with 6 deconvolution functions that are very similar but not quite.  Even if you are not able to implement all the options, can you at least make it Matlab compatible?

Also, a few comments about the coding before being accepted:

1. when checking input, do not simply disp a message and then return, use error(). If there is an error, we want an error to be throw. Simply calling return will allow the computation to continue (and then misteriously fail later)

2. use the postpad, prepad, or padarray functions (you probably want the padarray function). Do not do these things yourself since they are a pain to read and therefore maintain:


  padimage = zeros (max_size);
  padpsf = zeros (max_size);
  ## ...
  padimage((1+d(1)):(max_size(1)-d(1)), (1+d(2)):(max_size(2)-d(2))) = image;
  padpsf((1+dp(1)):(max_size(1)-dp(1)), (1+dp(2)):(max_size(2)-dp(2))) = psf;


3. do not have separate code for 1 and 2 dimensions, we want to support an arbitrary number of dimensions. This is the same operation, it does not matter the number of dimensions.

4. do not compute the otf yourself from the psf. The functions psf2otf and otf2psf are now part of the image package (development version).

5. I will need an email address for both Fabian Schmitt as well since he's also claiming copyright ownership of the deconvWiener and deconvRL functions

Carnë Draug <carandraug>
Group Member
Tue 18 Nov 2014 11:57:36 PM UTC, comment #1: 

Thanks for your contribution. Retitling to suggest for inclusion in the image package. The image package maintainer will probably notice this and have further comments or suggestions.

Mike Miller <mtmiller>
Group Member
Mon 17 Nov 2014 02:03:02 PM UTC, original submission:  

Dear octave developers,

here are three deconvolution routines implemented as *.m files, which I have recently implemented for a research project:

    deconvWiener, deconvRL, deconvRLTV

The attached archive includes these three function files, test data ("image.csv", "psf.csv"), and a testscript "testdeconv.m" for running all three functions on the testdata.

I have not used the function names of matlab (deconvwnr, deconvlucy), because my implementations behave somewhat differently:

Matlab's deconvwnr only works when image and psf have exactly the same size, and it supports additional parameters, which I do not understand.

Matlab's deconvlucy uses a different algorithm, while my implementation uses the original algorithm by Richardson and Lucy, so that the results of both functions differ.

Please send me a short confirmation when this submission has arrived.

Thanks,

Christoph Dalitz

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #32452:  octave-contrib.tgz added by None (364KiB - application/x-compressed-tar - Please see the "Original submission" text for archive content)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by dalitz (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-25 mtmiller Carbon-CopyRemoved 80942 -
    2020-01-18 siko1056 CategoryNone Forge : new function
        Summaryimage package: three deconvolution routines (Wiener, RL, RLTV) [octave forge] (image): three deconvolution routines (Wiener, RL, RLTV)
    2014-11-18 mtmiller SummaryThree deconvolution routines (Wiener, RL, RLTV) image package: three deconvolution routines (Wiener, RL, RLTV)
    2014-11-17 None Attached File- Added octave-contrib.tgz, #32452

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code