Tue 26 Sep 2017 01:21:27 PM UTC, comment #11:
An alternative for the patent encumbered approach might be the one from which it is derived from, should still be better than bilinear:
S.-C. Pei and I.-K. Tam, “Effective color interpolation in CCD color filter arrays using signal correlation,” IEEE Trans. Circuits Systems Video Technol., vol. 13, no. 6, pp. 503-513, Jun. 2003.
|
Sat 24 Jun 2017 09:23:42 PM UTC, comment #10:
Just curious, did this ever get added?
I don't see it listed at https://sourceforge.net/p/octave/image/ci/default/tree/inst/ ?
Am I expected to do it? Not sure if I have commit access.
|
Wed 24 May 2017 06:29:54 PM UTC, comment #9:
I recommend to insert this function to image package,
maybe with a "fixme" line about implementing another method(s).
|
Tue 11 Apr 2017 01:58:56 AM UTC, comment #8:
For the "if 1", that's something I saw on this page: https://www.gnu.org/software/octave/doc/interpreter/Demonstration-Functions.html
Re-reading that, it looks like that was only necessary if I were to define any functions in the demo. Since I'm not doing that, it probably doesn't belong. Also looks like I had some commented out references to subplots as well. Cleaned that out as well.
Also, just noticed the Octave convention of endif instead of end. That's an interesting difference I didn't notice until now. Thanks for the fix.
(file #40349)
|
Mon 10 Apr 2017 06:18:06 AM UTC, comment #7:
@Timothy:
Thanks for the new submission, with the tests, and the nice demo.
I am uploading a new file, based on yours with
- typos fixes
- add sensorAlignment = tolower(sensorAlignment); so that "BGGR" can abe used.
Why did you use "if 1" in the demo?
If there no other comments, I recommend to add this function to image package. In the future we should implement another (un-patented) method, and let the user choose, like in
https://www.mathworks.com/help/vision/ref/demosaic.html in which the user can choose the Interpolation algorithm from "Bilinear" and "Gradient-corrected linear".
(file #40346)
|
Sat 08 Apr 2017 12:15:17 AM UTC, comment #6:
So, based on comments so far, I've left the interpolation algorithm as bilinear for now, and noted in the help text that it differs from the algorithm in use by Matlab.
I've drastically redone the code to remove the multiple of 2 restriction, and have done my best to adhere to the Octave coding style guide I found online.
There should be 11 tests and a demo implemented, if anyone's curious how their digital camera sees the world. The moire patterns in the second figure are actually pretty cool looking, though seems to stress this related bug? http://savannah.gnu.org/bugs/?45372
Further feedback welcome.
(file #40327)
|
Tue 04 Apr 2017 06:56:37 PM UTC, comment #5:
I am no patent lawyer (but do have some experience in using patents). And to me this seems to be a valid US patent of the company Microsoft. (A company that has money to pay lawyers...)
I will attach the (open source) original patend document as PDF. The second last page (with "claim 1") is the most important.
The patent was filed in March 2004, and is valid since 2009. The filing date is less than 20 years ago, so I would assume that the patent is still valid today. The quoted patend is valid in the US, but there are also other members of this patent family, for other countries today (namely China, Korea, Japan, Europe and World. The last two ones aren't exactly patents).
Matlab cites the following paper (from May 2004) in its help text of the demosaic command:
So the patent submission was slightly earlier than this publication. This timing looks reasonable to me if someone really wants to hold a patent on this.
The fact that this is not patented in individual countries in Europe leads me to the sucpicion that this might not exactly be "worth" a patent. But currently some counties do have this method patented. Formally there are three ways of dealing with this:
- pay money to Microsoft to purchase the right to use this patent
- take Microsoft a US (and some asian) courts to fight this patent. And pay lawyers to do this fighting for you.
- wait some (probably just 7) years, until the patent is not valid any more, at least the US patent.
The first two ways don't seem feasable to me for Octave code.
So what do we do about this? Should be just use the proposed code of Timothy, that might produce lesser quality results then the Matlab function? My vote would be: yes.
(file #40266)
|
Mon 03 Apr 2017 10:36:30 PM UTC, comment #4:
Malvar-He-Cutler appears patent encumbered?
https://www.google.com/patents/US7502505
|
Mon 03 Apr 2017 08:12:57 PM UTC, comment #3:
Thanks for contributing this function.
However, there are few problems:
This method uses a 5x5 filter (that's the reason for the minimal size)
- There are no builtin self tests, as Carnë noted in comment #1.
Attached a new version which (try to) fix the first 6 items.
(file #40250)
|
Mon 03 Apr 2017 05:46:35 PM UTC, comment #2:
Shouldn't the function name not read "demosaic"? (letter a and i swapped)
|
Mon 03 Apr 2017 12:45:07 PM UTC, comment #1:
Hi! Thank you for the submission. Could you please provide some tests?
|
Sun 02 Apr 2017 10:46:52 PM UTC, original submission:
Found that octave did not have an implementation of demosiac. Wrote one while toying with Bayer images. Tested in Ubuntu 16.04.
Might also affect image-acquisition, per the comments in https://sourceforge.net/p/octave/image-acquisition/ci/ee385c9a7e1b7cf1897ca9ad9a53640de5f7ab70/tree/inst/SGRBGtoRGB.m
|