From gginiu at gmail.com Thu Mar 3 04:26:26 2011 From: gginiu at gmail.com (Andrzej Giniewicz) Date: Thu, 3 Mar 2011 01:26:26 -0800 (PST) Subject: Was there 0.2.2 on github? Message-ID: Hi, I wonder - what happened to 0.2.2? It's available on pypi, but it's unavailable on github where latest seems to be 0.2.1. Was this release to fix packaging maybe? Andrzej. From stefan at sun.ac.za Thu Mar 3 07:50:16 2011 From: stefan at sun.ac.za (Stefan van der Walt) Date: Thu, 3 Mar 2011 04:50:16 -0800 (PST) Subject: Was there 0.2.2 on github? In-Reply-To: References: Message-ID: <05194ece-9722-4656-a793-5209c0102a76@u3g2000vbe.googlegroups.com> Hey Andrzej On Mar 3, 11:26?am, Andrzej Giniewicz wrote: > I wonder - what happened to 0.2.2? It's available on pypi, but it's > unavailable on github where latest seems to be 0.2.1. Was this release > to fix packaging maybe? I think I forgot to include some files in the Windows distribution. It's probably time for a new release; I have to include some grey- level co-occurrence matrix code, some GTK gui updates and an improvement to the docs build system, then we're ready to go. For version 0.4 Chris and I want to implement a new backend engine that supports numpy, opencl, etc. In version 0.5 I want to pay attention to the fast radon transform, the filter infrastructure and the probabilistic hough transform. What do you use scikits.image for? Kind regards St?fan From gginiu at gmail.com Fri Mar 4 05:11:39 2011 From: gginiu at gmail.com (Andrzej Giniewicz) Date: Fri, 4 Mar 2011 02:11:39 -0800 (PST) Subject: Was there 0.2.2 on github? In-Reply-To: <05194ece-9722-4656-a793-5209c0102a76@u3g2000vbe.googlegroups.com> References: <05194ece-9722-4656-a793-5209c0102a76@u3g2000vbe.googlegroups.com> Message-ID: <417ce6aa-5608-447e-a73d-80f06f2c8504@o30g2000pra.googlegroups.com> Hi, > I think I forgot to include some files in the Windows distribution. that explains it, thanks > What do you use scikits.image for? actually I must confess that not much for. IIRC I personally used scikits-image to make conversion of color space the easy way. Anyway I asked because I'm maintaining scikits-image package in AUR (Arch Linux User Repository) and wasn't sure which version to choose. I'm maintaining it there because it's included in EPD and I'm trying to make sure most packages from there are available trough package manager. Andrzej. From dfarmernv at gmail.com Tue Mar 15 22:42:09 2011 From: dfarmernv at gmail.com (Dan Farmer) Date: Tue, 15 Mar 2011 19:42:09 -0700 (PDT) Subject: How to start contributing? Message-ID: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> Hello, I've recently started using SciPy/NumPy for my computer vision research work and I wanted to get involved with scikits.image to help build a useful library and to learn more about NumPy and Cython programming. I looked at the tasks list and it seems there is a range of work from fairly simple integration work to some high-end plans (OpenCL backend, etc.). So I thought I might start with e.g., merging some of the Cell Profiler code, but then I saw that there are 24 forks of scikits.image on github and it's not clear to me what is already being worked on. So I thought I would just ask if someone could point me in the direction of some entry level work to do? Actually I just thought of something else, what is required to update the OpenCV bindings for OpenCV 2.2? I can't seem to use scikits.image at the moment because it can't find the opencv that it's looking for (the default Python bindings for 2.2 work, and native C++ code works too -- so it's definitely installed correctly). Thanks, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfarmernv at gmail.com Wed Mar 16 11:03:25 2011 From: dfarmernv at gmail.com (Dan Farmer) Date: Wed, 16 Mar 2011 08:03:25 -0700 Subject: How to start contributing? In-Reply-To: References: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> Message-ID: I have about 1.5 years of experience doing vision and image processing programming in C++. I've implemented things like FFT, Wavelet transform, Principal Component Analysis for face recognition, etc. I've used Python as a glue language off and on for maybe 3 years, but again just started using SciPy seriously in the last few weeks. Actually your SciPy 2010 paper was part of what made me decide to give it a try and it's proven to be a really nice environment to work in (though I'm still learning the "vectorized programming" mindset). Finally re: the OpenCV wrappers: I agree with your take on it. For one thing the OpenCV python bindings in 2.2 were re-written and are much better than they used to be [1], but on the other hand they still feel clunky compared to how seamless the SciPy libraries are ("What do you mean I have to convert this array to a CvMat?"). So I'd love to see more of that implemented directly in scikits.image. So let me know what you think would be good to work on also and I'll try to integrate your feedback with Stefan's and put together some kind of plan of attack. Thanks, Dan [1] http://opencv.willowgarage.com/wiki/OpenCV%20Change%20Logs On Wed, Mar 16, 2011 at 6:50 AM, Chris Colbert wrote: > > > On Tue, Mar 15, 2011 at 10:42 PM, Dan Farmer wrote: >> >> Hello, >> I've recently started using SciPy/NumPy for my computer vision research >> work and I wanted to get involved with scikits.image to help build a useful >> library and to learn more about NumPy and Cython programming. I looked at >> the tasks list and it seems there is a range of work from fairly simple >> integration work to some high-end plans (OpenCL backend, etc.). So I thought >> I might start with e.g., merging some of the Cell Profiler code, but then I >> saw that there are 24 forks of scikits.image on github and it's not clear to >> me what is already being worked on. So I thought I would just ask if someone >> could point me in the direction of some entry level work to do? >> Actually I just thought of something else, what is required to update the >> OpenCV bindings for OpenCV 2.2? I can't seem to use scikits.image at the >> moment because it can't find the opencv that it's looking for (the default >> Python bindings for 2.2 work, and native C++ code works too -- so it's >> definitely installed correctly). > > Are you getting an error message printed to the console that says the opencv > libs can't be found? i.e.: > In [1]: from scikits.image import opencv > /Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/scikits/image/opencv/_libimport.py:55: > RuntimeWarning: The opencv libraries were not found. ?Please ensure that > they are installed and available on the system path. > ??'The opencv libraries were not found. ?Please ensure that they ' > *** Skipping import of OpenCV functions. > That line is just stating the libs can't be found and we probably need to > update the code which does the search for the libs. > On the other hand, I originally wrote the OpenCV bindings as a stop-gap > while we added functionality to the scikit (and because I wanted to see if I > could get opencv to share memory with numpy). Rather than continuing to > maintain the OpenCV wrappers, I would rather see effort focused on replacing > the functionality that's there with our own equally performant codes. > What is your Python and programming experience level in general? I can help > you find something appropriate to work on. > > > From sccolbert at gmail.com Wed Mar 16 09:50:54 2011 From: sccolbert at gmail.com (Chris Colbert) Date: Wed, 16 Mar 2011 09:50:54 -0400 Subject: How to start contributing? In-Reply-To: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> References: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> Message-ID: On Tue, Mar 15, 2011 at 10:42 PM, Dan Farmer wrote: > Hello, > > I've recently started using SciPy/NumPy for my computer vision research > work and I wanted to get involved with scikits.image to help build a useful > library and to learn more about NumPy and Cython programming. I looked at > the tasks list and it seems there is a range of work from fairly simple > integration work to some high-end plans (OpenCL backend, etc.). So I thought > I might start with e.g., merging some of the Cell Profiler code, but then I > saw that there are 24 forks of scikits.image on github and it's not clear to > me what is already being worked on. So I thought I would just ask if someone > could point me in the direction of some entry level work to do? > > Actually I just thought of something else, what is required to update the > OpenCV bindings for OpenCV 2.2? I can't seem to use scikits.image at the > moment because it can't find the opencv that it's looking for (the default > Python bindings for 2.2 work, and native C++ code works too -- so it's > definitely installed correctly). > > Are you getting an error message printed to the console that says the opencv libs can't be found? i.e.: In [1]: from scikits.image import opencv /Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/scikits/image/opencv/_libimport.py:55: RuntimeWarning: The opencv libraries were not found. Please ensure that they are installed and available on the system path. 'The opencv libraries were not found. Please ensure that they ' *** Skipping import of OpenCV functions. That line is just stating the libs can't be found and we probably need to update the code which does the search for the libs. On the other hand, I originally wrote the OpenCV bindings as a stop-gap while we added functionality to the scikit (and because I wanted to see if I could get opencv to share memory with numpy). Rather than continuing to maintain the OpenCV wrappers, I would rather see effort focused on replacing the functionality that's there with our own equally performant codes. What is your Python and programming experience level in general? I can help you find something appropriate to work on. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sccolbert at gmail.com Wed Mar 16 09:51:30 2011 From: sccolbert at gmail.com (Chris Colbert) Date: Wed, 16 Mar 2011 09:51:30 -0400 Subject: How to start contributing? In-Reply-To: References: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> Message-ID: On Wed, Mar 16, 2011 at 5:41 AM, Thouis (Ray) Jones wrote: > > > I believe the usual procedure is to fork stefan's master branch and > work from there. > > This. -------------- next part -------------- An HTML attachment was scrubbed... URL: From thouis at gmail.com Wed Mar 16 05:41:48 2011 From: thouis at gmail.com (Thouis (Ray) Jones) Date: Wed, 16 Mar 2011 10:41:48 +0100 Subject: How to start contributing? In-Reply-To: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> References: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> Message-ID: I was planning on working on moving the cpmorphology code into scikits, but haven't started. I don't think everything in the cpmorphology.py file is needed, so the first thing might be to get a list of which functions are there and decide which are worth moving or not. Or, if you would rather just dive in, you could just move those functions that correspond to the bwmorph operations from Matlab, many (all?) of which Lee rewrote for CellProfiler. I believe the usual procedure is to fork stefan's master branch and work from there. Ray Jones On Wed, Mar 16, 2011 at 03:42, Dan Farmer wrote: > Hello, > I've recently started using SciPy/NumPy for my computer vision research work > and I wanted to get involved with scikits.image to help build a useful > library and to learn more about NumPy and Cython programming. I looked at > the tasks list and it seems there is a range of work from fairly simple > integration work to some high-end plans (OpenCL backend, etc.). So I thought > I might start with e.g., merging some of the Cell Profiler code, but then I > saw that there are 24 forks of scikits.image on github and it's not clear to > me what is already being worked on. So I thought I would just ask if someone > could point me in the direction of some entry level work to do? > Actually I just thought of something else, what is required to update the > OpenCV bindings for OpenCV 2.2? I can't seem to use scikits.image at the > moment because it can't find the opencv that it's looking for (the default > Python bindings for 2.2 work, and native C++ code works too -- so it's > definitely installed correctly). > Thanks, > Dan From sccolbert at gmail.com Wed Mar 16 13:32:41 2011 From: sccolbert at gmail.com (Chris Colbert) Date: Wed, 16 Mar 2011 13:32:41 -0400 Subject: How to start contributing? In-Reply-To: References: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> Message-ID: On Wed, Mar 16, 2011 at 11:03 AM, Dan Farmer wrote: > I have about 1.5 years of experience doing vision and image processing > programming in C++. I've implemented things like FFT, Wavelet > transform, Principal Component Analysis for face recognition, etc. > > I've used Python as a glue language off and on for maybe 3 years, but > again just started using SciPy seriously in the last few weeks. > Actually your SciPy 2010 paper was part of what made me decide to give > it a try and it's proven to be a really nice environment to work in > (though I'm still learning the "vectorized programming" mindset). > > I'm glad the paper was of use/inspired someone :-) > Finally re: the OpenCV wrappers: I agree with your take on it. For one > thing the OpenCV python bindings in 2.2 were re-written and are much > better than they used to be [1], but on the other hand they still feel > clunky compared to how seamless the SciPy libraries are ("What do you > mean I have to convert this array to a CvMat?"). So I'd love to see > more of that implemented directly in scikits.image. > > Interesting, I took a brief look at the new sources, and it seems like they are exposing the IPLImage structures as numpy arrays via the array interface. That's a good idea, and pretty much obviates the need for our current wrappers. > So let me know what you think would be good to work on also and I'll > try to integrate your feedback with Stefan's and put together some > kind of plan of attack. > > How would you feel about doing a bit of research on the 2D convolution task listed here? http://stefanv.github.com/scikits.image/gsoc2011.html I know that CVFilter2D is quite intelligent. For example, it will switch between the spatial domain and frequency domain to do the convolution based on the size of the image and the kernel. It also makes heavy use of SSE/2 instructions. It would be worth taking a look at exactly how the CVFilter2D is constructed and understand the code flow, so we have a good idea of what exactly is making it so fast, and what ideas from that we can borrow to make our own fast routine. So many algorithms rely on 2D convolution that it only makes sense to a have really really fast core routine with C and Python Api's that everyone can depend upon. If you want something more on the Python side, or on the GUI side, there is plenty to do there as well. Just let me know your interests. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Wed Mar 16 10:08:58 2011 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Wed, 16 Mar 2011 16:08:58 +0200 Subject: How to start contributing? In-Reply-To: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> References: <10849609.140.1300243329623.JavaMail.geo-discussion-forums@prfc6> Message-ID: Hi Dan On Wed, Mar 16, 2011 at 4:42 AM, Dan Farmer wrote: > I've recently started using SciPy/NumPy for my computer vision research work > and I wanted to get involved with scikits.image to help build a useful > library and to learn more about NumPy and Cython programming. I looked at Welcome! > the tasks list and it seems there is a range of work from fairly simple > integration work to some high-end plans (OpenCL backend, etc.). So I thought > I might start with e.g., merging some of the Cell Profiler code, but then I > saw that there are 24 forks of scikits.image on github and it's not clear to > me what is already being worked on. So I thought I would just ask if someone > could point me in the direction of some entry level work to do? You may try your hand on any of the tasks set out. Personally, I'd love for someone to improve our docs building system so that it builds the docs *outside* the scikits.image directory (currently, it breaks the built version everytime you do, which is annoying). But there are plenty of more technical tasks waiting. The GSOC suggestions give you a good idea of the larger projects we are contemplating in the near future. As for integrating code, other than the CellProfiler code, I also am busy porting grey-level co-occurrence matrix code (written in C); but I never got this done, so it may be a good place to learn Cython. Chris is quite keen to have someone implement/port OpenCV functionality, but I'm not sure how we're going to get those kinds of speeds yet. A really exciting project is the implementation of backend engines so that we may compute results using either NumPy, OpenCL, Theano, etc. The process is pretty simply: fork my branch on github.com/stefanv/scikits.image and start working on a feature branch of your own. When you're ready to let someone have a look at the code, simply send an email to the list, or file a pull request on github. We like to go through one or more rounds of feedback before integrating patches. If you have any questions, don't hesitate to ask. We are always happy to help new contributors! > Actually I just thought of something else, what is required to update the > OpenCV bindings for OpenCV 2.2? I can't seem to use scikits.image at the > moment because it can't find the opencv that it's looking for (the default > Python bindings for 2.2 work, and native C++ code works too -- so it's > definitely installed correctly). I thought we already did update to OpenCV 2.2, but if the library isn't found it may be that your system calls it something other than libopencv.dll/so (ubuntu, for example, likes to call things *.so.3, and we may have to account for that). That reminds me: while you learn about the scikit, do make notes or write up your experiences; we can certainly do with a thicker user manual / more tutorials. Thanks for helping out! Cheers St?fan From dfarmernv at gmail.com Sat Mar 19 03:44:21 2011 From: dfarmernv at gmail.com (Dan Farmer) Date: Sat, 19 Mar 2011 00:44:21 -0700 (PDT) Subject: How to start contributing? In-Reply-To: Message-ID: <31992968.1205.1300520661299.JavaMail.geo-discussion-forums@prcm18> Hi Stefan, I had an opportunity to look at a few things tonight and found my first landmine :P I had installed scikits.learn using pip and after cloning scikits.image from my fork on github I could not get it to import scikits.image. After much tearing of hair I realized that it (seems to have been) that having a scikit in site-packages and one on the PYTHONPATH caused it to "short-circuit" it's search early. Removing scikits.learn fixed the issue, and I just cloned learn from git and added it to my pythonpath and now I can use both (with both built in place). -Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfarmernv at gmail.com Sat Mar 19 03:53:45 2011 From: dfarmernv at gmail.com (Dan Farmer) Date: Sat, 19 Mar 2011 00:53:45 -0700 (PDT) Subject: How to start contributing? In-Reply-To: Message-ID: <7785315.277.1300521225820.JavaMail.geo-discussion-forums@prc35> Thanks Ray, I see what you mean (lots of utility functions mixed in there I guess?). I know for another project I'm working on I'd like to merge the canny edge detector over pretty soon. I'll check things out some more and send out a new email regarding the morphology operations. -Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfarmernv at gmail.com Sat Mar 26 10:41:39 2011 From: dfarmernv at gmail.com (Dan Farmer) Date: Sat, 26 Mar 2011 07:41:39 -0700 Subject: Almost ready to issue pull for Canny? Message-ID: Hi Group, I merged Cell Profiler's Canny over last weekend and spent this week "dogfooding" it on my own project, I had a few questions and ideas to run by before I push it back to github. 1. Organization: In general the CP filter code is mostly in one file, I tried to follow the example of the constant time median filter merge that was already done. I just wanted to make sure that you guys want one filter per file? 2. API: So I used the function in part of a project I've been doing this semester and my call to canny looks like this: canny(img, np.ones(img.shape, dtype=bool), 5, 0.005, 0.01), the np.ones bit is because the Cell Profiler canny (as far as I can tell) requires a binary mask, and the 0.005 and 0.01 are the low and high thresholds for hysteresis thresholding. As you can image that took me quit a bit of fiddling to get those values. It seems that since it's thresholding the magnitude values you wind up with strange values. So my thoughts were: can we add a default parameter for the mask so that end-users of the library don't have to think about it unless they want to (I do think it's a nice functionality to have), and secondly should anything be done (like normalizing between 0 and 1) about the pixel values so that there can be some intuition about threshold values? 3. As far as the pull request goes, do I just merge my local canny branch back into master locally and then push that to github or do I actually push the branch to github and issue a pull against that? Thanks, Dan From thouis.jones at curie.fr Sun Mar 27 08:25:12 2011 From: thouis.jones at curie.fr (Thouis (Ray) Jones) Date: Sun, 27 Mar 2011 14:25:12 +0200 Subject: Almost ready to issue pull for Canny? In-Reply-To: References: Message-ID: I would definitely add a default for the mask, as a keyword argument with None indicating a full-on mask. I'm not very familiar with the code, but it seems like making the thresholds be relative to the image.min() and image.max() would be fine, or it might be more robust having them set relative to the median pixel value and MAD, or 5th and 95th percentiles. It looks like matlab chooses them relative to the maximum gradient magnitude. Lee - any opinions? Ray Jones On Sat, Mar 26, 2011 at 15:41, Dan Farmer wrote: > Hi Group, > > I merged Cell Profiler's Canny over last weekend and spent this week > "dogfooding" it on my own project, I had a few questions and ideas to > run by before I push it back to github. > > 1. Organization: In general the CP filter code is mostly in one file, > I tried to follow the example of the constant time median filter merge > that was already done. I just wanted to make sure that you guys want > one filter per file? > 2. API: So I used the function in part of a project I've been doing > this semester and my call to canny looks like this: canny(img, > np.ones(img.shape, dtype=bool), 5, 0.005, 0.01), the np.ones bit is > because the Cell Profiler canny (as far as I can tell) requires a > binary mask, and the 0.005 and 0.01 are the low and high thresholds > for hysteresis thresholding. As you can image that took me quit a bit > of fiddling to get those values. It seems that since it's thresholding > the magnitude values you wind up with strange values. So my thoughts > were: can we add a default parameter for the mask so that end-users of > the library don't have to think about it unless they want to (I do > think it's a nice functionality to have), and secondly should anything > be done (like normalizing between 0 and 1) about the pixel values so > that there can be some intuition about threshold values? > 3. As far as the pull request goes, do I just merge my local canny > branch back into master locally and then push that to github or do I > actually push the branch to github and issue a pull against that? > > Thanks, > Dan > From ralf.gommers at googlemail.com Sun Mar 27 10:50:14 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Sun, 27 Mar 2011 16:50:14 +0200 Subject: Almost ready to issue pull for Canny? In-Reply-To: References: Message-ID: On Sat, Mar 26, 2011 at 3:41 PM, Dan Farmer wrote: > Hi Group, > > I merged Cell Profiler's Canny over last weekend and spent this week > "dogfooding" it on my own project, I had a few questions and ideas to > run by before I push it back to github. > > 1. Organization: In general the CP filter code is mostly in one file, > I tried to follow the example of the constant time median filter merge > that was already done. I just wanted to make sure that you guys want > one filter per file? I find the files under filter/ too short now, that could all be in a single file IMHO. Python is not Matlab:) > 3. As far as the pull request goes, do I just merge my local canny > branch back into master locally and then push that to github or do I > actually push the branch to github and issue a pull against that? It's better not to do any merges into or from master. Just push your branch to github and then send a pull request. There's documentation on how to work with git branches at http://stefanv.github.com/scikits.image/gitwash/development_workflow.html Cheers, Ralf From stefan at sun.ac.za Mon Mar 28 07:20:16 2011 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 28 Mar 2011 13:20:16 +0200 Subject: Almost ready to issue pull for Canny? In-Reply-To: References: Message-ID: Hi Dan On Sat, Mar 26, 2011 at 4:41 PM, Dan Farmer wrote: > I merged Cell Profiler's Canny over last weekend and spent this week > "dogfooding" it on my own project, I had a few questions and ideas to > run by before I push it back to github. Fantastic! It looks like Ralf and Thouis answered most of your questions. Need me know if you need anything else before making a pull request. You may also have a look at http://stefanv.github.com/scikits.image/contribute.html#development-process for a description of our development process. Thanks! St?fan From dfarmernv at gmail.com Wed Mar 30 19:02:40 2011 From: dfarmernv at gmail.com (Dan Farmer) Date: Wed, 30 Mar 2011 16:02:40 -0700 Subject: Review: Canny Message-ID: https://github.com/dfarmer/scikits.image/compare/master...dfarmer-filters-canny Mostly just trying to follow procedure. I already mentioned my concerns in the previous thread. I made one stab at introduced a "None" default for the mask, but I got hung up and reverted it. The default I was going to propose was np.ones(img.shape,bool) (and after the fact I even noticed that's how it is used in one of the unit tests). But I started thinking that that could be quite wasteful of memory if you were working with large images (on my test use case with ~512x512 images it's about 300 KB for the "fake" mask). The problem I had was that if I don't allocate the emask array I get run-time errors starting at line 129 (in the diff of canny.py) because the arrays all have different lengths if they aren't logical_and'd with emask above. So anyway, I thought I would let you take a look at the code and decide if you'd like me to try to figure out a way around that or incorporate it as is (with no default) or add the np.ones default. The tests pass and as I mentioned it has worked fine so far in day-to-day use. Also regarded Ralf's comment to consolidate into one filter.py file, I agree with that I just figured I would do that with the next batch (in a separate commit). But again, let me know if I'm not approaching this properly. Thanks, Dan From sccolbert at gmail.com Wed Mar 30 19:17:33 2011 From: sccolbert at gmail.com (Chris Colbert) Date: Wed, 30 Mar 2011 19:17:33 -0400 Subject: Review: Canny In-Reply-To: References: Message-ID: I'll try to look at this this week/weekend. I actually need a canny detector next week, so I have incentive to get this pushed :) On Wed, Mar 30, 2011 at 7:02 PM, Dan Farmer wrote: > > https://github.com/dfarmer/scikits.image/compare/master...dfarmer-filters-canny > > Mostly just trying to follow procedure. I already mentioned my > concerns in the previous thread. I made one stab at introduced a > "None" default for the mask, but I got hung up and reverted it. The > default I was going to propose was np.ones(img.shape,bool) (and after > the fact I even noticed that's how it is used in one of the unit > tests). But I started thinking that that could be quite wasteful of > memory if you were working with large images (on my test use case with > ~512x512 images it's about 300 KB for the "fake" mask). > > The problem I had was that if I don't allocate the emask array I get > run-time errors starting at line 129 (in the diff of canny.py) because > the arrays all have different lengths if they aren't logical_and'd > with emask above. > > So anyway, I thought I would let you take a look at the code and > decide if you'd like me to try to figure out a way around that or > incorporate it as is (with no default) or add the np.ones default. > > The tests pass and as I mentioned it has worked fine so far in > day-to-day use. Also regarded Ralf's comment to consolidate into one > filter.py file, I agree with that I just figured I would do that with > the next batch (in a separate commit). But again, let me know if I'm > not approaching this properly. > > Thanks, > Dan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfarmernv at gmail.com Thu Mar 31 13:26:25 2011 From: dfarmernv at gmail.com (Dan Farmer) Date: Thu, 31 Mar 2011 10:26:25 -0700 Subject: Review: Canny In-Reply-To: References: Message-ID: I will try to address your comments tonight and also see about removing smooth.py and just incorporating the one function we're using into canny.py for now as Thouis suggested. Thanks to both of you for looking at it. I'll message back when I've pushed the changes. -Dan 2011/3/31 St?fan van der Walt : > Hi Dan > > On Thu, Mar 31, 2011 at 1:02 AM, Dan Farmer wrote: >> https://github.com/dfarmer/scikits.image/compare/master...dfarmer-filters-canny > > I read through your patch and made some preliminary comments. > >> Mostly just trying to follow procedure. I already mentioned my >> concerns in the previous thread. I made one stab at introduced a >> "None" default for the mask, but I got hung up and reverted it. The >> default I was going to propose was np.ones(img.shape,bool) (and after >> the fact I even noticed that's how it is used in one of the unit >> tests). But I started thinking that that could be quite wasteful of >> memory if you were working with large images (on my test use case with >> ~512x512 images it's about 300 KB for the "fake" mask). > > It seems as though this specific implementation of the algorithms > relies on creating the mask, so I don't think you can get away from > it. ?The typical way to do it would be: > > def canny(..., mask=None, ...): > ? ?if mask is None: > ? ? ? ?mask = np.ones(x.shape, dtype=bool) > >> The problem I had was that if I don't allocate the emask array I get >> run-time errors starting at line 129 (in the diff of canny.py) because >> the arrays all have different lengths if they aren't logical_and'd >> with emask above. > > Yes, I think the only way to avoid allocating the mask explicitly is > to rewrite the algorithm in Cython, where you can modify behaviour > inside the for-loop. > > Regards > St?fan > From thouis at gmail.com Thu Mar 31 05:12:56 2011 From: thouis at gmail.com (Thouis (Ray) Jones) Date: Thu, 31 Mar 2011 11:12:56 +0200 Subject: Review: Canny In-Reply-To: References: Message-ID: I wouldn't be concerned about allocating a mask of bools the same size as the input array. Most of the operations on the image data are going to create temporary arrays of floats, eight times bigger. You could conserve some memory by reusing the variable: mask = binary_erosion(mask, ...) but that's sacrificing a bit of clarity for probably a not very large savings. Speaking of clarity, I would replace "emask" with "eroded_mask". Given the arguments above, I suggest moving mask to the last argument, make it a keyword with a default of None, which is replaced with ones(image.shape, dtype=bool) Also, I would move the smooth_with_function_and_mask() into canny.py and remove smooth.py, for now. The other functions in smooth.py may be needed in the future, but not yet. Thouis Jones On Thu, Mar 31, 2011 at 01:02, Dan Farmer wrote: > https://github.com/dfarmer/scikits.image/compare/master...dfarmer-filters-canny > > Mostly just trying to follow procedure. I already mentioned my > concerns in the previous thread. I made one stab at introduced a > "None" default for the mask, but I got hung up and reverted it. The > default I was going to propose was np.ones(img.shape,bool) (and after > the fact I even noticed that's how it is used in one of the unit > tests). But I started thinking that that could be quite wasteful of > memory if you were working with large images (on my test use case with > ~512x512 images it's about 300 KB for the "fake" mask). > > The problem I had was that if I don't allocate the emask array I get > run-time errors starting at line 129 (in the diff of canny.py) because > the arrays all have different lengths if they aren't logical_and'd > with emask above. > > So anyway, I thought I would let you take a look at the code and > decide if you'd like me to try to figure out a way around that or > incorporate it as is (with no default) or add the np.ones default. > > The tests pass and as I mentioned it has worked fine so far in > day-to-day use. Also regarded Ralf's comment to consolidate into one > filter.py file, I agree with that I just figured I would do that with > the next batch (in a separate commit). But again, let me know if I'm > not approaching this properly. > > Thanks, > Dan > From stefan at sun.ac.za Thu Mar 31 05:13:41 2011 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 31 Mar 2011 11:13:41 +0200 Subject: Review: Canny In-Reply-To: References: Message-ID: Hi Dan On Thu, Mar 31, 2011 at 1:02 AM, Dan Farmer wrote: > https://github.com/dfarmer/scikits.image/compare/master...dfarmer-filters-canny I read through your patch and made some preliminary comments. > Mostly just trying to follow procedure. I already mentioned my > concerns in the previous thread. I made one stab at introduced a > "None" default for the mask, but I got hung up and reverted it. The > default I was going to propose was np.ones(img.shape,bool) (and after > the fact I even noticed that's how it is used in one of the unit > tests). But I started thinking that that could be quite wasteful of > memory if you were working with large images (on my test use case with > ~512x512 images it's about 300 KB for the "fake" mask). It seems as though this specific implementation of the algorithms relies on creating the mask, so I don't think you can get away from it. The typical way to do it would be: def canny(..., mask=None, ...): if mask is None: mask = np.ones(x.shape, dtype=bool) > The problem I had was that if I don't allocate the emask array I get > run-time errors starting at line 129 (in the diff of canny.py) because > the arrays all have different lengths if they aren't logical_and'd > with emask above. Yes, I think the only way to avoid allocating the mask explicitly is to rewrite the algorithm in Cython, where you can modify behaviour inside the for-loop. Regards St?fan