nmatrix
nmatrix copied to clipboard
NMatrix: Implement image processing methods
Here are two resources (courtesy William Press and Numerical Recipes).
- http://nr.com/CS395T/lectures2010/2010_18_WienerFiltering.pdf
- http://nr.com/CS395T/lectures2010/2010_19_LaplaceInterpolation.pdf
Those include a bunch of image processing methods which we'd like to see implemented in NMatrix, particularly fast Fourier transforms and Laplace interpolation.
Your mission, should you choose to accept it, is: 0. Open an issue in the tracker for the image processing method you select. You can also pick one that isn't listed above, but that you think might be useful (just make sure to explain why).
- Write a blog entry, which we will post on sciruby.com, explaining how to go about performing the image processing task you select. Include pictures!
- If you can't get it to work because NMatrix lacks some necessary functionality, submit that functionality as an issue. Try to get that functionality working and submit a pull-request.
- Either email @mohawkjohn with your blog post or send a pull request in the sciruby.com repository. We'll edit it and post it with your name on it.
hi John, Can you please give me details of your previous work relating to Fourier transforms and Laplace interpolation...:)
No. This kind of research is part of the task, and something we expect all GSoC applicants to do. There are FFT algorithms out there you can make use of. Laplace interpolation is relatively easy to implement.
@Vishnu27 check this out
I have not found a bug filed for either of these so I'd like to file one for both but I thought I should check here just in case I failed to spot one which is already there first. Is this ok?
Hey, I'm starting work on these next. Will send an update on the listserv about the implementation details soon.
Hello,
Is image processing still a priority? I'd like to add a few image processing functions.
@eddiem3 We'd gladly accept some image processing pull requests.
Ok great! I'll get on it.
Pardon me if this is a silly question. I didn't see an anything for image io in the nmatrix lib. Should I start my pull request with that? And if so, is it preferred to write the image io from scratch or to use something like rmagick to open the image file and then convert it to an nmatrix?
@mohawkjohn any advice?
It's not a silly question. You should probably start with that. If you're going to use ImageMagick/RMagick, I strongly recommend writing a separate gem, like nmatrix-image, and that can be where ImageMagick deps go. It's important that we not add any more compiled dependencies to nmatrix itself, as they complicate installation for people who may never use them.
So sorry for the delayed response. Not sure how I missed this the first time.
thanks @mohawkjohn ! Ok cool. So the IO stuff would go in the gem. Would the actual image proc features go in a separate gem as well or in the nmatrix lib?
@eddiem3 If the image processing features are dependent upon the gem, they need to go in the gem, and not in the main nmatrix.
I think in the near future we're going to try to split a bunch of stuff out of NMatrix, namely the ATLAS dependencies. That'll go in nmatrix-atlas. However, you'll note that many ATLAS-dependent functionalities will stay in nmatrix, such as matrix inversion. Ideally, these will all have pure-Ruby fallbacks in nmatrix prime, and having nmatrix-atlas on your system will accelerate those calculations.
So if you do want to include any image processing functions in nmatrix prime, they should be pure Ruby and C/C++ with no external dependencies. There should also be a good argument that they're fundamental to non-image-processing tasks.
@mohawkjohn Ok that makes sense. Are there any particular conventions SciRuby uses for developing gems? I'll go ahead and set up a repo and get started.
Here's the checklist: https://github.com/SciRuby/sciruby/wiki/Gem-and-Subproject-Checklist
We'd also like to see a similar coding style to NMatrix, ideally. Spaces instead of tabs, etc.
Ok. Thanks so much!
Hey @mohawkjohn
Is there already a utility in SciRuby for displaying images?
The way I'm thinking now is image -> nmatrix -> do processing -> convert to Rmagick -> display but this may be a bit cumbersome
No, I don't think there is one currently.
I've started building a gem interpolation which supports interpolation with NMatrix over multiple axes, and many other options.
You guys might want to put in the interpolation routines in there.
@eddiem3 and @mohawkjohn – the SciPy community seems to use iPython notebooks quite a bit. I believe that the iRuby notebook kernel can display images. It would be fantastic to display images in the iRuby notebook.
@andrewcsmith interesting, I'll check it out
We might want to create this as another extension later...
@mohawkjohn how about changing this issue and focus on making a plugin that will interface with fast image processing libraries?
I'd be interested in helping create such a plugin. (I'm comfortable with C if we need to implement the some of the functions ourselves)
Would an opencv wrapper be best for what we are looking at? Or would that be a bad idea due to the external dependency (a rather heavy one!)
i won't be able to start at full steam immediately since I need to finish applying to colleges for graduate programs
Additional information on such libraries:
@vaibhav-y I was working on that for a sec, but my harddrive fried before I pushed any code. I think it would be cool to do something especially with OpenCV. Any thoughts @mohawkjohn ?
@eddiem3 I agree. OpenCV is really powerful.
I can setup a public workspace on c9.io and add you to that, if that's ok with you. That should be fail safe and also allows us to add more people for review / etc.
What I have in mind is a c-extension + a generic ruby wrapper (like a factory?) for whatever image processing library we choose
What kinds of methods from OpenCV would you be prioritizing? Can you give a few examples?
I'm thinking of starting with the basic image processing tools. Smothing, Sobel Derivatives, Laplacian, Hough Line Transform, Canny Edge Detector
El lunes, 1 de febrero de 2016, Dr. John Woods [email protected] escribió:
What kinds of methods from OpenCV would you be prioritizing? Can you give a few examples?
— Reply to this email directly or view it on GitHub https://github.com/SciRuby/nmatrix/issues/199#issuecomment-178014191.
Eddie Massey III
Artificial Intelligence in Action Founder Low Country Judicial Merit Selection Committee
803-290-2238 [email protected] eddiemassey.com
Yeah. I think this would be a good candidate for plugins, and those sound like an excellent starting place.
So would a plugin be the same thing as a standalone gem?
Go through the CONTRIBUTING file and see the links relating to making nmatrix plugins.