From deklerkmc at gmail.com Mon Jul 1 03:40:30 2013 From: deklerkmc at gmail.com (Marc de Klerk) Date: Mon, 1 Jul 2013 00:40:30 -0700 (PDT) Subject: Graph Cuts implementation In-Reply-To: <51CEF68C.4020607@ais.uni-bonn.de> References: <1776a04e-954c-413c-954e-04d83c424721@googlegroups.com> <20130623214403.GB3302@phare.normalesup.org> <11fee39a-5140-4170-bdf5-dd530bd40f55@googlegroups.com> <51CEF68C.4020607@ais.uni-bonn.de> Message-ID: <738ad995-c03a-4971-bd04-dc189d9b098c@googlegroups.com> Hey Andy, My apologies - I'm a few days late on replying, but here's a rundown: - Graph-cut implementations (Cython and GPU) (I had not planned on implementing alpha extension, I'll have to to my list of nice-to-haves) - Grow-cut implementations (Cython and GPU) - QuickShift implementation (GPU) - A feasibility study of GPU algorithms and their integration into skim age My full proposal is at https://google-melange.appspot.com/gsoc/proposal/review/google/gsoc2013/deklerkmc/1 Mmm, I'm not aware of any patent issues!! Could you point in the direction where I can find out!? Skimage isn't really planning on going the GPU route right now, St?fan told me they did have a GSOC student a couple years ago that worked on creating an easily-switchable GPU backend, but it didn't materialize for a number of reasons. One of the goals of this project is to see weather we should look into it again though... That's great! I could do with a hand - which seg algorithms did you do? Caio, Marc On Saturday, June 29, 2013 5:00:28 PM UTC+2, amue... at ais.uni-bonn.de wrote: > > Hey Marc. > I just saw that you are working on graph cuts and segmentation for > skimage. > That is pretty awesome. I'm super busy at the moment so I only sort of > follow skimage at the time > and I can't see melange. > Could you shortly give an idea of what the goals of your GSOC are? > Are you also planning to implement alpha-expansion? And what are the > thoughts about the patent issues? > > Also, I seem to have completely missed the fact that skimage wants to do > gpu now. > Are there any pointers on how this is planned / what is already > implemented? > > I implemented some of the segmentation algorithms in skimage and I'd > really like to > know what is happening and if I could help in any way. > I also did some energy minimization stuff, but was a bit bummed out by > the patent issues. > > Btw, the slic implementation is not identical with the reference > implementation. > If you want to work on segmentation, I think this should really be > investigated .... > > Cheers, > Andy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deklerkmc at gmail.com Mon Jul 1 03:42:44 2013 From: deklerkmc at gmail.com (Marc de Klerk) Date: Mon, 1 Jul 2013 00:42:44 -0700 (PDT) Subject: Graph Cuts implementation In-Reply-To: <51CEF930.2070604@ais.uni-bonn.de> References: <1776a04e-954c-413c-954e-04d83c424721@googlegroups.com> <20130623214403.GB3302@phare.normalesup.org> <11fee39a-5140-4170-bdf5-dd530bd40f55@googlegroups.com> <51CEF68C.4020607@ais.uni-bonn.de> <51CEF7B0.9050005@ais.uni-bonn.de> <51CEF930.2070604@ais.uni-bonn.de> Message-ID: Ah yeah! those are the two papers that I've been using! - CudaCuts - Brian Fulkerson's Really Quick Shift I haven't actually had any experience with slic - in all honestly I've seen it for the first time now. Have you worked with both of them? - What are your thoughts? Caio again, Marc On Saturday, June 29, 2013 5:11:44 PM UTC+2, amue... at ais.uni-bonn.de wrote: > > pps: > have you read about CUDA cuts? > http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4563095&tag=1 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmanuelle.gouillart at nsup.org Mon Jul 1 07:59:16 2013 From: emmanuelle.gouillart at nsup.org (Emmanuelle Gouillart) Date: Mon, 1 Jul 2013 13:59:16 +0200 Subject: segmentation fault with the viewer In-Reply-To: References: <20130629212054.GC2073@phare.normalesup.org> <20130629220318.GD2073@phare.normalesup.org> Message-ID: <20130701115916.GA9655@phare.normalesup.org> > Are you on master? Specifically, a version later than yesterday morning? The > viewer-linking PR that was merged yesterday had a number of fixes for PySide. I > don't see any issue on PyQt at the moment. Yes, I'm on master (updated this morning, and I still get the same problem). Maybe I have some libraries that are too old, I'll check on a machine with a more recent Ubuntu when I get the occasion. Thanks for your help, anyway! Emmanuelle From jni.soma at gmail.com Mon Jul 1 19:45:06 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 1 Jul 2013 19:45:06 -0400 Subject: Cython guidelines In-Reply-To: <51D1F0E9.4080204@ais.uni-bonn.de> References: <51D1F0E9.4080204@ais.uni-bonn.de> Message-ID: Hi Andy, On Mon, Jul 1, 2013 at 5:13 PM, Andreas Mueller wrote: > Turns out, I didn't. That explains why they are slower than C. Not sure > why I did that... > Not really: http://jakevdp.github.io/blog/2012/08/08/memoryview-benchmarks/ Cython + pointers is just as fast as memoryviews. And on SLIC at least, you made liberal use of pointers. =) I just tried my hand at memoryviews at St?fan's request and it's quite a bit slower currently. Juan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amueller at ais.uni-bonn.de Mon Jul 1 16:57:25 2013 From: amueller at ais.uni-bonn.de (Andreas Mueller) Date: Mon, 01 Jul 2013 22:57:25 +0200 Subject: Graph Cuts implementation In-Reply-To: <738ad995-c03a-4971-bd04-dc189d9b098c@googlegroups.com> References: <1776a04e-954c-413c-954e-04d83c424721@googlegroups.com> <20130623214403.GB3302@phare.normalesup.org> <11fee39a-5140-4170-bdf5-dd530bd40f55@googlegroups.com> <51CEF68C.4020607@ais.uni-bonn.de> <738ad995-c03a-4971-bd04-dc189d9b098c@googlegroups.com> Message-ID: <51D1ED35.6030208@ais.uni-bonn.de> On 07/01/2013 09:40 AM, Marc de Klerk wrote: > Hey Andy, > > My apologies - I'm a few days late on replying, but here's a rundown: Not at all, I'm pretty busy myself. Emanuelle added me to the GSoC group, so we can also discuss there. > * Graph-cut implementations (Cython and GPU) (I had not planned on > implementing alpha extension, I'll have to to my list of > nice-to-haves) > For graph-cut, I think it would be most convenient to compare against my python wrappers for GCO: http://peekaboo-vision.blogspot.de/2012/05/graphcuts-for-python-pygco.html GCO includes the Boykov implementation of Boykov-Kolmogorov. > * Grow-cut implementations (Cython and GPU) > I haven't heard about that yet. Have to have a look at the papers.. > > * QuickShift implementation (GPU) > Why do you want to reimplement QuickShift for the GPU? The implementation by Brian Fulkerson is open source, isn't it? > My full proposal is at > https://google-melange.appspot.com/gsoc/proposal/review/google/gsoc2013/deklerkmc/1 > Yeah, I did find it in the end, thanks :) > Mmm, I'm not aware of any patent issues!! Could you point in the > direction where I can find out!? That was mostly about alpha-expansion. I have no idea about grow cut, I'll have a look at the papers. > Skimage isn't really planning on going the GPU route right now, St?fan > told me they did have a GSOC student a couple years ago that worked on > creating an easily-switchable GPU backend, but it didn't materialize > for a number of reasons. One of the goals of this project is to see > weather we should look into it again though... Adding GPU code would make packaging and platform independence much harder, I was a bit surprised when I saw that you would do it. > > That's great! I could do with a hand - which seg algorithms did you do? > I implemented the "fast graph based" / Felsenszwalbs, Quickshift and SLIC for skimage in Cython. There is a blog-post by me here: http://peekaboo-vision.blogspot.de/2012/09/segmentation-algorithms-in-scikits-image.html For SLIC vs quickshift: They have a similar approach to the problem, only SLIC uses a much simpler clustering method, k-means. The thing is that (at least subjectively) the GPU implementation of quickshift seems to be similarly fast as the CPU implementation of slic. When using the algorithms for semantic image segmentation using CRFs (which is what I do), SLIC seems to do slightly better even. My gut feeling is that they are on par for many tasks, with SLIC being much faster. SLIC provies usually much more compact segments than quickshift, but that can be tuned. There is also a GPU slic implementation, with a pretty nice realtime video: https://www.youtube.com/watch?v=6o2HogjeZkE I would be really really interested in graph cuts if they are similarly fast as the Boykov or Kolmogorov implementations. I really need that for pystruct: http://pystruct.github.io/ but I was to lazy to do it yet. It has been a while since I looked into the graph cut gpu implementations, but I had the feeling the speedups were a bit meager. What do you think can be expected? Really looking forward to what you'll come up with :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From amueller at ais.uni-bonn.de Mon Jul 1 17:13:13 2013 From: amueller at ais.uni-bonn.de (Andreas Mueller) Date: Mon, 01 Jul 2013 23:13:13 +0200 Subject: Cython guidelines In-Reply-To: References: Message-ID: <51D1F0E9.4080204@ais.uni-bonn.de> On 05/29/2013 12:37 PM, St?fan van der Walt wrote: > Hi everyone > > Two Cython related suggestions: > I just read your (admittedly quite old) mail just now and though "hey didn't I use memory views for the segmentation algorithms?" Turns out, I didn't. That explains why they are slower than C. Not sure why I did that... One day, I'll update them, I'm sure ;) Cheers, Andy From tsyu80 at gmail.com Tue Jul 2 11:19:34 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Tue, 2 Jul 2013 10:19:34 -0500 Subject: segmentation fault with the viewer In-Reply-To: <20130701115916.GA9655@phare.normalesup.org> References: <20130629212054.GC2073@phare.normalesup.org> <20130629220318.GD2073@phare.normalesup.org> <20130701115916.GA9655@phare.normalesup.org> Message-ID: On Mon, Jul 1, 2013 at 6:59 AM, Emmanuelle Gouillart < emmanuelle.gouillart at nsup.org> wrote: > > > Are you on master? Specifically, a version later than yesterday morning? > The > > viewer-linking PR that was merged yesterday had a number of fixes for > PySide. I > > don't see any issue on PyQt at the moment. > > Yes, I'm on master (updated this morning, and I still get the same > problem). Maybe I have some libraries that are too old, I'll check on a > machine with a more recent Ubuntu when I get the occasion. > > Thanks for your help, anyway! > Emmanuelle > Just to follow up with some more details: In my current setup (Python 2.7.3, PySide 1.1.1, Qt 4.8.2), the Qt backend for ipython doesn't block. Also, when I run ipython with the Tk backend I can't reproduce the segfault, but it does block. I'm not sure why we see different behavior, but I've had enough PySide issues to guess that it's the likely cause. I am however, running a dev version of IPython, so there maybe some changes there as well. Best, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.t.wilson.bak at googlemail.com Tue Jul 2 16:59:40 2013 From: r.t.wilson.bak at googlemail.com (Robin Wilson) Date: Tue, 2 Jul 2013 13:59:40 -0700 (PDT) Subject: Get border pixels of labelled region Message-ID: <6893cdb1-c810-4ec8-9950-b746963a0481@googlegroups.com> Hi all, Is there a way to get the pixels on the border of a labelled region in an image using skimage? I've done edge detection, and then filled the resulting shapes (after some edge linking), and would now like to be able to get the pixels on the border of each of these shapes. I would have thought that getting borders would be an option in regionprops, but it doesn't seem to be. Any ideas? Cheers, Robin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Tue Jul 2 18:59:18 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 2 Jul 2013 18:59:18 -0400 Subject: Cython guidelines In-Reply-To: <51D34D82.2040202@ais.uni-bonn.de> References: <51D1F0E9.4080204@ais.uni-bonn.de> <51D34D82.2040202@ais.uni-bonn.de> Message-ID: LOL I find it amusing how little you remember about this implementation! ;) On Tue, Jul 2, 2013 at 6:00 PM, Andreas Mueller wrote: > On 07/02/2013 01:45 AM, Juan Nunez-Iglesias wrote: > > Hi Andy, > > On Mon, Jul 1, 2013 at 5:13 PM, Andreas Mueller > wrote: > >> Turns out, I didn't. That explains why they are slower than C. Not sure >> why I did that... >> > > Not really: > http://jakevdp.github.io/blog/2012/08/08/memoryview-benchmarks/ > > Cython + pointers is just as fast as memoryviews. And on SLIC at least, > you made liberal use of pointers. =) I just tried my hand at memoryviews at > St?fan's request and it's quite a bit slower currently. > > I did use pointers? Well as far as I remember, I tried to make it fast. > So yeah, pointers make sense. > Not sure what is wrong, then ... anyhow, speed is acceptable, I guess.. > Thanks for giving it a shot! > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoenberger at demuc.de Tue Jul 2 17:10:46 2013 From: jschoenberger at demuc.de (=?iso-8859-1?Q?Johannes_Sch=F6nberger?=) Date: Tue, 2 Jul 2013 23:10:46 +0200 Subject: Get border pixels of labelled region In-Reply-To: <6893cdb1-c810-4ec8-9950-b746963a0481@googlegroups.com> References: <6893cdb1-c810-4ec8-9950-b746963a0481@googlegroups.com> Message-ID: <39E0D615-C4D3-44AB-9267-9D404FDD41F1@demuc.de> Hi, Do you mean the functionality provided by `skimage.measure.find_contours`? Johannes Sch?nberger Am 02.07.2013 um 22:59 schrieb Robin Wilson : > Hi all, > > Is there a way to get the pixels on the border of a labelled region in an image using skimage? I've done edge detection, and then filled the resulting shapes (after some edge linking), and would now like to be able to get the pixels on the border of each of these shapes. I would have thought that getting borders would be an option in regionprops, but it doesn't seem to be. > > Any ideas? > > Cheers, > > Robin > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From amueller at ais.uni-bonn.de Tue Jul 2 18:00:34 2013 From: amueller at ais.uni-bonn.de (Andreas Mueller) Date: Wed, 03 Jul 2013 00:00:34 +0200 Subject: Cython guidelines In-Reply-To: References: <51D1F0E9.4080204@ais.uni-bonn.de> Message-ID: <51D34D82.2040202@ais.uni-bonn.de> On 07/02/2013 01:45 AM, Juan Nunez-Iglesias wrote: > Hi Andy, > > On Mon, Jul 1, 2013 at 5:13 PM, Andreas Mueller > > wrote: > > Turns out, I didn't. That explains why they are slower than C. Not > sure why I did that... > > > Not really: > http://jakevdp.github.io/blog/2012/08/08/memoryview-benchmarks/ > > Cython + pointers is just as fast as memoryviews. And on SLIC at > least, you made liberal use of pointers. =) I just tried my hand at > memoryviews at St?fan's request and it's quite a bit slower currently. > I did use pointers? Well as far as I remember, I tried to make it fast. So yeah, pointers make sense. Not sure what is wrong, then ... anyhow, speed is acceptable, I guess.. Thanks for giving it a shot! -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Tue Jul 2 21:48:51 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Wed, 3 Jul 2013 07:18:51 +0530 Subject: segmentation fault with the viewer In-Reply-To: References: <20130629212054.GC2073@phare.normalesup.org> <20130629220318.GD2073@phare.normalesup.org> <20130701115916.GA9655@phare.normalesup.org> Message-ID: Hi, I'm not sure what the term blocking means here but the test script seems to work fine on my system. Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From lisa.torrey at gmail.com Wed Jul 3 15:10:19 2013 From: lisa.torrey at gmail.com (Lisa Torrey) Date: Wed, 3 Jul 2013 12:10:19 -0700 (PDT) Subject: seeking advice on HoG applicability Message-ID: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> Hi folks - I'm looking at an image classification problem, and wondering whether HoG should be applicable to it. If any of you are willing to take a look and give some advice, that would be wonderful. I have a machine learning background, but working with image data is a new area for me. The problem is to distinguish between two types of moss. Type 1 tends to consist of upright stalks with few or no branches. Type 2 tends to have secondary branches coming off the primary stalk. There's quite a bit of visual diversity within these types. I've linked some images below. Type 1: http://myslu.stlawu.edu/~ltorrey/moss/andrea_rothii.jpg http://myslu.stlawu.edu/~ltorrey/moss/mnium_spinulosum.jpg Type 2: http://myslu.stlawu.edu/~ltorrey/moss/climacium_americanum.jpg http://myslu.stlawu.edu/~ltorrey/moss/rhytidiadelphus_triquetrus.jpg When I came across the Dalal paper, I thought my problem might have something in common with the pedestrian detection problem, so I tried extracting HoG features and feeding them into an SVM classifier. This failed miserably - the SVM does no better than random guessing. I'm now trying to weigh potential reasons. The first possible reason on my list is the diversity among mosses of the same type. There isn't necessarily a "type 1 shape" and a "type 2 shape," at least not to the degree that there's a "pedestrian shape." Perhaps this means HoG isn't really the right approach to my problem after all? Other reasons may include: - I have much less data. (Just 77 positives and 78 negatives, compared to Dalal's 1239 and 12180.) - My images aren't all the same size, like the pedestrian images are. (I'm not sure if this would matter?) - My images are much higher resolution. (I've been downscaling them by a factor of 8, but the feature vectors are still enormous.) - I'm just using default parameters so far. (In the absence of any signal, tweaking seems unproductive.) Any thoughts or suggestions would be welcome! -Lisa -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Wed Jul 3 08:50:23 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Wed, 3 Jul 2013 18:20:23 +0530 Subject: Weird - 'if' body not getting executed in spite of the expression being True Message-ID: Hi everyone, It's feels stupid even as I'm typing this mail out. But as the subject states, the 'if' body is simply not getting executed. I've tried using pdb++ to debug and every time I step in after seeing that the expression should be True, the interpreter simply jumps the code block and resumes from the enclosing loop. I think it may be something funny with the indentation or so. Though PEP8 doesn't throw any warning or errors. I've retyped the statement again and again and I'm running out of ideas now. If anyone has time then please give it a look, https://github.com/chintak/scikit-image/blob/inpaint/skimage/inpaint/fmm.py. The if at line number 51 in fast_marching_method function. Thanks, Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Wed Jul 3 10:33:26 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Wed, 3 Jul 2013 20:03:26 +0530 Subject: Weird - 'if' body not getting executed in spite of the expression being True In-Reply-To: References: Message-ID: Oh boy! Thanks a ton Neil! Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaaagrawal at gmail.com Wed Jul 3 10:53:43 2013 From: aaaagrawal at gmail.com (Ankit Agrawal) Date: Wed, 3 Jul 2013 22:53:43 +0800 Subject: Weird - 'if' body not getting executed in spite of the expression being True In-Reply-To: References: Message-ID: Hi Chintak, Can you post what the problem was? Thanks. Regards, Ankit Agrawal, Communication and Signal Processing, IIT Bombay. On Wed, Jul 3, 2013 at 10:33 PM, Chintak Sheth wrote: > Oh boy! Thanks a ton Neil! > > Chintak > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkin at walla.co.il Thu Jul 4 10:57:35 2013 From: dkin at walla.co.il (Dan) Date: Thu, 4 Jul 2013 07:57:35 -0700 (PDT) Subject: 1st and 2st order statistical texture features of an image In-Reply-To: <79de3091-00d6-435e-9552-42cf32436789@googlegroups.com> References: <79de3091-00d6-435e-9552-42cf32436789@googlegroups.com> Message-ID: <24a691c0-fc67-4b61-9449-23131cf10d75@googlegroups.com> Thanks for the help. Cheers On Sunday, June 23, 2013 11:16:55 AM UTC+2, Dan wrote: > > Hi, > > > I wish to perform first (histogram based mean, stdev, smoothness, > skewness, uniformity and entropy) and second order (GLCM based contrast, > correlation, energy, homogeneity) statistical texture features of an image. > is it possible in scikit-image? > > If so a small script will be a huge help. > > Thanks. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bricklemacho at gmail.com Thu Jul 4 23:41:12 2013 From: bricklemacho at gmail.com (Brickle Macho) Date: Fri, 05 Jul 2013 11:41:12 +0800 Subject: Superpixel Region Growing In-Reply-To: References: <51C3841E.3080504@gmail.com> Message-ID: <51D64058.1070805@gmail.com> On 29/06/13 11:16 PM, St??????fan van der Walt wrote: > Hi Michael > > On Thu, Jun 20, 2013 at 5:37 PM, Brickle Macho wrote: >> I over segment an image using a superpixel algorithm. I region grow >> using the superpixels to end up with a segmented image, a label-image. >> I overlay the label boundaries using mark_boundaries(). > I'd be interested to hear more about your approach. We're also > working on some segmentation for gsoc, and I'd be very interested in a > region growing PR. > > St??????fan It not terribly exciting, perhaps calling it region growing is stretching the truth a little, not sure if it is worthy of a PR. I just traversing the superpixels using a connectivity graph (see http://peekaboo-vision.blogspot.com.au/2011/08/region-connectivity-graphs-in-python.html) and combing neighbouring superpixels based on a decision function. Here is a little more detail on what I am doing. First I over segment the image using either slic, quickshift or felzenswalb. I am also looking at SEEDS (http://www.vision.ee.ethz.ch/~boxavier/seeds/) using the C++ implementation provided. I then visit each superpixel and determine if it needs to be combined with one or more of it neighbours. For each segment I compute a set of features and then compare each superpixel pixel with it neighbour and combine based on similarity between one or more of the features. I relabel similar superpixels to the same label, effectively "growing" superpixels. This is what I am refer to as "superpixel region growing". For me the interesting part is how do I combine the superpixels and what is a good number of superpixels to seed the process. Using various features/properties include texture, moments, orieintations, various feature histograms (normalised) etc. I plan to learn how to combine the superpixels. I also have a corresponding depth values for the image which allows me to use depth features such as average depth, surface normals, local depth patterns. I like the superpixel algorithms because of the boundary preserving property of most superpixel algorithms. Intuitively it also feel like I have the complexity of the image form MxN pixels to K superpixels, where K < MxN. In most cases traversing the "simple" graph is quicker than traversing each pixel in the image. Although in the extreme case where K approaches MxN this is not the case. Michael. -- From elyraz at mail.com Sat Jul 6 19:42:38 2013 From: elyraz at mail.com (elyraz at mail.com) Date: Sat, 6 Jul 2013 16:42:38 -0700 (PDT) Subject: GLCM with scikit-image Message-ID: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> Hi all, I was using until now Matlab and its about time for me to move to scikit-image as it provide me more flexibility and a lot of benefits. Normally, I used Matlab to calculate the properties of gray-level co-occurrence matrix as shown in this link ( http://www.mathworks.co.uk/help/images/ref/graycoprops.html) mainly with this simple script: clc; Img = imread('C:\Users\dell\Desktop\ImgTemp\python.jpg'); I=rgb2gray(Img); % Photo downloaded from ?http://i425.photobucket.com/albums/pp337/jewarmy/python.jpg? GLCM2 = graycomatrix(I); allst = graycoprops(GLCM2,'all'); contrastInfo = allst.Contrast; display(contrastInfo) energyInfo = allst.Energy; display(energyInfo) homogeneityInfo = allst.Homogeneity; display(homogeneityInfo) correlationInfo = allst.Correlation; display(correlationInfo) With the following output: contrastInfo = 0.2516 energyInfo = 0.1094 homogeneityInfo = 0.8959 correlationInfo = 0.9672 While I was trying to do it with scikit-image using this script: import numpy as np from skimage.io import imread from skimage.feature import greycomatrix, greycoprops image=imread('C:/Users/dell/Desktop/ImgTemp/python.jpg', as_grey=True) g = greycomatrix(image, [0, 1], [0, np.pi/2], levels=256) contrast = greycoprops(g, 'contrast') print('contrast is: ', contrast) energy = greycoprops(g, 'energy') print('energy is: ', energy) homogeneity = greycoprops(g, 'homogeneity') print('homogeneity is: ', homogeneity) correlation = greycoprops(g, 'correlation') print('correlation is: ', correlation) dissimilarity = greycoprops(g, 'dissimilarity') print('dissimilarity is: ', dissimilarity) ASM = greycoprops(g, 'ASM') print('ASM is: ', ASM) I get these results: contrast is: [[0 0] [0 0]] energy is: [[ 40007.37212065 40007.37212065] [ 38525.88698525 38017.06358992]] homogeneity is: [[ 165440. 165440.] [ 165088. 164970.]] correlation is: [[ 1. 1.] [ 1. 1.]] dissimilarity is: [[0 0] [0 0]] ASM is: [[1600589824 1600589824] [1484243968 1445297124]] I do not understand why there are differences and for sure I miss something. Can someone please explain me what is wrong (I am using python 3.2 and scikit-image 0.8.3). Thanks a lot in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvertrumpet999 at gmail.com Sun Jul 7 20:00:06 2013 From: silvertrumpet999 at gmail.com (Josh Warner) Date: Sun, 7 Jul 2013 17:00:06 -0700 (PDT) Subject: seeking advice on HoG applicability In-Reply-To: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> Message-ID: <9a5a6733-15b7-4049-94a4-0d6fb3813474@googlegroups.com> Hi Lisa, That's an interesting problem! Off the top of my head, I have a couple questions: Are you making any attempt to mask the HoG features to the above-ground, green regions? The example images have the entire root structure shown, yet the visual classification you described is exclusive to the greenery. The roots are not well separated from the soil, either, so that entire region is may be confounding your task. This would be true for any feature algorithm, not just HoG. Have you tried visualizing the HoG output with the `visualize` kwarg? This could give you a sense for what HoG is actually extracting. It sounds like you may have a dimensionality problem thanks to high image resolution, combined with a relatively low number of images to compare. This can be partially addressed by tweaking HoG parameters (especially `pixels_per_cell`, I believe) or scaling your images down to a uniform, smaller size. In addition, scikit-learn has several feature selection algorithms, such as PCA, which can help reduce the number a features to a manageable level. If I get the chance to directly play with your example pictures, I'll pop back in with a few more thoughts. Good luck, Josh On Wednesday, July 3, 2013 2:10:19 PM UTC-5, Lisa Torrey wrote: > > Hi folks - > > I'm looking at an image classification problem, and wondering whether HoG > should be applicable to it. If any of you are willing to take a look and > give some advice, that would be wonderful. I have a machine learning > background, but working with image data is a new area for me. > > The problem is to distinguish between two types of moss. Type 1 tends to > consist of upright stalks with few or no branches. Type 2 tends to have > secondary branches coming off the primary stalk. There's quite a bit of > visual diversity within these types. I've linked some images below. > > Type 1: > http://myslu.stlawu.edu/~ltorrey/moss/andrea_rothii.jpg > http://myslu.stlawu.edu/~ltorrey/moss/mnium_spinulosum.jpg > > Type 2: > http://myslu.stlawu.edu/~ltorrey/moss/climacium_americanum.jpg > http://myslu.stlawu.edu/~ltorrey/moss/rhytidiadelphus_triquetrus.jpg > > When I came across the Dalal paper, I thought my problem might have > something in common with the pedestrian detection problem, so I tried > extracting HoG features and feeding them into an SVM classifier. This > failed miserably - the SVM does no better than random guessing. I'm now > trying to weigh potential reasons. > > The first possible reason on my list is the diversity among mosses of the > same type. There isn't necessarily a "type 1 shape" and a "type 2 shape," > at least not to the degree that there's a "pedestrian shape." Perhaps this > means HoG isn't really the right approach to my problem after all? > > Other reasons may include: > - I have much less data. (Just 77 positives and 78 negatives, compared to > Dalal's 1239 and 12180.) > - My images aren't all the same size, like the pedestrian images are. (I'm > not sure if this would matter?) > - My images are much higher resolution. (I've been downscaling them by a > factor of 8, but the feature vectors are still enormous.) > - I'm just using default parameters so far. (In the absence of any signal, > tweaking seems unproductive.) > > Any thoughts or suggestions would be welcome! > > -Lisa > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yager.neil at gmail.com Mon Jul 8 03:56:23 2013 From: yager.neil at gmail.com (Neil) Date: Mon, 8 Jul 2013 00:56:23 -0700 (PDT) Subject: GLCM with scikit-image In-Reply-To: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> Message-ID: <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> I don't have matlab, so I can't say for sure what is going on. I can see a number of potential reasons for discrepancy. 1. There may be a slight difference between the RGB to grayscale conversion formulas used by matlab and skimage. It you want identical results, you'll have to confirm this. 2. Based on the matlab documentation, it looks like the image is quantized based on the NumLevels parameter. The default is 8. Once again, in order to get the same results, you'll need to make sure this scaling is the same. 3. It looks like matlab normalizes the GLCM matrix (although the docs don't say). 4. By default, it looks like matlab only computes the GLCM for one offset. Also, there is a difference between the way the offsets are specified: skimage defines the offset by distance & angle, while matlab specifies it by row and column offset. The following doesn't give the same answer at matlab, but they are in the right ballpark: import skimage.io import skimage.feature im = skimage.io.imread('python.jpg', as_grey=True) im = skimage.img_as_ubyte(im) im /= 32 g = skimage.feature.greycomatrix(im, [1], [0], levels=8, symmetric=False, normed=True) print skimage.feature.greycoprops(g, 'contrast')[0][0] print skimage.feature.greycoprops(g, 'energy')[0][0] print skimage.feature.greycoprops(g, 'homogeneity')[0][0] print skimage.feature.greycoprops(g, 'correlation')[0][0] with the results: 0.301505863539 0.29090192313 0.883493603794 0.971610338356 To dig deeper I would need matlab. However, hopefully this is enough to get you started. You might want to try some simple/small images, and look at the actual GLCM matrices. Neil On Sunday, 7 July 2013 00:42:38 UTC+1, ely... at mail.com wrote: > > Hi all, > > > > I was using until now Matlab and its about time for me to move to > scikit-image as it provide me more flexibility and a lot of benefits. > > > > Normally, I used Matlab to calculate the properties of gray-level > co-occurrence matrix as shown in this link ( > http://www.mathworks.co.uk/help/images/ref/graycoprops.html) mainly with > this simple script: > > > > clc; > > Img = imread('C:\Users\dell\Desktop\ImgTemp\python.jpg'); > > I=rgb2gray(Img); > > % Photo downloaded from ? > http://i425.photobucket.com/albums/pp337/jewarmy/python.jpg? > > GLCM2 = graycomatrix(I); > > allst = graycoprops(GLCM2,'all'); > > > > contrastInfo = allst.Contrast; > > display(contrastInfo) > > energyInfo = allst.Energy; > > display(energyInfo) > > homogeneityInfo = allst.Homogeneity; > > display(homogeneityInfo) > > correlationInfo = allst.Correlation; > > display(correlationInfo) > > > > With the following output: > > contrastInfo = > > 0.2516 > > energyInfo = > > 0.1094 > > homogeneityInfo = > > 0.8959 > > correlationInfo = > > 0.9672 > > > > > > While I was trying to do it with scikit-image using this script: > > > > import numpy as np > > from skimage.io import imread > > from skimage.feature import greycomatrix, greycoprops > > > > image=imread('C:/Users/dell/Desktop/ImgTemp/python.jpg', as_grey=True) > > g = greycomatrix(image, [0, 1], [0, np.pi/2], levels=256) > > > > contrast = greycoprops(g, 'contrast') > > print('contrast is: ', contrast) > > > > energy = greycoprops(g, 'energy') > > print('energy is: ', energy) > > > > homogeneity = greycoprops(g, 'homogeneity') > > print('homogeneity is: ', homogeneity) > > > > correlation = greycoprops(g, 'correlation') > > print('correlation is: ', correlation) > > > > dissimilarity = greycoprops(g, 'dissimilarity') > > print('dissimilarity is: ', dissimilarity) > > > > ASM = greycoprops(g, 'ASM') > > print('ASM is: ', ASM) > > > > I get these results: > > > > contrast is: [[0 0] > > [0 0]] > > energy is: [[ 40007.37212065 40007.37212065] > > [ 38525.88698525 38017.06358992]] > > homogeneity is: [[ 165440. 165440.] > > [ 165088. 164970.]] > > correlation is: [[ 1. 1.] > > [ 1. 1.]] > > dissimilarity is: [[0 0] > > [0 0]] > > ASM is: [[1600589824 1600589824] > > [1484243968 1445297124]] > > > > I do not understand why there are differences and for sure I miss > something. Can someone please explain me what is wrong (I am using python > 3.2 and scikit-image 0.8.3). > > > > Thanks a lot in advance. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yager.neil at gmail.com Mon Jul 8 09:21:38 2013 From: yager.neil at gmail.com (Neil) Date: Mon, 8 Jul 2013 06:21:38 -0700 (PDT) Subject: GLCM with scikit-image In-Reply-To: References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> Message-ID: <9da24452-ae00-49bf-b3e9-0891121416b2@googlegroups.com> I wouldn't worry too much about the warning. Whenever you convert an image from floating point (64 bits per pixel) to bytes (8 bits per pixel), there may be a loss of precision. The lines: im = skimage.img_as_ubyte(im) im /= 32 are just a quick way to scale the pixel intensities to have 8 different levels. The first step converts the image from floats to bytes (this is where you get the warning). We now have an image with 256 levels (from 0 to 255). After dividing by 32, there are only 8 possible levels (from 0 to 7). It is likely that matlab use a different procedure for converting from a floating point image to an image with only 8 levels. The [0][0] is to specify which offset you want. The first 0 gives the index for the distances, and the second is the index for the angles. In this example, we are only computing one offset (distance=1 and angle=0). However, in many real-life applications you will want to compute the statistics for a number of offsets to capture differences in scale and orientation. Neil On Monday, 8 July 2013 14:00:11 UTC+1, ely... at mail.com wrote: > > Hi, > > Thanks a lot for the reply. > > Indeed graycoprops normalizes the gray-level co-occurrence matrix: > > ?graycoprops normalizes the gray-level co-occurrence matrix (GLCM) so that > the sum of its elements is equal to 1. Each element (r,c) in the normalized > GLCM is the joint probability occurrence of pixel pairs with a defined > spatial relationship having gray level values r and c in the image. > graycoprops uses the normalized GLCM to calculate properties.? ( > http://www.mathworks.co.uk/help/images/ref/graycoprops.html) > > The modified script: > import skimage > > from skimage.io import imread > from skimage.feature import greycomatrix > from skimage.feature import greycoprops > > im = imread('C:/Users/Asher_dell/Desktop/ImgTemp/python.jpg', as_grey=True) > > im = skimage.img_as_ubyte(im) > im /= 32 > g = skimage.feature.greycomatrix(im, [1], [0], levels=8, symmetric=False, > normed=True) > > contrast= skimage.feature.greycoprops(g, 'contrast')[0][0] > energy= skimage.feature.greycoprops(g, 'energy')[0][0] > homogeneity= skimage.feature.greycoprops(g, 'homogeneity')[0][0] > correlation=skimage.feature.greycoprops(g, 'correlation')[0][0] > dissimilarity=skimage.feature.greycoprops(g, 'dissimilarity')[0][0] > ASM=skimage.feature.greycoprops(g, 'ASM')[0][0] > > > print('contrast is: ', contrast) > print('energy is: ', energy) > print('homogeneity is: ', homogeneity) > print('correlation is: ', correlation) > print('dissimilarity is: ', dissimilarity) > print('ASM is: ', ASM) > > > Output: > skimage.dtype_converter: WARNING: Possible precision loss when converting > from float64 to uint8 > contrast is: 0.301542207792 > energy is: 0.29069020973 > homogeneity is: 0.883463991917 > correlation is: 0.971624675221 > dissimilarity is: 0.243464091878 > ASM is: 0.0845007980331 > > Based on the output I have few more questions on the modified script: > - Does the "skimage.dtype_converter: WARNING: Possible precision loss when > converting from float64 to uint8" means that the output values are wrong? > - Can you please explain me why you use these lines: > > im = skimage.img_as_ubyte(im) > im /= 32 > - Why do you use the [0][0] when you call skimage.feature.greycoprops > (e.g.,skimage.feature.greycoprops(g, 'contrast')[0][0])? > > Thanks a lot again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elyraz at mail.com Mon Jul 8 10:15:10 2013 From: elyraz at mail.com (elyraz at mail.com) Date: Mon, 8 Jul 2013 07:15:10 -0700 (PDT) Subject: GLCM with scikit-image In-Reply-To: <9da24452-ae00-49bf-b3e9-0891121416b2@googlegroups.com> References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> <9da24452-ae00-49bf-b3e9-0891121416b2@googlegroups.com> Message-ID: <73f054b0-ba24-4cf7-a5f0-166e090679a9@googlegroups.com> Cheers and thanks a lot for the help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lisa.torrey at gmail.com Mon Jul 8 12:04:52 2013 From: lisa.torrey at gmail.com (Lisa Torrey) Date: Mon, 8 Jul 2013 09:04:52 -0700 (PDT) Subject: seeking advice on HoG applicability In-Reply-To: <9a5a6733-15b7-4049-94a4-0d6fb3813474@googlegroups.com> References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> <9a5a6733-15b7-4049-94a4-0d6fb3813474@googlegroups.com> Message-ID: <4e036778-a7ea-4803-acc5-79fe70b0a10d@googlegroups.com> Thanks! Good point about the soil and roots. I've been using the entire images so far, but maybe I should pre-filter them, and keep only the "greenish" areas, before doing any feature extraction. I have visualized the output, and it looks like the gradients mostly go across leaf boundaries. That may be too fine-grained, since it's probably the moss/background boundary that is most important for this problem. Maybe I should actually segment (or skeletonize?) the image to get rid of the internal detail. -Lisa On Sunday, July 7, 2013 8:00:06 PM UTC-4, Josh Warner wrote: > > Hi Lisa, > > That's an interesting problem! Off the top of my head, I have a couple > questions: > > Are you making any attempt to mask the HoG features to the above-ground, > green regions? The example images have the entire root structure shown, yet > the visual classification you described is exclusive to the greenery. The > roots are not well separated from the soil, either, so that entire region > is may be confounding your task. This would be true for any feature > algorithm, not just HoG. > > Have you tried visualizing the HoG output with the `visualize` kwarg? This > could give you a sense for what HoG is actually extracting. > > It sounds like you may have a dimensionality problem thanks to high image > resolution, combined with a relatively low number of images to compare. > This can be partially addressed by tweaking HoG parameters (especially > `pixels_per_cell`, I believe) or scaling your images down to a uniform, > smaller size. In addition, scikit-learn has several feature selection > algorithms, such as PCA, which can help reduce the number a features to a > manageable level. > > If I get the chance to directly play with your example pictures, I'll pop > back in with a few more thoughts. > > Good luck, > > Josh > > On Wednesday, July 3, 2013 2:10:19 PM UTC-5, Lisa Torrey wrote: >> >> Hi folks - >> >> I'm looking at an image classification problem, and wondering whether HoG >> should be applicable to it. If any of you are willing to take a look and >> give some advice, that would be wonderful. I have a machine learning >> background, but working with image data is a new area for me. >> >> The problem is to distinguish between two types of moss. Type 1 tends to >> consist of upright stalks with few or no branches. Type 2 tends to have >> secondary branches coming off the primary stalk. There's quite a bit of >> visual diversity within these types. I've linked some images below. >> >> Type 1: >> http://myslu.stlawu.edu/~ltorrey/moss/andrea_rothii.jpg >> http://myslu.stlawu.edu/~ltorrey/moss/mnium_spinulosum.jpg >> >> Type 2: >> http://myslu.stlawu.edu/~ltorrey/moss/climacium_americanum.jpg >> http://myslu.stlawu.edu/~ltorrey/moss/rhytidiadelphus_triquetrus.jpg >> >> When I came across the Dalal paper, I thought my problem might have >> something in common with the pedestrian detection problem, so I tried >> extracting HoG features and feeding them into an SVM classifier. This >> failed miserably - the SVM does no better than random guessing. I'm now >> trying to weigh potential reasons. >> >> The first possible reason on my list is the diversity among mosses of the >> same type. There isn't necessarily a "type 1 shape" and a "type 2 shape," >> at least not to the degree that there's a "pedestrian shape." Perhaps this >> means HoG isn't really the right approach to my problem after all? >> >> Other reasons may include: >> - I have much less data. (Just 77 positives and 78 negatives, compared to >> Dalal's 1239 and 12180.) >> - My images aren't all the same size, like the pedestrian images are. >> (I'm not sure if this would matter?) >> - My images are much higher resolution. (I've been downscaling them by a >> factor of 8, but the feature vectors are still enormous.) >> - I'm just using default parameters so far. (In the absence of any >> signal, tweaking seems unproductive.) >> >> Any thoughts or suggestions would be welcome! >> >> -Lisa >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From lisa.torrey at gmail.com Mon Jul 8 12:06:36 2013 From: lisa.torrey at gmail.com (Lisa Torrey) Date: Mon, 8 Jul 2013 09:06:36 -0700 (PDT) Subject: seeking advice on HoG applicability In-Reply-To: References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> Message-ID: <970e1217-62e7-4f0c-b119-6d2b47c7487e@googlegroups.com> Thanks! I'll look into alternative ways of producing features. -Lisa On Monday, July 8, 2013 6:28:52 AM UTC-4, Stefan van der Walt wrote: > > Hi Lisa > > Interestingly, Adam Wisniewski was working on this one-class > classification problem at the recent SciPy2013 sprint. Olivier Grisel > and Nelle Varoquaux from the sklearn team were able to give us some > helpful advice, and it might be worth getting in touch with them as > well. > > On Wed, Jul 3, 2013 at 9:10 PM, Lisa Torrey > > wrote: > > - I have much less data. (Just 77 positives and 78 negatives, compared > to > > Dalal's 1239 and 12180.) > > You'll probably have to do some kind of cross-validation. > > > - My images aren't all the same size, like the pedestrian images are. > (I'm > > not sure if this would matter?) > > Perhaps investigate multi-scale texture features, such as the wavelet > coefficients (see http://www.pybytes.com/pywavelets/ ; even simple > statistics might suffice). > > > - My images are much higher resolution. (I've been downscaling them by a > > factor of 8, but the feature vectors are still enormous.) > > You'd want to extract some features that help the classifier, e.g. > daisy (http://scikit-image.org/docs/dev/auto_examples/plot_daisy.html), > texture features via grey-level co-occurrence matrices, or haralick > features (we don't yet have those in skimage, although they are > available in Luis Coelho's Mahotas). > > Regards > St?fan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Mon Jul 8 05:55:35 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 8 Jul 2013 11:55:35 +0200 Subject: GLCM with scikit-image In-Reply-To: <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> Message-ID: On Mon, Jul 8, 2013 at 9:56 AM, Neil wrote: > 1. There may be a slight difference between the RGB to grayscale conversion > formulas used by matlab and skimage. It you want identical results, you'll > have to confirm this. That's true. The Matlab conversion is probably done as follows: image = np.uint8(0.2989 * python[..., 0] + 0.5870 * python[..., 1] + 0.1140 * python[..., 2]) I'm not sure whether they round or discard the fraction. > 3. It looks like matlab normalizes the GLCM matrix (although the docs don't > say). This should probably raise a warning in graycoprops--it doesn't make much sense to calculate these without normalization. St?fan From stefan at sun.ac.za Mon Jul 8 06:28:52 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 8 Jul 2013 12:28:52 +0200 Subject: seeking advice on HoG applicability In-Reply-To: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> Message-ID: Hi Lisa Interestingly, Adam Wisniewski was working on this one-class classification problem at the recent SciPy2013 sprint. Olivier Grisel and Nelle Varoquaux from the sklearn team were able to give us some helpful advice, and it might be worth getting in touch with them as well. On Wed, Jul 3, 2013 at 9:10 PM, Lisa Torrey wrote: > - I have much less data. (Just 77 positives and 78 negatives, compared to > Dalal's 1239 and 12180.) You'll probably have to do some kind of cross-validation. > - My images aren't all the same size, like the pedestrian images are. (I'm > not sure if this would matter?) Perhaps investigate multi-scale texture features, such as the wavelet coefficients (see http://www.pybytes.com/pywavelets/ ; even simple statistics might suffice). > - My images are much higher resolution. (I've been downscaling them by a > factor of 8, but the feature vectors are still enormous.) You'd want to extract some features that help the classifier, e.g. daisy (http://scikit-image.org/docs/dev/auto_examples/plot_daisy.html), texture features via grey-level co-occurrence matrices, or haralick features (we don't yet have those in skimage, although they are available in Luis Coelho's Mahotas). Regards St?fan From stefan at sun.ac.za Mon Jul 8 08:53:52 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 8 Jul 2013 14:53:52 +0200 Subject: GLCM with scikit-image In-Reply-To: <9a09a8e0-18a2-45b1-b9b3-b905a1a9430f@googlegroups.com> References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> <9a09a8e0-18a2-45b1-b9b3-b905a1a9430f@googlegroups.com> Message-ID: On Mon, Jul 8, 2013 at 2:45 PM, wrote: > - Does the "skimage.dtype_converter: WARNING: Possible precision loss when > converting from float64 to uint8" means that the output values are wrong? Not wrong, just that there was a conversion between floating point and integer values, which means it had to drop some precision along the way. St?fan From stefan at sun.ac.za Mon Jul 8 09:15:41 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 8 Jul 2013 15:15:41 +0200 Subject: Cython guidelines In-Reply-To: References: <51D1F0E9.4080204@ais.uni-bonn.de> Message-ID: On Tue, Jul 2, 2013 at 1:45 AM, Juan Nunez-Iglesias wrote: > Cython + pointers is just as fast as memoryviews. And on SLIC at least, you > made liberal use of pointers. =) I just tried my hand at memoryviews at > St?fan's request and it's quite a bit slower currently. For anyone coming across this thread later: we found the bug, and memoryviews are about as fast as pointers. St?fan From stefan at sun.ac.za Mon Jul 8 10:24:01 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 8 Jul 2013 16:24:01 +0200 Subject: Picture of espresso Message-ID: Dear scikit-imagers For those of you who enjoy the finer beverages in life, a request. We are looking for a good photo of a shot of espresso for a Hough ellipse/circle detector. See: https://github.com/scikit-image/scikit-image/pull/641/ Since we need it to be public domain, your help in taking such a photograph would be much appreciated! St?fan From lisa.torrey at gmail.com Tue Jul 9 15:46:27 2013 From: lisa.torrey at gmail.com (Lisa Torrey) Date: Tue, 9 Jul 2013 12:46:27 -0700 (PDT) Subject: seeking advice on HoG applicability In-Reply-To: <970e1217-62e7-4f0c-b119-6d2b47c7487e@googlegroups.com> References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> <970e1217-62e7-4f0c-b119-6d2b47c7487e@googlegroups.com> Message-ID: A minor question that comes up as I make the images a uniform size: is it better to use pyramid_reduce() rather than resize(), or does it not matter? I see that pyramid_reduce() does smoothing, then calls resize(). On Monday, July 8, 2013 12:06:36 PM UTC-4, Lisa Torrey wrote: > > Thanks! > > I'll look into alternative ways of producing features. > > -Lisa > > > On Monday, July 8, 2013 6:28:52 AM UTC-4, Stefan van der Walt wrote: >> >> Hi Lisa >> >> Interestingly, Adam Wisniewski was working on this one-class >> classification problem at the recent SciPy2013 sprint. Olivier Grisel >> and Nelle Varoquaux from the sklearn team were able to give us some >> helpful advice, and it might be worth getting in touch with them as >> well. >> >> On Wed, Jul 3, 2013 at 9:10 PM, Lisa Torrey wrote: >> > - I have much less data. (Just 77 positives and 78 negatives, compared >> to >> > Dalal's 1239 and 12180.) >> >> You'll probably have to do some kind of cross-validation. >> >> > - My images aren't all the same size, like the pedestrian images are. >> (I'm >> > not sure if this would matter?) >> >> Perhaps investigate multi-scale texture features, such as the wavelet >> coefficients (see http://www.pybytes.com/pywavelets/ ; even simple >> statistics might suffice). >> >> > - My images are much higher resolution. (I've been downscaling them by >> a >> > factor of 8, but the feature vectors are still enormous.) >> >> You'd want to extract some features that help the classifier, e.g. >> daisy (http://scikit-image.org/docs/dev/auto_examples/plot_daisy.html), >> texture features via grey-level co-occurrence matrices, or haralick >> features (we don't yet have those in skimage, although they are >> available in Luis Coelho's Mahotas). >> >> Regards >> St?fan >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoenberger at demuc.de Wed Jul 10 04:12:56 2013 From: jschoenberger at demuc.de (=?iso-8859-1?Q?Johannes_Sch=F6nberger?=) Date: Wed, 10 Jul 2013 10:12:56 +0200 Subject: seeking advice on HoG applicability In-Reply-To: References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> <970e1217-62e7-4f0c-b119-6d2b47c7487e@googlegroups.com> Message-ID: The smoothing is applied before sub-sampling to suppress high frequencies which result in aliasing effects when sub-sampling. I recommend to use the Gaussian pyramid. The Laplacian pyramid shows you the difference between the smoothed and original image (the suppressed high frequencies) for each pyramid layer, respectively. Johannes Sch?nberger Am 09.07.2013 um 21:46 schrieb Lisa Torrey : > A minor question that comes up as I make the images a uniform size: is it better to use pyramid_reduce() rather than resize(), or does it not matter? I see that pyramid_reduce() does smoothing, then calls resize(). > > > On Monday, July 8, 2013 12:06:36 PM UTC-4, Lisa Torrey wrote: > Thanks! > > I'll look into alternative ways of producing features. > > -Lisa > > > On Monday, July 8, 2013 6:28:52 AM UTC-4, Stefan van der Walt wrote: > Hi Lisa > > Interestingly, Adam Wisniewski was working on this one-class > classification problem at the recent SciPy2013 sprint. Olivier Grisel > and Nelle Varoquaux from the sklearn team were able to give us some > helpful advice, and it might be worth getting in touch with them as > well. > > On Wed, Jul 3, 2013 at 9:10 PM, Lisa Torrey wrote: > > - I have much less data. (Just 77 positives and 78 negatives, compared to > > Dalal's 1239 and 12180.) > > You'll probably have to do some kind of cross-validation. > > > - My images aren't all the same size, like the pedestrian images are. (I'm > > not sure if this would matter?) > > Perhaps investigate multi-scale texture features, such as the wavelet > coefficients (see http://www.pybytes.com/pywavelets/ ; even simple > statistics might suffice). > > > - My images are much higher resolution. (I've been downscaling them by a > > factor of 8, but the feature vectors are still enormous.) > > You'd want to extract some features that help the classifier, e.g. > daisy (http://scikit-image.org/docs/dev/auto_examples/plot_daisy.html), > texture features via grey-level co-occurrence matrices, or haralick > features (we don't yet have those in skimage, although they are > available in Luis Coelho's Mahotas). > > Regards > St?fan > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From stefan at sun.ac.za Wed Jul 10 07:07:01 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Wed, 10 Jul 2013 13:07:01 +0200 Subject: source compilation error: undefined references In-Reply-To: <489490a8-4980-4a3e-8d6f-65829c699245@googlegroups.com> References: <955fd224-53d5-4d8f-a7f3-9406d9561588@googlegroups.com> <08827183-3627-49cc-bc8c-2208b6c3e7e5@googlegroups.com> <489490a8-4980-4a3e-8d6f-65829c699245@googlegroups.com> Message-ID: Hi Evan On Thu, Jun 13, 2013 at 4:03 PM, Evan wrote: > Ok, got it. Had to work through and edit each each subdir + setup.py as > needed. > > I'll send the pull request in the next day or two. Just checking: did this get merged, and did you find it to be necessary? St?fan From stefan at sun.ac.za Wed Jul 10 07:08:35 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Wed, 10 Jul 2013 13:08:35 +0200 Subject: Qhull error In-Reply-To: References: Message-ID: On Thu, Jun 13, 2013 at 8:52 AM, Juan Nunez-Iglesias wrote: > Hi all. I'm getting the below error when computing regionprops(..., > ['Solidity']). Does anyone know what's going on? At first I thought maybe it > was passing a singleton array or something, but this array looks like a > reasonable thing to compute a convex hull on, no? Yikes, did you ever figure out what was wrong here? I've seen behavior like this in SciPy's delaunay before, but never managed to dig down to the root of the issue. St?fan From stefan at sun.ac.za Wed Jul 10 07:35:24 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Wed, 10 Jul 2013 13:35:24 +0200 Subject: GSoC Proposal In-Reply-To: <34a0cffa-51d0-4120-98e4-94fe26ff9f09@googlegroups.com> References: <0f98605a-8ab3-4b0a-b1d7-376cc53ad807@googlegroups.com> <34a0cffa-51d0-4120-98e4-94fe26ff9f09@googlegroups.com> Message-ID: Hi Marc On Tue, Jun 4, 2013 at 12:05 PM, Marc de Klerk wrote: > Just wanted to say a big thanks for opportunity to do a GSOC :) > I'll be blogging about it on a weekly basis at http://mygsoc.blogspot.com. These posts are great--please don't hesitate to send a link to the mailing list every time you publish a new post. Thanks St?fan From stefan at sun.ac.za Wed Jul 10 07:39:03 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Wed, 10 Jul 2013 13:39:03 +0200 Subject: Weird imsave inverting behaviour In-Reply-To: References: <51A2E1E5.3000804@gmail.com> <2D0C5C48-9800-4533-A26B-96958E91680A@demuc.de> Message-ID: On Wed, Jun 5, 2013 at 10:15 AM, Juan Nunez-Iglesias wrote: > I'd argue yes. ;) But I'm not sure any hard conclusions were reached as to > what exactly needs to be done. I guess the first thing is fixing the TIFF > input bug, before any more refactoring. But that might go away in a refactor > anyway... We need to a) refactor the I/O infrastructure which b) should allow plugins to describe their supported functionality. Another option would be to get rid of plugins, and to provide a directory of snippets that illustrate how to load various other file formats with skimage. St?fan From chintaksheth at gmail.com Wed Jul 10 08:52:15 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Wed, 10 Jul 2013 18:22:15 +0530 Subject: Qhull error In-Reply-To: References: Message-ID: Hi Juan, I tried computing `convex_hull_image` of `test_im` directly and as expected got the error you posted above. Then I tried to run `regionprops` on the `test_im` padded with 0s. This again threw the same error. But oddly so, direct computation of `convex_hull_image` of padded `test_im` does give a result! In spite of the traceback showing that the problem originated in `convex_hull_image` function. At least for the purposes of your problem you can probably compute the Solidity manually here. ``` In [27]: a = np.zeros((5,9), int) In [28]: a Out[28]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]]) In [29]: a[1:-1, 1:-1] = test_im In [30]: a Out[30]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]]) In [31]: b = convex_hull_image(a).astype(int) In [32]: b Out[32]: array([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]])``` Thanks, Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaaagrawal at gmail.com Thu Jul 11 09:32:47 2013 From: aaaagrawal at gmail.com (Ankit Agrawal) Date: Thu, 11 Jul 2013 06:32:47 -0700 (PDT) Subject: Error in plot_matching.py example Message-ID: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Hi everyone, I am getting the following error while running plot_matching.py . ankit at ubuntu:/media/ankit/D/foss/scikit-image$ python doc/examples/plot_matching.py Traceback (most recent call last): File "doc/examples/plot_matching.py", line 28, in from skimage import data File "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9dev-py2.7-linux-x86_64.egg/skimage/data/__init__.py", line 11, in from ..io import imread File "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9dev-py2.7-linux-x86_64.egg/skimage/io/__init__.py", line 7, in from ._plugins import use as use_plugin File "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9dev-py2.7-linux-x86_64.egg/skimage/io/_plugins/__init__.py", line 1, in from .plugin import * File "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9dev-py2.7-linux-x86_64.egg/skimage/io/_plugins/plugin.py", line 65, in _scan_plugins() File "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9dev-py2.7-linux-x86_64.egg/skimage/io/_plugins/plugin.py", line 47, in _scan_plugins name = cp.sections()[0] IndexError: list index out of range Can you check and see if this error is reproducible with you? Thanks. Cheers, Ankit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Thu Jul 11 05:45:37 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Thu, 11 Jul 2013 11:45:37 +0200 Subject: Weird imsave inverting behaviour In-Reply-To: References: <51A2E1E5.3000804@gmail.com> <2D0C5C48-9800-4533-A26B-96958E91680A@demuc.de> Message-ID: I'd be interested in tackling this, but a number of alternatives were proposed, including my io.png.read() and Johannes's plugin registry thingy, with no clear decision on which way to go... On Wed, Jul 10, 2013 at 1:39 PM, St?fan van der Walt wrote: > On Wed, Jun 5, 2013 at 10:15 AM, Juan Nunez-Iglesias > wrote: > > I'd argue yes. ;) But I'm not sure any hard conclusions were reached as > to > > what exactly needs to be done. I guess the first thing is fixing the TIFF > > input bug, before any more refactoring. But that might go away in a > refactor > > anyway... > > We need to a) refactor the I/O infrastructure which b) should allow > plugins to describe their supported functionality. > > Another option would be to get rid of plugins, and to provide a > directory of snippets that illustrate how to load various other file > formats with skimage. > > St?fan > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Thu Jul 11 05:50:31 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Thu, 11 Jul 2013 11:50:31 +0200 Subject: Qhull error In-Reply-To: References: Message-ID: This is all very weird. Stefan, no, I didn't figure it out, I just implemented my proposal of having a try/except around it and setting it to 1.1 if the error came up! =) It was a minority of my objects and I chuck out outliers anyway... Chintak's finding suggests a more Pull-Requestable way forward... =) On Wed, Jul 10, 2013 at 2:52 PM, Chintak Sheth wrote: > Hi Juan, > > I tried computing `convex_hull_image` of `test_im` directly and as > expected got the error you posted above. > > Then I tried to run `regionprops` on the `test_im` padded with 0s. This > again threw the same error. But oddly so, direct computation of > `convex_hull_image` of padded `test_im` does give a result! In spite of the > traceback showing that the problem originated in `convex_hull_image` > function. > > At least for the purposes of your problem you can probably compute the > Solidity manually here. > > ``` > In [27]: a = np.zeros((5,9), int) > > In [28]: a > Out[28]: > array([[0, 0, 0, 0, 0, 0, 0, 0, 0], > [0, 0, 0, 0, 0, 0, 0, 0, 0], > [0, 0, 0, 0, 0, 0, 0, 0, 0], > [0, 0, 0, 0, 0, 0, 0, 0, 0], > [0, 0, 0, 0, 0, 0, 0, 0, 0]]) > > In [29]: a[1:-1, 1:-1] = test_im > > In [30]: a > Out[30]: > array([[0, 0, 0, 0, 0, 0, 0, 0, 0], > [0, 0, 0, 0, 0, 1, 0, 0, 0], > [0, 0, 0, 1, 1, 1, 1, 1, 0], > [0, 1, 1, 1, 0, 0, 0, 0, 0], > [0, 0, 0, 0, 0, 0, 0, 0, 0]]) > > In [31]: b = convex_hull_image(a).astype(int) > > In [32]: b > Out[32]: > array([[0, 0, 0, 0, 0, 0, 0, 0, 0], > [0, 0, 0, 0, 1, 1, 1, 0, 0], > [0, 0, 1, 1, 1, 1, 1, 1, 0], > [0, 1, 1, 1, 1, 0, 0, 0, 0], > [0, 0, 0, 0, 0, 0, 0, 0, 0]])``` > > Thanks, > Chintak > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Thu Jul 11 06:08:06 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 11 Jul 2013 12:08:06 +0200 Subject: Qhull error In-Reply-To: References: Message-ID: I think this might be either a bug in Delaunay or the data provided to it, so it would be great to get to the bottom of it, instead of just hiding bad behaviour. St?fan From stefan at sun.ac.za Thu Jul 11 06:09:14 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 11 Jul 2013 12:09:14 +0200 Subject: Weird imsave inverting behaviour In-Reply-To: References: <51A2E1E5.3000804@gmail.com> <2D0C5C48-9800-4533-A26B-96958E91680A@demuc.de> Message-ID: On Thu, Jul 11, 2013 at 11:45 AM, Juan Nunez-Iglesias wrote: > I'd be interested in tackling this, but a number of alternatives were > proposed, including my io.png.read() and Johannes's plugin registry thingy, > with no clear decision on which way to go... We can refactor the current infrastructure without changing the API--that would be a good start. St?fan From stefan at sun.ac.za Thu Jul 11 06:41:47 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 11 Jul 2013 12:41:47 +0200 Subject: Qhull error In-Reply-To: References: Message-ID: On Thu, Jul 11, 2013 at 12:32 PM, Chintak Sheth wrote: > First, I think we need to find why the dual nature, `convex_hull_image` > independently works fine but not from `regionprops`. Spot on. Thanks for following through! From chintaksheth at gmail.com Thu Jul 11 06:32:05 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Thu, 11 Jul 2013 16:02:05 +0530 Subject: Qhull error In-Reply-To: References: Message-ID: Stefan, I concur. Juan, 0.9 might have been a more plausible value, since if I'm not mistaken it is "number of pixels in image / number of pixels in the convex hull". Convex hull image will have more number of pixels. ;) Couple of things: 1. This error seems to pop up for this specific case. In the sense, if you remove the 1 in the 1st row, `regionprops` computes the 'Solidity' perfectly. No need of padding as well. 2. The error comes up for all the three 'ConvexImage', 'ConvexArea' and 'Solidity' even with the padded image. Whereas, `convex_hull_image` computes it alright. So, specifically for this padded case there seems to be a problem with the way the array is being passed and not Delaunay. First, I think we need to find why the dual nature, `convex_hull_image` independently works fine but not from `regionprops`. Next and a probable way forward would be try/except, if an error occurs, then pad the image and again try/except. What do you'll think? Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Thu Jul 11 07:43:30 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Thu, 11 Jul 2013 17:13:30 +0530 Subject: New blog post on Fast Marching Method Message-ID: Hi, I have written a new blog post about Fast Marching Method fro Image Inapinting something on which I am working on as part of my GSoC. Do check it out! Suggestion more than welcome! http://chintaksheth.wordpress.com/2013/07/09/fast-marching-method/ Thanks, Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Thu Jul 11 12:59:15 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 11 Jul 2013 18:59:15 +0200 Subject: Error in plot_matching.py example In-Reply-To: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> References: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Message-ID: Hi Ankit On Thu, Jul 11, 2013 at 3:32 PM, Ankit Agrawal wrote: > "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9dev-py2.7-linux-x86_64.egg/skimage/io/_plugins/plugin.py", > line 47, in _scan_plugins > name = cp.sections()[0] > IndexError: list index out of range That's odd--the error is with your plugins, not with that specific example. Can you try from skimage import data data.checkerboard() ? St?fan From stefan at sun.ac.za Thu Jul 11 13:05:22 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 11 Jul 2013 19:05:22 +0200 Subject: Error in plot_matching.py example In-Reply-To: References: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Message-ID: Hi Ankit Your script fails at "from skimage import data" -- rather odd, given that it succeeds when you try it by itself, don't you think? Are you launching the script in the same environment? St?fan From jschoenberger at demuc.de Thu Jul 11 13:24:56 2013 From: jschoenberger at demuc.de (=?iso-8859-1?Q?Johannes_Sch=F6nberger?=) Date: Thu, 11 Jul 2013 19:24:56 +0200 Subject: Error in plot_matching.py example In-Reply-To: References: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Message-ID: I guess you are in the root directory of the scikit-image git repository and hence the skimage folder is in your namespace. Either: cd doc/examples; python plot_matching.py or: make; python doc/examples/plot_matching.py Johannes Sch?nberger Am 11.07.2013 um 19:23 schrieb Ankit Agrawal : > Hi Stefan, > > Till now, I was trying `python doc/examples/plot_matching.py` which still produces the error mentioned in the first post(Still wondering why?). However, since you mentioned 'same environment', I tried executing using execfile() and it worked. > > Regards, > Ankit Agrawal, > Communication and Signal Processing, > IIT Bombay. > > > On Fri, Jul 12, 2013 at 1:05 AM, St?fan van der Walt wrote: > Hi Ankit > > Your script fails at "from skimage import data" -- rather odd, given > that it succeeds when you try it by itself, don't you think? Are you > launching the script in the same environment? > > St?fan > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From jschoenberger at demuc.de Thu Jul 11 13:52:42 2013 From: jschoenberger at demuc.de (=?windows-1252?Q?Johannes_Sch=F6nberger?=) Date: Thu, 11 Jul 2013 19:52:42 +0200 Subject: Error in plot_matching.py example In-Reply-To: References: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Message-ID: Strange? have you tried to do a completely clean new install (new virtualenv, new clone of git repo etc.)? Johannes Sch?nberger Am 11.07.2013 um 19:44 schrieb Ankit Agrawal : > Hi Johannes, > > On Fri, Jul 12, 2013 at 1:24 AM, Johannes Sch?nberger wrote: > I guess you are in the root directory of the scikit-image git repository and hence the skimage folder is in your namespace. Either: > > cd doc/examples; python plot_matching.py > > or: > > make; python doc/examples/plot_matching.py > > Both of the above ways return the same error. > > Cheers, > Ankit. > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From chintaksheth at gmail.com Thu Jul 11 14:04:45 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Thu, 11 Jul 2013 23:34:45 +0530 Subject: Qhull error In-Reply-To: References: Message-ID: Hi, Juan are you taking this issue up? Else I wouldn't mind taking a go at it though I first need to complete the Cython implementation of Fast Marching Method code. Once I have that all ready for the PR I don't mind taking a shot here. Chintak On Jul 11, 2013 4:12 PM, "St?fan van der Walt" wrote: > On Thu, Jul 11, 2013 at 12:32 PM, Chintak Sheth > wrote: > > First, I think we need to find why the dual nature, `convex_hull_image` > > independently works fine but not from `regionprops`. > > Spot on. Thanks for following through! > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaaagrawal at gmail.com Thu Jul 11 13:03:01 2013 From: aaaagrawal at gmail.com (Ankit Agrawal) Date: Fri, 12 Jul 2013 01:03:01 +0800 Subject: Error in plot_matching.py example In-Reply-To: References: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Message-ID: Hi Stefan, It returns the image correctly as expected : >>> from skimage import data >>> data.checkerboard() Image([[255, 255, 255, ..., 0, 0, 0], [255, 255, 255, ..., 0, 0, 0], [255, 255, 255, ..., 0, 0, 0], ..., [ 0, 0, 0, ..., 255, 255, 255], [ 0, 0, 0, ..., 255, 255, 255], [ 0, 0, 0, ..., 255, 255, 255]], dtype=uint8) Regards, Ankit Agrawal, Communication and Signal Processing, IIT Bombay. On Fri, Jul 12, 2013 at 12:59 AM, St?fan van der Walt wrote: > Hi Ankit > > On Thu, Jul 11, 2013 at 3:32 PM, Ankit Agrawal > wrote: > > > "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9dev-py2.7-linux-x86_64.egg/skimage/io/_plugins/plugin.py", > > line 47, in _scan_plugins > > name = cp.sections()[0] > > IndexError: list index out of range > > That's odd--the error is with your plugins, not with that specific > example. Can you try > > from skimage import data > data.checkerboard() > > ? > > St?fan > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaaagrawal at gmail.com Thu Jul 11 13:23:00 2013 From: aaaagrawal at gmail.com (Ankit Agrawal) Date: Fri, 12 Jul 2013 01:23:00 +0800 Subject: Error in plot_matching.py example In-Reply-To: References: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Message-ID: Hi Stefan, Till now, I was trying `python doc/examples/plot_matching.py` which still produces the error mentioned in the first post(Still wondering why?). However, since you mentioned 'same environment', I tried executing using execfile() and it worked. Regards, Ankit Agrawal, Communication and Signal Processing, IIT Bombay. On Fri, Jul 12, 2013 at 1:05 AM, St?fan van der Walt wrote: > Hi Ankit > > Your script fails at "from skimage import data" -- rather odd, given > that it succeeds when you try it by itself, don't you think? Are you > launching the script in the same environment? > > St?fan > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaaagrawal at gmail.com Thu Jul 11 13:44:12 2013 From: aaaagrawal at gmail.com (Ankit Agrawal) Date: Fri, 12 Jul 2013 01:44:12 +0800 Subject: Error in plot_matching.py example In-Reply-To: References: <4a3a6ab9-2b4a-44ea-a62e-1d2c639a1b11@googlegroups.com> Message-ID: Hi Johannes, On Fri, Jul 12, 2013 at 1:24 AM, Johannes Sch?nberger < jschoenberger at demuc.de> wrote: > I guess you are in the root directory of the scikit-image git repository > and hence the skimage folder is in your namespace. Either: > > cd doc/examples; python plot_matching.py > > or: > > make; python doc/examples/plot_matching.py Both of the above ways return the same error. Cheers, Ankit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gingerw at walla.com Fri Jul 12 08:13:05 2013 From: gingerw at walla.com (ginger wend) Date: Fri, 12 Jul 2013 05:13:05 -0700 (PDT) Subject: My porblem understanding Local Binary Pattern Message-ID: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> Hi, I am trying to learn Local Binary Pattern with scikit-image and as I have only limited knowledge in numpy and image analysis I find it hard. As a result, I will appreciate a lot if you can provide me some answers as I am sure that they will help me to advance: - If I understand correctly the skimage.feature.local_binary_pattern(image, P, R, method=' uniform) will go pixel by pixel (starting from pixel location 1,2) and generate the binary number based on the P and R, am I right?. If so what happens if the R is ?out of boundary?? - How do you calculate the histogram and why are there are 18 bins in the example (http://scikit-image.org/docs/dev/auto_examples/plot_local_binary_pattern.html)? - The output is (N, M) array and when I look at it is not clear to me what is the output and how do you generate a histogram from it, can someone you please clarify it. I know that these questions are be basic and while I was trying to look for answers I found the information more mathematical and less with applied approach. Therefore, any help, ideas or tips will help. Thanks for the patience, G. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Fri Jul 12 12:30:06 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Fri, 12 Jul 2013 11:30:06 -0500 Subject: My porblem understanding Local Binary Pattern In-Reply-To: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> References: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> Message-ID: On Fri, Jul 12, 2013 at 7:13 AM, ginger wend wrote: > Hi, > > I am trying to learn Local Binary Pattern with scikit-image and as I have > only limited knowledge in numpy and image analysis I find it hard. As a > result, I will appreciate a lot if you can provide me some answers as I am > sure that they will help me to advance: > > - If I understand correctly the > skimage.feature.local_binary_pattern(image, P, R, method=' uniform) will go > pixel by pixel (starting from pixel location 1,2) and generate the binary > number based on the P and R, am I right?. If so what happens if the R is > ?out of boundary?? > - How do you calculate the histogram and why are there are 18 bins in the > example ( > http://scikit-image.org/docs/dev/auto_examples/plot_local_binary_pattern.html > )? > - The output is (N, M) array and when I look at it is not clear to me what > is the output and how do you generate a histogram from it, can someone you > please clarify it. > > I know that these questions are be basic and while I was trying to look > for answers I found the information more mathematical and less with applied > approach. Therefore, any help, ideas or tips will help. > > Thanks for the patience, > G. > > Hi, LBP can be quite confusing at first, but the idea is pretty simple. I recently added some more explanations to the example in the gallery (most of the addition is code to plot things---you don't really need to understand that part of the code): https://github.com/scikit-image/scikit-image/blob/master/doc/examples/plot_local_binary_pattern.py That example should clarify most of your questions. I don't really know how the boundary is treated, so maybe someone else can clarify that point. Best, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoenberger at demuc.de Fri Jul 12 12:34:52 2013 From: jschoenberger at demuc.de (=?windows-1252?Q?Johannes_Sch=F6nberger?=) Date: Fri, 12 Jul 2013 18:34:52 +0200 Subject: My porblem understanding Local Binary Pattern In-Reply-To: References: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> Message-ID: <5EB7A573-2CCA-4956-ADF7-13DA68064A8F@demuc.de> The image is padded with 0s. Johannes Sch?nberger Am 12.07.2013 um 18:30 schrieb Tony Yu : > > > > On Fri, Jul 12, 2013 at 7:13 AM, ginger wend wrote: > Hi, > > I am trying to learn Local Binary Pattern with scikit-image and as I have only limited knowledge in numpy and image analysis I find it hard. As a result, I will appreciate a lot if you can provide me some answers as I am sure that they will help me to advance: > > - If I understand correctly the skimage.feature.local_binary_pattern(image, P, R, method=' uniform) will go pixel by pixel (starting from pixel location 1,2) and generate the binary number based on the P and R, am I right?. If so what happens if the R is ?out of boundary?? > - How do you calculate the histogram and why are there are 18 bins in the example (http://scikit-image.org/docs/dev/auto_examples/plot_local_binary_pattern.html)? > - The output is (N, M) array and when I look at it is not clear to me what is the output and how do you generate a histogram from it, can someone you please clarify it. > > I know that these questions are be basic and while I was trying to look for answers I found the information more mathematical and less with applied approach. Therefore, any help, ideas or tips will help. > > Thanks for the patience, > G. > > Hi, > > LBP can be quite confusing at first, but the idea is pretty simple. I recently added some more explanations to the example in the gallery (most of the addition is code to plot things---you don't really need to understand that part of the code): > > https://github.com/scikit-image/scikit-image/blob/master/doc/examples/plot_local_binary_pattern.py > > That example should clarify most of your questions. I don't really know how the boundary is treated, so maybe someone else can clarify that point. > > Best, > -Tony > > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From lisa.torrey at gmail.com Fri Jul 12 21:47:04 2013 From: lisa.torrey at gmail.com (Lisa Torrey) Date: Fri, 12 Jul 2013 18:47:04 -0700 (PDT) Subject: seeking advice on HoG applicability In-Reply-To: References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> <970e1217-62e7-4f0c-b119-6d2b47c7487e@googlegroups.com> Message-ID: <6a39f44b-c586-4edc-afb6-7d5e0118844c@googlegroups.com> Ok, will do smoothing. Thanks! On Wednesday, July 10, 2013 4:12:56 AM UTC-4, Johannes Sch?nberger wrote: > > The smoothing is applied before sub-sampling to suppress high frequencies > which result in aliasing effects when sub-sampling. I recommend to use the > Gaussian pyramid. The Laplacian pyramid shows you the difference between > the smoothed and original image (the suppressed high frequencies) for each > pyramid layer, respectively. > > Johannes Sch?nberger > > Am 09.07.2013 um 21:46 schrieb Lisa Torrey >: > > > > A minor question that comes up as I make the images a uniform size: is > it better to use pyramid_reduce() rather than resize(), or does it not > matter? I see that pyramid_reduce() does smoothing, then calls resize(). > > > > > > On Monday, July 8, 2013 12:06:36 PM UTC-4, Lisa Torrey wrote: > > Thanks! > > > > I'll look into alternative ways of producing features. > > > > -Lisa > > > > > > On Monday, July 8, 2013 6:28:52 AM UTC-4, Stefan van der Walt wrote: > > Hi Lisa > > > > Interestingly, Adam Wisniewski was working on this one-class > > classification problem at the recent SciPy2013 sprint. Olivier Grisel > > and Nelle Varoquaux from the sklearn team were able to give us some > > helpful advice, and it might be worth getting in touch with them as > > well. > > > > On Wed, Jul 3, 2013 at 9:10 PM, Lisa Torrey wrote: > > > - I have much less data. (Just 77 positives and 78 negatives, compared > to > > > Dalal's 1239 and 12180.) > > > > You'll probably have to do some kind of cross-validation. > > > > > - My images aren't all the same size, like the pedestrian images are. > (I'm > > > not sure if this would matter?) > > > > Perhaps investigate multi-scale texture features, such as the wavelet > > coefficients (see http://www.pybytes.com/pywavelets/ ; even simple > > statistics might suffice). > > > > > - My images are much higher resolution. (I've been downscaling them by > a > > > factor of 8, but the feature vectors are still enormous.) > > > > You'd want to extract some features that help the classifier, e.g. > > daisy (http://scikit-image.org/docs/dev/auto_examples/plot_daisy.html), > > texture features via grey-level co-occurrence matrices, or haralick > > features (we don't yet have those in skimage, although they are > > available in Luis Coelho's Mahotas). > > > > Regards > > St?fan > > > > -- > > You received this message because you are subscribed to the Google > Groups "scikit-image" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to scikit-image... at googlegroups.com . > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gingerw at walla.com Sat Jul 13 05:04:37 2013 From: gingerw at walla.com (ginger wend) Date: Sat, 13 Jul 2013 02:04:37 -0700 (PDT) Subject: My porblem understanding Local Binary Pattern In-Reply-To: References: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> Message-ID: <0a2431b1-dd40-4fff-a25b-48c40b692d5a@googlegroups.com> Does it work with also with scikit-image 0.8 or only with 0.9dev? Im using 0.8 and got some error regrarding label2rgb. On Friday, July 12, 2013 6:30:06 PM UTC+2, Tony S Yu wrote: > > > > > On Fri, Jul 12, 2013 at 7:13 AM, ginger wend > > wrote: > >> Hi, >> >> I am trying to learn Local Binary Pattern with scikit-image and as I have >> only limited knowledge in numpy and image analysis I find it hard. As a >> result, I will appreciate a lot if you can provide me some answers as I am >> sure that they will help me to advance: >> >> - If I understand correctly the >> skimage.feature.local_binary_pattern(image, P, R, method=' uniform) will go >> pixel by pixel (starting from pixel location 1,2) and generate the binary >> number based on the P and R, am I right?. If so what happens if the R is >> ?out of boundary?? >> - How do you calculate the histogram and why are there are 18 bins in the >> example ( >> http://scikit-image.org/docs/dev/auto_examples/plot_local_binary_pattern.html >> )? >> - The output is (N, M) array and when I look at it is not clear to me >> what is the output and how do you generate a histogram from it, can someone >> you please clarify it. >> >> I know that these questions are be basic and while I was trying to look >> for answers I found the information more mathematical and less with applied >> approach. Therefore, any help, ideas or tips will help. >> >> Thanks for the patience, >> G. >> >> Hi, > > LBP can be quite confusing at first, but the idea is pretty simple. I > recently added some more explanations to the example in the gallery (most > of the addition is code to plot things---you don't really need to > understand that part of the code): > > > https://github.com/scikit-image/scikit-image/blob/master/doc/examples/plot_local_binary_pattern.py > > That example should clarify most of your questions. I don't really know > how the boundary is treated, so maybe someone else can clarify that point. > > Best, > -Tony > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sokolov.valeri at gmail.com Sat Jul 13 05:58:33 2013 From: sokolov.valeri at gmail.com (Valeriy Sokolov) Date: Sat, 13 Jul 2013 02:58:33 -0700 (PDT) Subject: How to get a region chain code? Message-ID: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Hi, I am studying a shape descriptors and would like to compute a chain code description of a labeled shape. I was trying to look into docs but have not find a direct way to get this region property with skimage. Is there any way to do it in a few calls which I missed? Thank you in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gingerw at walla.com Sat Jul 13 07:48:03 2013 From: gingerw at walla.com (ginger wend) Date: Sat, 13 Jul 2013 04:48:03 -0700 (PDT) Subject: My porblem understanding Local Binary Pattern In-Reply-To: <8F71F357-6D59-43EE-9AAA-770E2FAC5A17@demuc.de> References: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> <0a2431b1-dd40-4fff-a25b-48c40b692d5a@googlegroups.com> <8F71F357-6D59-43EE-9AAA-770E2FAC5A17@demuc.de> Message-ID: <0bc7e7ab-c564-45cb-b674-7ed93294d4bc@googlegroups.com> How can I intall 0.9dev on windows? On Saturday, July 13, 2013 11:08:16 AM UTC+2, Johannes Sch?nberger wrote: > > I think, label2rgb was added in 0.9dev and thus is not available in 0.8. > > Johannes Sch?nberger > > Am 13.07.2013 um 11:04 schrieb ginger wend >: > > > > Does it work with also with scikit-image 0.8 or only with 0.9dev? > > > > Im using 0.8 and got some error regrarding label2rgb. > > > > > > On Friday, July 12, 2013 6:30:06 PM UTC+2, Tony S Yu wrote: > > > > > > > > On Fri, Jul 12, 2013 at 7:13 AM, ginger wend wrote: > > Hi, > > > > I am trying to learn Local Binary Pattern with scikit-image and as I > have only limited knowledge in numpy and image analysis I find it hard. As > a result, I will appreciate a lot if you can provide me some answers as I > am sure that they will help me to advance: > > > > - If I understand correctly the > skimage.feature.local_binary_pattern(image, P, R, method=' uniform) will go > pixel by pixel (starting from pixel location 1,2) and generate the binary > number based on the P and R, am I right?. If so what happens if the R is > ?out of boundary?? > > - How do you calculate the histogram and why are there are 18 bins in > the example ( > http://scikit-image.org/docs/dev/auto_examples/plot_local_binary_pattern.html)? > > > - The output is (N, M) array and when I look at it is not clear to me > what is the output and how do you generate a histogram from it, can someone > you please clarify it. > > > > I know that these questions are be basic and while I was trying to look > for answers I found the information more mathematical and less with applied > approach. Therefore, any help, ideas or tips will help. > > > > Thanks for the patience, > > G. > > > > Hi, > > > > LBP can be quite confusing at first, but the idea is pretty simple. I > recently added some more explanations to the example in the gallery (most > of the addition is code to plot things---you don't really need to > understand that part of the code): > > > > > https://github.com/scikit-image/scikit-image/blob/master/doc/examples/plot_local_binary_pattern.py > > > > That example should clarify most of your questions. I don't really know > how the boundary is treated, so maybe someone else can clarify that point. > > > > Best, > > -Tony > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "scikit-image" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to scikit-image... at googlegroups.com . > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoenberger at demuc.de Sat Jul 13 05:08:16 2013 From: jschoenberger at demuc.de (=?windows-1252?Q?Johannes_Sch=F6nberger?=) Date: Sat, 13 Jul 2013 11:08:16 +0200 Subject: My porblem understanding Local Binary Pattern In-Reply-To: <0a2431b1-dd40-4fff-a25b-48c40b692d5a@googlegroups.com> References: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> <0a2431b1-dd40-4fff-a25b-48c40b692d5a@googlegroups.com> Message-ID: <8F71F357-6D59-43EE-9AAA-770E2FAC5A17@demuc.de> I think, label2rgb was added in 0.9dev and thus is not available in 0.8. Johannes Sch?nberger Am 13.07.2013 um 11:04 schrieb ginger wend : > Does it work with also with scikit-image 0.8 or only with 0.9dev? > > Im using 0.8 and got some error regrarding label2rgb. > > > On Friday, July 12, 2013 6:30:06 PM UTC+2, Tony S Yu wrote: > > > > On Fri, Jul 12, 2013 at 7:13 AM, ginger wend wrote: > Hi, > > I am trying to learn Local Binary Pattern with scikit-image and as I have only limited knowledge in numpy and image analysis I find it hard. As a result, I will appreciate a lot if you can provide me some answers as I am sure that they will help me to advance: > > - If I understand correctly the skimage.feature.local_binary_pattern(image, P, R, method=' uniform) will go pixel by pixel (starting from pixel location 1,2) and generate the binary number based on the P and R, am I right?. If so what happens if the R is ?out of boundary?? > - How do you calculate the histogram and why are there are 18 bins in the example (http://scikit-image.org/docs/dev/auto_examples/plot_local_binary_pattern.html)? > - The output is (N, M) array and when I look at it is not clear to me what is the output and how do you generate a histogram from it, can someone you please clarify it. > > I know that these questions are be basic and while I was trying to look for answers I found the information more mathematical and less with applied approach. Therefore, any help, ideas or tips will help. > > Thanks for the patience, > G. > > Hi, > > LBP can be quite confusing at first, but the idea is pretty simple. I recently added some more explanations to the example in the gallery (most of the addition is code to plot things---you don't really need to understand that part of the code): > > https://github.com/scikit-image/scikit-image/blob/master/doc/examples/plot_local_binary_pattern.py > > That example should clarify most of your questions. I don't really know how the boundary is treated, so maybe someone else can clarify that point. > > Best, > -Tony > > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From jni.soma at gmail.com Sat Jul 13 20:56:56 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Sun, 14 Jul 2013 02:56:56 +0200 Subject: Qhull error In-Reply-To: References: Message-ID: @Chintak, > Juan, 0.9 might have been a more plausible value, since if I'm not mistaken it is "number of pixels in image / number of pixels in the convex hull". Convex hull image will have more number of pixels. ;) No, the number of pixels in the convex hull will be greater than *or equal to *the number of pixels in the object. Hence 1.0 is the upper bound. When using flag values, you usually want values outside the normal range, or at the edge of it at least! > Juan are you taking this issue up? I can look at it, but I have a busy few weeks ahead... We'll see which of us finishes their current agenda first! =) On Thu, Jul 11, 2013 at 8:04 PM, Chintak Sheth wrote: > Hi, > > Juan are you taking this issue up? Else I wouldn't mind taking a go at it > though I first need to complete the Cython implementation of Fast Marching > Method code. Once I have that all ready for the PR I don't mind taking a > shot here. > > Chintak > On Jul 11, 2013 4:12 PM, "St?fan van der Walt" wrote: > >> On Thu, Jul 11, 2013 at 12:32 PM, Chintak Sheth >> wrote: >> > First, I think we need to find why the dual nature, `convex_hull_image` >> > independently works fine but not from `regionprops`. >> >> Spot on. Thanks for following through! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "scikit-image" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to scikit-image+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jostein.floystad at gmail.com Sun Jul 14 09:48:15 2013 From: jostein.floystad at gmail.com (jostein.floystad at gmail.com) Date: Sun, 14 Jul 2013 06:48:15 -0700 (PDT) Subject: Building the docs using python 3 Message-ID: Hi all, I've recently tried to make the transition to python3, at least for skimage development and testing. There is one issue stopping me: The documentation of skimage can't be built using python3 (keep in mind that we should also use a version of sphinx based on python3). Many of the issues that pop up when using python3 seem to be related to various sphinx extensions, for example scikit-image/doc/ext/numpydoc.py and scikit-image/doc/tools/{apigen.py,build_modref_templates.py}. I've seen several of these files have already been ported to python3 by other projects (numpy and ipython, at least), but I have not searched extensively for these newer versions. I assume that we do want the docs to build using python3. The question is how we go about porting the files in question with a minimal duplication of the efforts made by other projects? Just copying files into the skimage source tree seems very much like a short-term solution to me... On a related note, it would be nice to have travis CI build the docs and look for errors automatically. Presently, if an example fails to run, that example seems to simply disappear from the generated docs without the build failing; this is hardly ideal. Cheers! Jostein -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Sun Jul 14 00:09:28 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Sun, 14 Jul 2013 09:39:28 +0530 Subject: Qhull error In-Reply-To: References: Message-ID: > No, the number of pixels in the convex hull will be greater than or equal to the number of pixels in the object. Hence 1.0 is the upper bound. When using flag values, you usually want values outside the normal range, or at the edge of it at least! > Yes, rightly pointed out. > > Juan are you taking this issue up? > > I can look at it, but I have a busy few weeks ahead... We'll see which of us finishes their current agenda first! =) > Sounds good! :) Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Sun Jul 14 12:18:26 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Sun, 14 Jul 2013 11:18:26 -0500 Subject: My porblem understanding Local Binary Pattern In-Reply-To: <0bc7e7ab-c564-45cb-b674-7ed93294d4bc@googlegroups.com> References: <426d631a-f20f-43f9-83c8-6d2cb068146c@googlegroups.com> <0a2431b1-dd40-4fff-a25b-48c40b692d5a@googlegroups.com> <8F71F357-6D59-43EE-9AAA-770E2FAC5A17@demuc.de> <0bc7e7ab-c564-45cb-b674-7ed93294d4bc@googlegroups.com> Message-ID: On Sat, Jul 13, 2013 at 6:48 AM, ginger wend wrote: > How can I intall 0.9dev on windows? > > Hi, there are instructions on the website: http://scikit-image.org/docs/dev/install.html#installation-from-source Alternatively, I've attached a version of the example that drops the dependency on label2rgb. Another alternative would be for us to update the docs displayed on the website, but I can't ever remember how to do that. :P Cheers, -Tony > On Saturday, July 13, 2013 11:08:16 AM UTC+2, Johannes Sch?nberger wrote: > >> I think, label2rgb was added in 0.9dev and thus is not available in 0.8. >> >> Johannes Sch?nberger >> >> Am 13.07.2013 um 11:04 schrieb ginger wend : >> >> > Does it work with also with scikit-image 0.8 or only with 0.9dev? >> > >> > Im using 0.8 and got some error regrarding label2rgb. >> > >> > >> > On Friday, July 12, 2013 6:30:06 PM UTC+2, Tony S Yu wrote: >> > >> > >> > >> > On Fri, Jul 12, 2013 at 7:13 AM, ginger wend wrote: >> > Hi, >> > >> > I am trying to learn Local Binary Pattern with scikit-image and as I >> have only limited knowledge in numpy and image analysis I find it hard. As >> a result, I will appreciate a lot if you can provide me some answers as I >> am sure that they will help me to advance: >> > >> > - If I understand correctly the skimage.feature.local_binary_**pattern(image, >> P, R, method=' uniform) will go pixel by pixel (starting from pixel >> location 1,2) and generate the binary number based on the P and R, am I >> right?. If so what happens if the R is ?out of boundary?? >> > - How do you calculate the histogram and why are there are 18 bins in >> the example (http://scikit-image.org/docs/**dev/auto_examples/plot_local_ >> **binary_pattern.html)? >> >> > - The output is (N, M) array and when I look at it is not clear to me >> what is the output and how do you generate a histogram from it, can someone >> you please clarify it. >> > >> > I know that these questions are be basic and while I was trying to look >> for answers I found the information more mathematical and less with applied >> approach. Therefore, any help, ideas or tips will help. >> > >> > Thanks for the patience, >> > G. >> > >> > Hi, >> > >> > LBP can be quite confusing at first, but the idea is pretty simple. I >> recently added some more explanations to the example in the gallery (most >> of the addition is code to plot things---you don't really need to >> understand that part of the code): >> > >> > https://github.com/scikit-**image/scikit-image/blob/** >> master/doc/examples/plot_**local_binary_pattern.py >> > >> > That example should clarify most of your questions. I don't really know >> how the boundary is treated, so maybe someone else can clarify that point. >> > >> > Best, >> > -Tony >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "scikit-image" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an email to scikit-image...@**googlegroups.com. >> > For more options, visit https://groups.google.com/**groups/opt_out. >> >> > >> > >> >> -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot_local_binary_pattern.py Type: application/octet-stream Size: 6771 bytes Desc: not available URL: From jschoenberger at demuc.de Sun Jul 14 15:38:36 2013 From: jschoenberger at demuc.de (=?windows-1252?Q?Johannes_Sch=F6nberger?=) Date: Sun, 14 Jul 2013 21:38:36 +0200 Subject: Building the docs using python 3 In-Reply-To: References: Message-ID: Hi, > I've recently tried to make the transition to python3, at least for skimage development and testing. There is one issue stopping me: The documentation of skimage can't be built using python3 (keep in mind that we should also use a version of sphinx based on python3). > > Many of the issues that pop up when using python3 seem to be related to various sphinx extensions, for example scikit-image/doc/ext/numpydoc.py and scikit-image/doc/tools/{apigen.py,build_modref_templates.py}. I've seen several of these files have already been ported to python3 by other projects (numpy and ipython, at least), but I have not searched extensively for these newer versions. > > I assume that we do want the docs to build using python3. The question is how we go about porting the files in question with a minimal duplication of the efforts made by other projects? Just copying files into the skimage source tree seems very much like a short-term solution to me? I do not see another way than copying the relevant extension files from NumPy. Any other suggestions? > On a related note, it would be nice to have travis CI build the docs and look for errors automatically. Presently, if an example fails to run, that example seems to simply disappear from the generated docs without the build failing; this is hardly ideal. Travis currently runs all examples, building the docs as well is a good addition in my opinion. From jostein.floystad at gmail.com Sun Jul 14 16:13:12 2013 From: jostein.floystad at gmail.com (=?ISO-8859-1?Q?Jostein_B=F8_Fl=F8ystad?=) Date: Sun, 14 Jul 2013 22:13:12 +0200 Subject: Building the docs using python 3 In-Reply-To: References: Message-ID: Hi, > I assume that we do want the docs to build using python3. The question is > how we go about porting the files in question with a minimal duplication of > the efforts made by other projects? Just copying files into the skimage > source tree seems very much like a short-term solution to me? > > I do not see another way than copying the relevant extension files from > NumPy. Any other suggestions? > It is possible, of course. I have not investigated all the files in depth, but I found that ipython has recently fixed one of the sphinx extension files skimage also includes. However, their version has diverged from skimage's functionality-wise. These files obviously have common ancestry, but digging into two repo's git history to find the common version might be some work. One solution may be a separate repo somewhere where these sphinx extensions are maintained. It could then be included in several projects as submodules, for example. > > > On a related note, it would be nice to have travis CI build the docs and > look for errors automatically. Presently, if an example fails to run, that > example seems to simply disappear from the generated docs without the build > failing; this is hardly ideal. > > Travis currently runs all examples, building the docs as well is a good > addition in my opinion. > > Building the docs with travis is in principle very easy to set up. What needs looking into, is how to make sphinx exit with a non-zero error code when appropriate. Currently, the exit code is still zero even when rather bad things happen (like an example failing to run under sphinx; we recently had an issue (#649) where an example failed under sphinx but ran successfully stand-alone and passed travis). -------------- next part -------------- An HTML attachment was scrubbed... URL: From sokolov.valeri at gmail.com Mon Jul 15 02:49:16 2013 From: sokolov.valeri at gmail.com (Valeriy Sokolov) Date: Sun, 14 Jul 2013 23:49:16 -0700 (PDT) Subject: Getting chain code of the shape in image Message-ID: <06a97e81-1876-4047-b912-04f4c0f64fe4@googlegroups.com> Hi, I need to get a chain code of the region in the image. I failed to find from the docs any direct way to do it. Could you please suggest me the way how to do it with skimage? Or should I implement a boundary traverse by myself? Thank you in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From naibaf.omsare at gmail.com Mon Jul 15 23:16:57 2013 From: naibaf.omsare at gmail.com (=?UTF-8?Q?Fabian_Pe=C3=B1a_Arellano?=) Date: Mon, 15 Jul 2013 20:16:57 -0700 (PDT) Subject: ImportError: cannot import name LineModel Message-ID: <3543b52c-afb4-4431-a2d2-5ac7e583ad20@googlegroups.com> Dear all, I am trying to run the ransac model estimation example given on the documentation. However, Python cannot load the line model: Traceback (most recent call last): File "plot_ransac.py", line 13, in from skimage.measure import LineModel, ransac ImportError: cannot import name LineModel I am using the latest stable version 0.8.2 in Ubuntu. Are the LineModel and ransac routines available on the development version only? Thank you very much in advance. Regards, Fabi?n -------------- next part -------------- An HTML attachment was scrubbed... URL: From wishmen at walla.co.il Tue Jul 16 02:49:11 2013 From: wishmen at walla.co.il (wishmen at walla.co.il) Date: Mon, 15 Jul 2013 23:49:11 -0700 (PDT) Subject: GLCM with scikit-image In-Reply-To: <9da24452-ae00-49bf-b3e9-0891121416b2@googlegroups.com> References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> <9da24452-ae00-49bf-b3e9-0891121416b2@googlegroups.com> Message-ID: <9f5d241b-3d9b-4f19-9eab-429d00e169bd@googlegroups.com> Is there a way/command to avoiding printing out the warning message "skimage.dtype_converter: WARNING: Possible precision loss when converting from float64 to uint8" in the output? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Tue Jul 16 01:03:26 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Tue, 16 Jul 2013 10:33:26 +0530 Subject: How to get a region chain code? In-Reply-To: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Message-ID: Hi Valeriy, Wow a compression technique! That would surely be a great addition. > I am studying a shape descriptors and would like to compute a chain code description of a labeled shape. I was trying to look into docs but have not find a direct way to get this region property with skimage. Is there any way to do it in a few calls which I missed? > - Extract the boundary. `skimage.morphology.erosion` using `skimage.morphology.disk` structuring element with radius 1. Then subtract this from the original image. - Label the boundaries. If you already have a labeled image, then that saves you a function call else there is `label` function in `skimage.morphology`. - Use `np.transpose(np.where(label == 1))` to generate the indices of pixels marked as label 1. This will return a `list` of indices. You can simply use the first as the starting point. This should help set up the stage for the traversal. Hope this helps a bit. Chintak. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Tue Jul 16 04:46:28 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Tue, 16 Jul 2013 10:46:28 +0200 Subject: How to get a region chain code? In-Reply-To: References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Message-ID: This is the third time in about a month that we have the need to determine geometric properties of regions. The right solution here is to build a region graph, like I described in the ticket (sorry, I can't check the number from my phone right now). Would anyone be interested in helping to implement that? In the meantime we can implement the border finding manually, and later just slot in the new structure. St?fan On 16 Jul 2013 07:03, "Chintak Sheth" wrote: > Hi Valeriy, > > Wow a compression technique! That would surely be a great addition. > > > I am studying a shape descriptors and would like to compute a chain code > description of a labeled shape. I was trying to look into docs but have not > find a direct way to get this region property with skimage. Is there any > way to do it in a few calls which I missed? > > > > - Extract the boundary. `skimage.morphology.erosion` using > `skimage.morphology.disk` structuring element with radius 1. Then subtract > this from the original image. > > - Label the boundaries. If you already have a labeled image, then that > saves you a function call else there is `label` function in > `skimage.morphology`. > > - Use `np.transpose(np.where(label == 1))` to generate the indices of > pixels marked as label 1. This will return a `list` of indices. You can > simply use the first as the starting point. > > This should help set up the stage for the traversal. Hope this helps a bit. > > Chintak. > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sokolov.valeri at gmail.com Tue Jul 16 05:02:21 2013 From: sokolov.valeri at gmail.com (Valeriy Sokolov) Date: Tue, 16 Jul 2013 13:02:21 +0400 Subject: How to get a region chain code? In-Reply-To: References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Message-ID: On Tue, Jul 16, 2013 at 9:03 AM, Chintak Sheth wrote: > Hi Valeriy, > > Wow a compression technique! That would surely be a great addition. > Compression is cool no doubt, but I need it to turn the labeled shape into a polygon =) > > I am studying a shape descriptors and would like to compute a chain code > description of a labeled shape. I was trying to look into docs but have not > find a direct way to get this region property with skimage. Is there any > way to do it in a few calls which I missed? > > > > - Extract the boundary. `skimage.morphology.erosion` using > `skimage.morphology.disk` structuring element with radius 1. Then subtract > this from the original image. > I suppose `skimage.morphology.dilation` would work better. It will work in case we computing chain code for the line of 1-pixel width. > - Label the boundaries. If you already have a labeled image, then that > saves you a function call else there is `label` function in > `skimage.morphology`. > > - Use `np.transpose(np.where(label == 1))` to generate the indices of > pixels marked as label 1. This will return a `list` of indices. You can > simply use the first as the starting point. > > This should help set up the stage for the traversal. Hope this helps a bit. > The traverse is the most interesting part in this question =) The other things do not introduce order on the pixels and could be made with current skimage easily. > Chintak. > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Best regards, Valeriy Sokolov. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sokolov.valeri at gmail.com Tue Jul 16 05:06:34 2013 From: sokolov.valeri at gmail.com (Valeriy Sokolov) Date: Tue, 16 Jul 2013 13:06:34 +0400 Subject: How to get a region chain code? In-Reply-To: References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Message-ID: I would like to help with the implementation. I am going to make draft which will work for my current case. But I will need some guidance and review to add it to the skimage code base. It would be helpful if you have some approach in mind... I am going to get shape boundary pixels (with morphology) and then apply something like pixel grid graph traverse of the boundary with Cython. On Tue, Jul 16, 2013 at 12:46 PM, St?fan van der Walt wrote: > This is the third time in about a month that we have the need to determine > geometric properties of regions. The right solution here is to build a > region graph, like I described in the ticket (sorry, I can't check the > number from my phone right now). Would anyone be interested in helping to > implement that? > > In the meantime we can implement the border finding manually, and later > just slot in the new structure. > > St?fan > On 16 Jul 2013 07:03, "Chintak Sheth" wrote: > >> Hi Valeriy, >> >> Wow a compression technique! That would surely be a great addition. >> >> > I am studying a shape descriptors and would like to compute a chain >> code description of a labeled shape. I was trying to look into docs but >> have not find a direct way to get this region property with skimage. Is >> there any way to do it in a few calls which I missed? >> > >> >> - Extract the boundary. `skimage.morphology.erosion` using >> `skimage.morphology.disk` structuring element with radius 1. Then subtract >> this from the original image. >> >> - Label the boundaries. If you already have a labeled image, then that >> saves you a function call else there is `label` function in >> `skimage.morphology`. >> >> - Use `np.transpose(np.where(label == 1))` to generate the indices of >> pixels marked as label 1. This will return a `list` of indices. You can >> simply use the first as the starting point. >> >> This should help set up the stage for the traversal. Hope this helps a >> bit. >> >> Chintak. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "scikit-image" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to scikit-image+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Best regards, Valeriy Sokolov. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Mon Jul 15 23:12:17 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 16 Jul 2013 13:12:17 +1000 Subject: How to get a region chain code? In-Reply-To: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Message-ID: Hi Valeriy, As far as I know there is no chain code implementation in scikit-image. (In fact I'd never heard of chain codes until today!) I personally would find it a valuable addition to the scikit if you came up with a good implementation. Juan. On Sat, Jul 13, 2013 at 7:58 PM, Valeriy Sokolov wrote: > Hi, > > I am studying a shape descriptors and would like to compute a chain code > description of a labeled shape. I was trying to look into docs but have not > find a direct way to get this region property with skimage. Is there any > way to do it in a few calls which I missed? > > Thank you in advance. > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wishmen at walla.co.il Wed Jul 17 05:56:24 2013 From: wishmen at walla.co.il (wishmen at walla.co.il) Date: Wed, 17 Jul 2013 02:56:24 -0700 (PDT) Subject: GLCM with scikit-image In-Reply-To: <73f054b0-ba24-4cf7-a5f0-166e090679a9@googlegroups.com> References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> <9da24452-ae00-49bf-b3e9-0891121416b2@googlegroups.com> <73f054b0-ba24-4cf7-a5f0-166e090679a9@googlegroups.com> Message-ID: <7ddef0ce-064d-450b-b0df-968145517cf7@googlegroups.com> How can I cancel the "skimage.dtype_converter: WARNING: Possible precision loss when converting from float64 to uint8" warning in the output?, is it possible? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeanpatrick.pommier at gmail.com Wed Jul 17 13:34:01 2013 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Wed, 17 Jul 2013 10:34:01 -0700 (PDT) Subject: Failed to import LineModel, ransac Message-ID: Hi, When doing from ipython: print skimage.__version__ from skimage.measure import LineModel I get: ---------------------------------------------------------------------------ImportError Traceback (most recent call last) in () 1 print skimage.__version__----> 2 from skimage.measure import LineModel ImportError: cannot import name LineModel 0.9dev Is it a version problem ? Jean-Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From kmichael.aye at gmail.com Wed Jul 17 19:43:53 2013 From: kmichael.aye at gmail.com (Michael Aye) Date: Wed, 17 Jul 2013 16:43:53 -0700 (PDT) Subject: Failed to import LineModel, ransac In-Reply-To: References: Message-ID: I also have 0.9dev via EPD, and also do not have LineModel or ransac inside the measure module. On Wednesday, July 17, 2013 10:34:01 AM UTC-7, Jean-Patrick Pommier wrote: > > Hi, > > > When doing from ipython: > > print skimage.__version__ > from skimage.measure import LineModel > > I get: > > ---------------------------------------------------------------------------ImportError Traceback (most recent call last) in () 1 print skimage.__version__----> 2 from skimage.measure import LineModel > ImportError: cannot import name LineModel > > > 0.9dev > > > Is it a version problem ? > > Jean-Patrick > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Wed Jul 17 22:56:05 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Wed, 17 Jul 2013 21:56:05 -0500 Subject: Failed to import LineModel, ransac In-Reply-To: References: Message-ID: On Wed, Jul 17, 2013 at 6:43 PM, Michael Aye wrote: > I also have 0.9dev via EPD, and also do not have LineModel or ransac > inside the measure module. I didn't think EPD offered dev versions of packages. I can only see 0.8.2. In any case, it depends on how recently the dev version was updated. The RANSAC code was only merged into master about 2 months ago. (Any pulls from master in the last 4 months will be labeled 0.9dev.) Best, -Tony On Wednesday, July 17, 2013 10:34:01 AM UTC-7, Jean-Patrick Pommier wrote: >> >> Hi, >> >> >> When doing from ipython: >> >> print skimage.__version__ >> from skimage.measure import LineModel >> >> I get: >> >> ------------------------------**------------------------------**---------------ImportError Traceback (most recent call last) in () 1 print skimage.__version__----> 2 from skimage.measure import LineModel >> ImportError: cannot import name LineModel >> >> >> 0.9dev >> >> >> Is it a version problem ? >> >> Jean-Patrick >> >> >> -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.bll at gmail.com Thu Jul 18 04:14:46 2013 From: anders.bll at gmail.com (Anders Boesen Lindbo Larsen) Date: Thu, 18 Jul 2013 01:14:46 -0700 (PDT) Subject: seeking advice on HoG applicability In-Reply-To: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> Message-ID: <78cdca99-4453-4c37-a7ee-75b47437ffef@googlegroups.com> I attach this mail correspondence as it may be relevant for others. Stefan: Do you think a bag of words implementation would fit into scikit-image? I have some code that I would be happy to polish and contribute. The main problem is that bag-of-words rely on a k-means clustering method which I would prefer to import from scikit-learn because the one from scipy is slow for a large number of samples. It is my impression that scikit-image tries to stay independent of scikit-learn. Cheers, Anders ---------- Forwarded message ---------- From: Anders Boesen Lindbo Larsen Date: Thu, Jul 18, 2013 at 10:00 AM Subject: Re: about DAISY To: Lisa Torrey Hi Lisa, Cool problem; I have also read about it on the scikits-image mailing list. I would start out with a simple approach called 'bag of words' (aka. 'bag of features'). First, you sample a bunch of overlapping DAISY features for a representative set of training images and perform a clustering (e.g. k-means with k=1000) of these descriptors. You can think of the cluster centers (aka. visual words) as a vocabulary. An image can now be described by extracting DAISY features and mapping each feature to its nearest cluster center in the vocabulary. By counting the number of occurrences of each visual word you end up with a histogram which you can use for comparing images. Bag of words models have shown quite successful for many flavors of visual recognition because they are able to capture texture and image structure in a generic manner. That is, you don't have to engineer the model much to make it fit your problem. I'd be happy to help you if you have further questions. Best, Anders On Tue, Jul 16, 2013 at 6:02 PM, Lisa Torrey wrote: > Hi Anders - > > I'm trying to determine if DAISY descriptors might be suitable for a problem > I'm working on. I see that you have some expertise in this area, since you > contributed the DAISY code to scikit-image, and I'm wondering if you'd be > willing to let me know your thoughts. > > I'm mainly trying to understand if DAISY descriptors could be effectively > used as features in a binary classification problem where the two image > classes have a lot of internal variation. > > The two classes I'm working with are two types of moss. Type 1 is typically > a stalk with leaves on it. Type 2 is typically a stalk with some branches > coming off it, and leaves on the branches. But there's quite a bit of visual > diversity within these types. A type represents a group of moss species that > can look surprisingly different from each other. On top of that, the images > I've got have no common size or orientation. > > If you have any thoughts, I'd love to hear them. I can share some examples > of moss images if you're curious, but even a gut reaction would be helpful. > > -Lisa > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lisa.torrey at gmail.com Thu Jul 18 09:01:43 2013 From: lisa.torrey at gmail.com (Lisa Torrey) Date: Thu, 18 Jul 2013 06:01:43 -0700 (PDT) Subject: seeking advice on HoG applicability In-Reply-To: <78cdca99-4453-4c37-a7ee-75b47437ffef@googlegroups.com> References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> <78cdca99-4453-4c37-a7ee-75b47437ffef@googlegroups.com> Message-ID: <4e6d3bea-18b0-48b0-91d4-d1deb3168861@googlegroups.com> Thank you! The clustering step is definitely what was missing from my understanding of the "bag of words" approach. -Lisa On Thursday, July 18, 2013 4:14:46 AM UTC-4, Anders Boesen Lindbo Larsen wrote: > > I attach this mail correspondence as it may be relevant for others. > > Stefan: Do you think a bag of words implementation would fit into > scikit-image? I have some code that I would be happy to polish and > contribute. The main problem is that bag-of-words rely on a k-means > clustering method which I would prefer to import from scikit-learn because > the one from scipy is slow for a large number of samples. It is my > impression that scikit-image tries to stay independent of scikit-learn. > > Cheers, > Anders > > > ---------- Forwarded message ---------- > From: Anders Boesen Lindbo Larsen > > Date: Thu, Jul 18, 2013 at 10:00 AM > Subject: Re: about DAISY > To: Lisa Torrey > > > > Hi Lisa, > > Cool problem; I have also read about it on the scikits-image mailing list. > > I would start out with a simple approach called 'bag of words' (aka. > 'bag of features'). First, you sample a bunch of overlapping DAISY > features for a representative set of training images and perform a > clustering (e.g. k-means with k=1000) of these descriptors. You can > think of the cluster centers (aka. visual words) as a vocabulary. An > image can now be described by extracting DAISY features and mapping > each feature to its nearest cluster center in the vocabulary. By > counting the number of occurrences of each visual word you end up with > a histogram which you can use for comparing images. > Bag of words models have shown quite successful for many flavors of > visual recognition because they are able to capture texture and image > structure in a generic manner. That is, you don't have to engineer the > model much to make it fit your problem. > > I'd be happy to help you if you have further questions. > > Best, > Anders > > On Tue, Jul 16, 2013 at 6:02 PM, Lisa Torrey > > wrote: > > Hi Anders - > > > > I'm trying to determine if DAISY descriptors might be suitable for a > problem > > I'm working on. I see that you have some expertise in this area, since > you > > contributed the DAISY code to scikit-image, and I'm wondering if you'd be > > willing to let me know your thoughts. > > > > I'm mainly trying to understand if DAISY descriptors could be effectively > > used as features in a binary classification problem where the two image > > classes have a lot of internal variation. > > > > The two classes I'm working with are two types of moss. Type 1 is > typically > > a stalk with leaves on it. Type 2 is typically a stalk with some branches > > coming off it, and leaves on the branches. But there's quite a bit of > visual > > diversity within these types. A type represents a group of moss species > that > > can look surprisingly different from each other. On top of that, the > images > > I've got have no common size or orientation. > > > > If you have any thoughts, I'd love to hear them. I can share some > examples > > of moss images if you're curious, but even a gut reaction would be > helpful. > > > > -Lisa > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Thu Jul 18 10:12:00 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 18 Jul 2013 09:12:00 -0500 Subject: GLCM with scikit-image In-Reply-To: <7ddef0ce-064d-450b-b0df-968145517cf7@googlegroups.com> References: <74a4cdd3-015c-4ca7-ba4f-b5ede4abd49e@googlegroups.com> <3b3cba05-3482-488c-b683-1b34156fa704@googlegroups.com> <9da24452-ae00-49bf-b3e9-0891121416b2@googlegroups.com> <73f054b0-ba24-4cf7-a5f0-166e090679a9@googlegroups.com> <7ddef0ce-064d-450b-b0df-968145517cf7@googlegroups.com> Message-ID: On Wed, Jul 17, 2013 at 4:56 AM, wrote: > How can I cancel the "skimage.dtype_converter: WARNING: Possible precision > loss when converting from float64 to uint8" warning in the output?, is it > possible? > > The warning messages are a bit annoying. We're discussing ways of making it less annoying here: https://github.com/scikit-image/scikit-image/issues/543 For now you can just disable that logger: from skimage.util import dtype dtype.log.disabled = True Cheers, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeanpatrick.pommier at gmail.com Thu Jul 18 06:42:12 2013 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Thu, 18 Jul 2013 12:42:12 +0200 Subject: Failed to import LineModel, ransac In-Reply-To: References: Message-ID: I forget to mention that skimage is running on ubuntu 13.04 and was installed with easy_install. 2013/7/18 Tony Yu > > > > On Wed, Jul 17, 2013 at 6:43 PM, Michael Aye wrote: > >> I also have 0.9dev via EPD, and also do not have LineModel or ransac >> inside the measure module. > > > I didn't think EPD offered dev versions of packages. I can only see 0.8.2. > In any case, it depends on how recently the dev version was updated. The > RANSAC code was only merged into master about 2 months ago. (Any pulls from > master in the last 4 months will be labeled 0.9dev.) > > Best, > -Tony > > On Wednesday, July 17, 2013 10:34:01 AM UTC-7, Jean-Patrick Pommier wrote: >>> >>> Hi, >>> >>> >>> When doing from ipython: >>> >>> print skimage.__version__ >>> from skimage.measure import LineModel >>> >>> I get: >>> >>> ------------------------------**------------------------------**---------------ImportError Traceback (most recent call last) in () 1 print skimage.__version__----> 2 from skimage.measure import LineModel >>> ImportError: cannot import name LineModel >>> >>> >>> 0.9dev >>> >>> >>> Is it a version problem ? >>> >>> Jean-Patrick >>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "scikit-image" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to scikit-image+unsubscribe at googlegroups.com. >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "scikit-image" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe. > To unsubscribe from this group and all of its topics, send an email to > scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Thu Jul 18 09:07:16 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 18 Jul 2013 15:07:16 +0200 Subject: seeking advice on HoG applicability In-Reply-To: <78cdca99-4453-4c37-a7ee-75b47437ffef@googlegroups.com> References: <90e09994-39bc-4c73-a026-453fb8316097@googlegroups.com> <78cdca99-4453-4c37-a7ee-75b47437ffef@googlegroups.com> Message-ID: Hi Anders On Thu, Jul 18, 2013 at 10:14 AM, Anders Boesen Lindbo Larsen wrote: > I attach this mail correspondence as it may be relevant for others. > > Stefan: Do you think a bag of words implementation would fit into > scikit-image? I have some code that I would be happy to polish and > contribute. The main problem is that bag-of-words rely on a k-means > clustering method which I would prefer to import from scikit-learn because > the one from scipy is slow for a large number of samples. It is my > impression that scikit-image tries to stay independent of scikit-learn. I presume sklearn already has a bag-of-words implementation, so what we really need are more examples of how to use sklearn and skimage together. At the moment, I keep those examples in https://github.com/stefanv/scikit-image-demos but I can foresee including them directly in the gallery in the future. St?fan From stefan at sun.ac.za Thu Jul 18 09:17:28 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 18 Jul 2013 15:17:28 +0200 Subject: Failed to import LineModel, ransac In-Reply-To: References: Message-ID: We should update the online docs to point to the last stable version instead of to dev (as has been suggested by others in the past)--I see it causes some confusion. St?fan On Thu, Jul 18, 2013 at 12:42 PM, Jean-Patrick Pommier wrote: > I forget to mention that skimage is running on ubuntu 13.04 and was > installed with easy_install. > > > 2013/7/18 Tony Yu >> >> >> >> >> On Wed, Jul 17, 2013 at 6:43 PM, Michael Aye >> wrote: >>> >>> I also have 0.9dev via EPD, and also do not have LineModel or ransac >>> inside the measure module. >> >> >> I didn't think EPD offered dev versions of packages. I can only see 0.8.2. >> In any case, it depends on how recently the dev version was updated. The >> RANSAC code was only merged into master about 2 months ago. (Any pulls from >> master in the last 4 months will be labeled 0.9dev.) >> >> Best, >> -Tony >> >>> On Wednesday, July 17, 2013 10:34:01 AM UTC-7, Jean-Patrick Pommier >>> wrote: >>>> >>>> Hi, >>>> >>>> >>>> When doing from ipython: >>>> >>>> print skimage.__version__ >>>> from skimage.measure import LineModel >>>> >>>> I get: >>>> >>>> >>>> --------------------------------------------------------------------------- >>>> ImportError Traceback (most recent call >>>> last) >>>> in () >>>> 1 print skimage.__version__ >>>> ----> 2 from skimage.measure import LineModel >>>> >>>> ImportError: cannot import name LineModel >>>> >>>> 0.9dev >>>> >>>> >>>> Is it a version problem ? >>>> >>>> Jean-Patrick >>>> >>>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "scikit-image" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to scikit-image+unsubscribe at googlegroups.com. >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "scikit-image" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe. >> To unsubscribe from this group and all of its topics, send an email to >> scikit-image+unsubscribe at googlegroups.com. >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From tsyu80 at gmail.com Thu Jul 18 16:44:01 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 18 Jul 2013 15:44:01 -0500 Subject: Failed to import LineModel, ransac In-Reply-To: References: Message-ID: Github issue: https://github.com/scikit-image/scikit-image/issues/658 On Thu, Jul 18, 2013 at 2:10 PM, Johannes Sch?nberger < jschoenberger at demuc.de> wrote: > @all You must download the latest development version on github to use > the Line, Circle and EllipseModel and ransac. They were added just about 1 > month ago. 0.9 is the dev version. 0.8 the stable version. > > Johannes Sch?nberger > > Am 18.07.2013 um 20:42 schrieb "Jean-Patrick Pommier" < > jeanpatrick.pommier at gmail.com>: > > The example using LineModel > mentions > skimage 0.9. To use *LineModel*, should I try to use the stable version ? > > > 2013/7/18 St?fan van der Walt > >> We should update the online docs to point to the last stable version >> instead of to dev (as has been suggested by others in the past)--I see >> it causes some confusion. >> >> St?fan >> >> On Thu, Jul 18, 2013 at 12:42 PM, Jean-Patrick Pommier >> wrote: >> > I forget to mention that skimage is running on ubuntu 13.04 and was >> > installed with easy_install. >> > >> > >> > 2013/7/18 Tony Yu >> >> >> >> >> >> >> >> >> >> On Wed, Jul 17, 2013 at 6:43 PM, Michael Aye >> >> wrote: >> >>> >> >>> I also have 0.9dev via EPD, and also do not have LineModel or ransac >> >>> inside the measure module. >> >> >> >> >> >> I didn't think EPD offered dev versions of packages. I can only see >> 0.8.2. >> >> In any case, it depends on how recently the dev version was updated. >> The >> >> RANSAC code was only merged into master about 2 months ago. (Any pulls >> from >> >> master in the last 4 months will be labeled 0.9dev.) >> >> >> >> Best, >> >> -Tony >> >> >> >>> On Wednesday, July 17, 2013 10:34:01 AM UTC-7, Jean-Patrick Pommier >> >>> wrote: >> >>>> >> >>>> Hi, >> >>>> >> >>>> >> >>>> When doing from ipython: >> >>>> >> >>>> print skimage.__version__ >> >>>> from skimage.measure import LineModel >> >>>> >> >>>> I get: >> >>>> >> >>>> >> >>>> >> --------------------------------------------------------------------------- >> >>>> ImportError Traceback (most recent call >> >>>> last) >> >>>> in () >> >>>> 1 print skimage.__version__ >> >>>> ----> 2 from skimage.measure import LineModel >> >>>> >> >>>> ImportError: cannot import name LineModel >> >>>> >> >>>> 0.9dev >> >>>> >> >>>> >> >>>> Is it a version problem ? >> >>>> >> >>>> Jean-Patrick >> >>>> >> >>>> >> >>> -- >> >>> You received this message because you are subscribed to the Google >> Groups >> >>> "scikit-image" group. >> >>> To unsubscribe from this group and stop receiving emails from it, >> send an >> >>> email to scikit-image+unsubscribe at googlegroups.com. >> >>> >> >>> For more options, visit https://groups.google.com/groups/opt_out. >> >>> >> >>> >> >> >> >> >> >> -- >> >> You received this message because you are subscribed to a topic in the >> >> Google Groups "scikit-image" group. >> >> To unsubscribe from this topic, visit >> >> https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe >> . >> >> To unsubscribe from this group and all of its topics, send an email to >> >> scikit-image+unsubscribe at googlegroups.com. >> >> >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >> >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "scikit-image" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to scikit-image+unsubscribe at googlegroups.com. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > >> > >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "scikit-image" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe. >> To unsubscribe from this group and all of its topics, send an email to >> scikit-image+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Thu Jul 18 16:45:54 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 18 Jul 2013 15:45:54 -0500 Subject: ImportError: cannot import name LineModel In-Reply-To: <3543b52c-afb4-4431-a2d2-5ac7e583ad20@googlegroups.com> References: <3543b52c-afb4-4431-a2d2-5ac7e583ad20@googlegroups.com> Message-ID: On Mon, Jul 15, 2013 at 10:16 PM, Fabian Pe?a Arellano < naibaf.omsare at gmail.com> wrote: > Dear all, > > I am trying to run the ransac model estimation example given on the > documentation. However, Python cannot load the line model: > > Traceback (most recent call last): > File "plot_ransac.py", line 13, in > from skimage.measure import LineModel, ransac > ImportError: cannot import name LineModel > > I am using the latest stable version 0.8.2 in Ubuntu. Are the LineModel > and ransac routines available on the development version only? > Yes, they're only available in the development version. Currently, the website links to the development docs. To avoid confusion, we should be linking to the docs for the current stable release. Github issue: https://github.com/scikit-image/scikit-image/issues/658 Best, -Tony > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kmichael.aye at gmail.com Thu Jul 18 19:09:45 2013 From: kmichael.aye at gmail.com (Michael Aye) Date: Thu, 18 Jul 2013 16:09:45 -0700 (PDT) Subject: Failed to import LineModel, ransac In-Reply-To: References: Message-ID: <013e66aa-604a-4b01-9f1b-35bc3292f27f@googlegroups.com> > > > I didn't think EPD offered dev versions of packages. I can only see 0.8.2. > In any case, it depends on how recently the dev version was updated. The > RANSAC code was only merged into master about 2 months ago. (Any pulls from > master in the last 4 months will be labeled 0.9dev.) > Yeah, sorry for that. Must have pulled master in at sometime for some interesting feature. I am still regularly confused by the fact that enpkg --remove does leave the egg in site-packages, and for some reason I don't have the git folder of skimage anymore, so I thought it must have come via enpkg. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.terry at gmail.com Thu Jul 18 19:36:50 2013 From: matt.terry at gmail.com (Matt Terry) Date: Thu, 18 Jul 2013 16:36:50 -0700 (PDT) Subject: color difference functions Message-ID: Hi, Would color difference functions [1] be of interest to skimage? I have the distance functions for CIE76, CIEDE94, CIEDE2000 and CMC l:c if you think the would be of general interest. -matt [1] http://en.wikipedia.org/wiki/Color_difference -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoenberger at demuc.de Thu Jul 18 15:10:43 2013 From: jschoenberger at demuc.de (=?iso-8859-1?Q?Johannes_Sch=F6nberger?=) Date: Thu, 18 Jul 2013 19:10:43 +0000 Subject: Failed to import LineModel, ransac In-Reply-To: References: , Message-ID: @all You must download the latest development version on github to use the Line, Circle and EllipseModel and ransac. They were added just about 1 month ago. 0.9 is the dev version. 0.8 the stable version. Johannes Sch?nberger Am 18.07.2013 um 20:42 schrieb "Jean-Patrick Pommier" >: The example using LineModel mentions skimage 0.9. To use LineModel, should I try to use the stable version ? 2013/7/18 St?fan van der Walt > We should update the online docs to point to the last stable version instead of to dev (as has been suggested by others in the past)--I see it causes some confusion. St?fan On Thu, Jul 18, 2013 at 12:42 PM, Jean-Patrick Pommier > wrote: > I forget to mention that skimage is running on ubuntu 13.04 and was > installed with easy_install. > > > 2013/7/18 Tony Yu > >> >> >> >> >> On Wed, Jul 17, 2013 at 6:43 PM, Michael Aye > >> wrote: >>> >>> I also have 0.9dev via EPD, and also do not have LineModel or ransac >>> inside the measure module. >> >> >> I didn't think EPD offered dev versions of packages. I can only see 0.8.2. >> In any case, it depends on how recently the dev version was updated. The >> RANSAC code was only merged into master about 2 months ago. (Any pulls from >> master in the last 4 months will be labeled 0.9dev.) >> >> Best, >> -Tony >> >>> On Wednesday, July 17, 2013 10:34:01 AM UTC-7, Jean-Patrick Pommier >>> wrote: >>>> >>>> Hi, >>>> >>>> >>>> When doing from ipython: >>>> >>>> print skimage.__version__ >>>> from skimage.measure import LineModel >>>> >>>> I get: >>>> >>>> >>>> --------------------------------------------------------------------------- >>>> ImportError Traceback (most recent call >>>> last) >>>> in () >>>> 1 print skimage.__version__ >>>> ----> 2 from skimage.measure import LineModel >>>> >>>> ImportError: cannot import name LineModel >>>> >>>> 0.9dev >>>> >>>> >>>> Is it a version problem ? >>>> >>>> Jean-Patrick >>>> >>>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "scikit-image" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to scikit-image+unsubscribe at googlegroups.com. >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "scikit-image" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe. >> To unsubscribe from this group and all of its topics, send an email to >> scikit-image+unsubscribe at googlegroups.com. >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe. To unsubscribe from this group and all of its topics, send an email to scikit-image+unsubscribe at googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeanpatrick.pommier at gmail.com Thu Jul 18 14:42:13 2013 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Thu, 18 Jul 2013 20:42:13 +0200 Subject: Failed to import LineModel, ransac In-Reply-To: References: Message-ID: The example using LineModel mentions skimage 0.9. To use *LineModel*, should I try to use the stable version ? 2013/7/18 St?fan van der Walt > We should update the online docs to point to the last stable version > instead of to dev (as has been suggested by others in the past)--I see > it causes some confusion. > > St?fan > > On Thu, Jul 18, 2013 at 12:42 PM, Jean-Patrick Pommier > wrote: > > I forget to mention that skimage is running on ubuntu 13.04 and was > > installed with easy_install. > > > > > > 2013/7/18 Tony Yu > >> > >> > >> > >> > >> On Wed, Jul 17, 2013 at 6:43 PM, Michael Aye > >> wrote: > >>> > >>> I also have 0.9dev via EPD, and also do not have LineModel or ransac > >>> inside the measure module. > >> > >> > >> I didn't think EPD offered dev versions of packages. I can only see > 0.8.2. > >> In any case, it depends on how recently the dev version was updated. The > >> RANSAC code was only merged into master about 2 months ago. (Any pulls > from > >> master in the last 4 months will be labeled 0.9dev.) > >> > >> Best, > >> -Tony > >> > >>> On Wednesday, July 17, 2013 10:34:01 AM UTC-7, Jean-Patrick Pommier > >>> wrote: > >>>> > >>>> Hi, > >>>> > >>>> > >>>> When doing from ipython: > >>>> > >>>> print skimage.__version__ > >>>> from skimage.measure import LineModel > >>>> > >>>> I get: > >>>> > >>>> > >>>> > --------------------------------------------------------------------------- > >>>> ImportError Traceback (most recent call > >>>> last) > >>>> in () > >>>> 1 print skimage.__version__ > >>>> ----> 2 from skimage.measure import LineModel > >>>> > >>>> ImportError: cannot import name LineModel > >>>> > >>>> 0.9dev > >>>> > >>>> > >>>> Is it a version problem ? > >>>> > >>>> Jean-Patrick > >>>> > >>>> > >>> -- > >>> You received this message because you are subscribed to the Google > Groups > >>> "scikit-image" group. > >>> To unsubscribe from this group and stop receiving emails from it, send > an > >>> email to scikit-image+unsubscribe at googlegroups.com. > >>> > >>> For more options, visit https://groups.google.com/groups/opt_out. > >>> > >>> > >> > >> > >> -- > >> You received this message because you are subscribed to a topic in the > >> Google Groups "scikit-image" group. > >> To unsubscribe from this topic, visit > >> https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe. > >> To unsubscribe from this group and all of its topics, send an email to > >> scikit-image+unsubscribe at googlegroups.com. > >> > >> For more options, visit https://groups.google.com/groups/opt_out. > >> > >> > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "scikit-image" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to scikit-image+unsubscribe at googlegroups.com. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "scikit-image" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/scikit-image/24fxSmErl1c/unsubscribe. > To unsubscribe from this group and all of its topics, send an email to > scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.ghose at gmail.com Thu Jul 18 21:48:30 2013 From: ronnie.ghose at gmail.com (Ronnie Ghose) Date: Thu, 18 Jul 2013 21:48:30 -0400 Subject: IRC Channel Message-ID: is there no IRC channel for scikit-image? if not - why? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoenberger at demuc.de Fri Jul 19 02:06:44 2013 From: jschoenberger at demuc.de (=?windows-1252?Q?Johannes_Sch=F6nberger?=) Date: Fri, 19 Jul 2013 08:06:44 +0200 Subject: IRC Channel In-Reply-To: References: Message-ID: <266D706A-D411-4A88-AA2B-AE41C34E5AC1@demuc.de> I can only speak for myself, but I personally do not use IRC? Johannes Sch?nberger Am 19.07.2013 um 03:48 schrieb Ronnie Ghose : > is there no IRC channel for scikit-image? if not - why? > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From matt.terry at gmail.com Fri Jul 19 11:55:25 2013 From: matt.terry at gmail.com (Matt Terry) Date: Fri, 19 Jul 2013 08:55:25 -0700 (PDT) Subject: color difference functions In-Reply-To: References: Message-ID: <95dbe0e4-76c8-4bdb-b814-936ce89b7cd8@googlegroups.com> Sounds good. I'll send a PR when I get the tests finished. -matt On Friday, July 19, 2013 2:03:58 AM UTC-7, Stefan van der Walt wrote: > > Hi Matt > > On Fri, Jul 19, 2013 at 1:36 AM, Matt Terry > > wrote: > > Would color difference functions [1] be of interest to skimage? I have > the > > distance functions for CIE76, CIEDE94, CIEDE2000 and CMC l:c if you > think > > the would be of general interest. > > Those fit in very well with the scope of the ``skimage.color`` module. > I think especially if we can have docstrings that teach the user a > bit more about the topic, this would be highly useful in the classroom > too. > > St?fan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Fri Jul 19 03:57:28 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Fri, 19 Jul 2013 09:57:28 +0200 Subject: IRC Channel In-Reply-To: References: Message-ID: On Fri, Jul 19, 2013 at 3:48 AM, Ronnie Ghose wrote: > is there no IRC channel for scikit-image? if not - why? There is #skimage on freenode.net, but not a lot of activity. St?fan From stefan at sun.ac.za Fri Jul 19 05:03:58 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Fri, 19 Jul 2013 11:03:58 +0200 Subject: color difference functions In-Reply-To: References: Message-ID: Hi Matt On Fri, Jul 19, 2013 at 1:36 AM, Matt Terry wrote: > Would color difference functions [1] be of interest to skimage? I have the > distance functions for CIE76, CIEDE94, CIEDE2000 and CMC l:c if you think > the would be of general interest. Those fit in very well with the scope of the ``skimage.color`` module. I think especially if we can have docstrings that teach the user a bit more about the topic, this would be highly useful in the classroom too. St?fan From ronnie.ghose at gmail.com Fri Jul 19 23:53:34 2013 From: ronnie.ghose at gmail.com (Ronnie Ghose) Date: Fri, 19 Jul 2013 23:53:34 -0400 Subject: No subject Message-ID: how many errors are you getting from `make coverage` ? at the moment i'm getting: . . . . . . skimage.viewer.viewers.core 179 142 21% 26-29, 74-120, 124-139, 142-153, 157-161, 164-166, 176-194, 197, 200-205, 212-214, 217, 221, 225-239, 242, 246-247, 251, 254-257, 261-266, 298-310, 319-330, 338, 341-351 skimage.viewer.widgets 2 0 100% skimage.viewer.widgets.core 130 103 21% 33-37, 41-42, 45, 51-59, 63, 67, 99-165, 169-171, 175-186, 189, 192, 196-199, 203-205, 228-241, 247, 251, 255 skimage.viewer.widgets.history 70 52 26% 24-39, 42-44, 48, 55-72, 75-82, 85-92, 96-104 --------------------------------------------------------------------- TOTAL 3741 1338 64% ---------------------------------------------------------------------- Ran 243 tests in 4.576s FAILED (SKIP=17, errors=11) -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvertrumpet999 at gmail.com Sat Jul 20 18:52:21 2013 From: silvertrumpet999 at gmail.com (Josh Warner) Date: Sat, 20 Jul 2013 15:52:21 -0700 (PDT) Subject: No subject In-Reply-To: References: Message-ID: <37229d67-844b-4b1c-956a-cc8eeabd7a02@googlegroups.com> Run again with `make test` and copy the entire error report, please. That section at the end of coverage just tells us there were 11 errors, not where they came from or why. However, because so few tests were ran I'll go out on a limb and guess the Cython files are not compiled. Try `python build_ext -i` and then running `make test` again; if I'm right that would fix it. Regards, Josh On Friday, July 19, 2013 10:53:34 PM UTC-5, Ronnie Ghose wrote: > > how many errors are you getting from `make coverage` ? at the moment i'm > getting: > > . . . > . . . > skimage.viewer.viewers.core 179 142 21% 26-29, > 74-120, 124-139, 142-153, 157-161, 164-166, 176-194, 197, 200-205, 212-214, > 217, 221, 225-239, 242, 246-247, 251, 254-257, 261-266, 298-310, 319-330, > 338, 341-351 > skimage.viewer.widgets 2 0 100% > skimage.viewer.widgets.core 130 103 21% 33-37, > 41-42, 45, 51-59, 63, 67, 99-165, 169-171, 175-186, 189, 192, 196-199, > 203-205, 228-241, 247, 251, 255 > skimage.viewer.widgets.history 70 52 26% 24-39, > 42-44, 48, 55-72, 75-82, 85-92, 96-104 > --------------------------------------------------------------------- > TOTAL 3741 1338 64% > ---------------------------------------------------------------------- > Ran 243 tests in 4.576s > > FAILED (SKIP=17, errors=11) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvertrumpet999 at gmail.com Sat Jul 20 18:53:17 2013 From: silvertrumpet999 at gmail.com (Josh Warner) Date: Sat, 20 Jul 2013 15:53:17 -0700 (PDT) Subject: No subject In-Reply-To: <37229d67-844b-4b1c-956a-cc8eeabd7a02@googlegroups.com> References: <37229d67-844b-4b1c-956a-cc8eeabd7a02@googlegroups.com> Message-ID: <1f8d74e3-82b1-434b-85cb-667f101b2615@googlegroups.com> Correction, that should be `python setup.py build_ext -i`, run at package root. On Saturday, July 20, 2013 5:52:21 PM UTC-5, Josh Warner wrote: > > Run again with `make test` and copy the entire error report, please. That > section at the end of coverage just tells us there were 11 errors, not > where they came from or why. > > However, because so few tests were ran I'll go out on a limb and guess the > Cython files are not compiled. > > Try `python build_ext -i` and then running `make test` again; if I'm right > that would fix it. > > Regards, > Josh > > On Friday, July 19, 2013 10:53:34 PM UTC-5, Ronnie Ghose wrote: >> >> how many errors are you getting from `make coverage` ? at the moment i'm >> getting: >> >> . . . >> . . . >> skimage.viewer.viewers.core 179 142 21% 26-29, >> 74-120, 124-139, 142-153, 157-161, 164-166, 176-194, 197, 200-205, 212-214, >> 217, 221, 225-239, 242, 246-247, 251, 254-257, 261-266, 298-310, 319-330, >> 338, 341-351 >> skimage.viewer.widgets 2 0 100% >> skimage.viewer.widgets.core 130 103 21% 33-37, >> 41-42, 45, 51-59, 63, 67, 99-165, 169-171, 175-186, 189, 192, 196-199, >> 203-205, 228-241, 247, 251, 255 >> skimage.viewer.widgets.history 70 52 26% 24-39, >> 42-44, 48, 55-72, 75-82, 85-92, 96-104 >> --------------------------------------------------------------------- >> TOTAL 3741 1338 64% >> ---------------------------------------------------------------------- >> Ran 243 tests in 4.576s >> >> FAILED (SKIP=17, errors=11) >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.ghose at gmail.com Sat Jul 20 18:59:33 2013 From: ronnie.ghose at gmail.com (Ronnie Ghose) Date: Sat, 20 Jul 2013 18:59:33 -0400 Subject: No subject In-Reply-To: <1f8d74e3-82b1-434b-85cb-667f101b2615@googlegroups.com> References: <37229d67-844b-4b1c-956a-cc8eeabd7a02@googlegroups.com> <1f8d74e3-82b1-434b-85cb-667f101b2615@googlegroups.com> Message-ID: I'm pretty sure the cython files were not build - but let me try now; I used bentomaker install before though ... does compile the Cython files for you? On Sat, Jul 20, 2013 at 6:53 PM, Josh Warner wrote: > Correction, that should be `python setup.py build_ext -i`, run at package > root. > > > On Saturday, July 20, 2013 5:52:21 PM UTC-5, Josh Warner wrote: >> >> Run again with `make test` and copy the entire error report, please. That >> section at the end of coverage just tells us there were 11 errors, not >> where they came from or why. >> >> However, because so few tests were ran I'll go out on a limb and guess >> the Cython files are not compiled. >> >> Try `python build_ext -i` and then running `make test` again; if I'm >> right that would fix it. >> >> Regards, >> Josh >> >> On Friday, July 19, 2013 10:53:34 PM UTC-5, Ronnie Ghose wrote: >>> >>> how many errors are you getting from `make coverage` ? at the moment i'm >>> getting: >>> >>> . . . >>> . . . >>> skimage.viewer.viewers.core 179 142 21% 26-29, >>> 74-120, 124-139, 142-153, 157-161, 164-166, 176-194, 197, 200-205, 212-214, >>> 217, 221, 225-239, 242, 246-247, 251, 254-257, 261-266, 298-310, 319-330, >>> 338, 341-351 >>> skimage.viewer.widgets 2 0 100% >>> skimage.viewer.widgets.core 130 103 21% 33-37, >>> 41-42, 45, 51-59, 63, 67, 99-165, 169-171, 175-186, 189, 192, 196-199, >>> 203-205, 228-241, 247, 251, 255 >>> skimage.viewer.widgets.history 70 52 26% 24-39, >>> 42-44, 48, 55-72, 75-82, 85-92, 96-104 >>> ------------------------------**------------------------------** >>> --------- >>> TOTAL 3741 1338 64% >>> ------------------------------**------------------------------** >>> ---------- >>> Ran 243 tests in 4.576s >>> >>> FAILED (SKIP=17, errors=11) >>> >>> >>> -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.ghose at gmail.com Sat Jul 20 19:06:29 2013 From: ronnie.ghose at gmail.com (Ronnie Ghose) Date: Sat, 20 Jul 2013 19:06:29 -0400 Subject: No subject In-Reply-To: References: <37229d67-844b-4b1c-956a-cc8eeabd7a02@googlegroups.com> <1f8d74e3-82b1-434b-85cb-667f101b2615@googlegroups.com> Message-ID: Also I was wondering how many you guys were getting - i.e., did I forget to install a component... like i'm going to go add pyamg to the docs next. Actual Error Report: http://pastebin.com/3cSv50YC Thanks, Ronnie On Sat, Jul 20, 2013 at 6:59 PM, Ronnie Ghose wrote: > I'm pretty sure the cython files were not build - but let me try now; I > used bentomaker install before though ... does compile the Cython files for > you? > > > On Sat, Jul 20, 2013 at 6:53 PM, Josh Warner wrote: > >> Correction, that should be `python setup.py build_ext -i`, run at package >> root. >> >> >> On Saturday, July 20, 2013 5:52:21 PM UTC-5, Josh Warner wrote: >>> >>> Run again with `make test` and copy the entire error report, please. >>> That section at the end of coverage just tells us there were 11 errors, not >>> where they came from or why. >>> >>> However, because so few tests were ran I'll go out on a limb and guess >>> the Cython files are not compiled. >>> >>> Try `python build_ext -i` and then running `make test` again; if I'm >>> right that would fix it. >>> >>> Regards, >>> Josh >>> >>> On Friday, July 19, 2013 10:53:34 PM UTC-5, Ronnie Ghose wrote: >>>> >>>> how many errors are you getting from `make coverage` ? at the moment >>>> i'm getting: >>>> >>>> . . . >>>> . . . >>>> skimage.viewer.viewers.core 179 142 21% 26-29, >>>> 74-120, 124-139, 142-153, 157-161, 164-166, 176-194, 197, 200-205, 212-214, >>>> 217, 221, 225-239, 242, 246-247, 251, 254-257, 261-266, 298-310, 319-330, >>>> 338, 341-351 >>>> skimage.viewer.widgets 2 0 100% >>>> skimage.viewer.widgets.core 130 103 21% 33-37, >>>> 41-42, 45, 51-59, 63, 67, 99-165, 169-171, 175-186, 189, 192, 196-199, >>>> 203-205, 228-241, 247, 251, 255 >>>> skimage.viewer.widgets.history 70 52 26% 24-39, >>>> 42-44, 48, 55-72, 75-82, 85-92, 96-104 >>>> ------------------------------**------------------------------** >>>> --------- >>>> TOTAL 3741 1338 64% >>>> ------------------------------**------------------------------** >>>> ---------- >>>> Ran 243 tests in 4.576s >>>> >>>> FAILED (SKIP=17, errors=11) >>>> >>>> >>>> -- >> You received this message because you are subscribed to the Google Groups >> "scikit-image" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to scikit-image+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.ghose at gmail.com Sun Jul 21 00:30:00 2013 From: ronnie.ghose at gmail.com (Ronnie Ghose) Date: Sun, 21 Jul 2013 00:30:00 -0400 Subject: Contiguous Array Message-ID: So in skimage/colors why does it matter if the array is contiguous? Is this for Cython operations later? Thanks, Ronnie -------------- next part -------------- An HTML attachment was scrubbed... URL: From alimuldal at gmail.com Sun Jul 21 11:20:03 2013 From: alimuldal at gmail.com (Alistair Muldal) Date: Sun, 21 Jul 2013 08:20:03 -0700 (PDT) Subject: Issue with skimage.transform.warp - 'numpy.float64' object cannot be interpreted as an index Message-ID: <61182346-c6da-4abe-b000-af753d52eb17@googlegroups.com> Hi all, I've been using skimage.transform.warp to apply affine transformations to a series of movie frames, using this wrapper function: def applytform(img,tmat,**kwargs): """ A wrapper to call skimage.transform.warp for fast similarity transformations. Also returns the mask of the transformed image (a boolean array, True only in pixels containing the transformed image). All keyword arguments are passed directly to warp. """ # warp needs floating point images -1.0 <= I <= 1.0 origtype, imin, imax = img.dtype, img.min(), img.max() tmpimg = (np.float64(img) - imin) / (imax-imin) # tmpimg = np.require(tmpimg,np.float32,'CAOW') # tmat = np.require(tmat,np.float32,'CAOW') # construct a callable transform object, apply it using warp s = SimilarityTransform(matrix=tmat) # import ipdb;ipdb.set_trace() tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) mask = ~np.isnan(tmpimg) tmpimg[~mask] = 0. # convert back to original scaling and type img = tmpimg*imax + imin img = img.astype(origtype) return img,mask I've had no problems using skimage v0.7.1, but I've recently tried updating to v0.8.2 and now the same code gives me this error: /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in applytform(img, tmat, **kwar gs) 50 s = SimilarityTransform(matrix=tmat) 51 # import ipdb;ipdb.set_trace() ---> 52 tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) 53 mask = ~np.isnan(tmpimg) 54 tmpimg[~mask] = 0. /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc in warp(image, inverse_map, map_args, output_shape, order, mode, cval, reverse_map) 989 dims.append(_warp_fast(image[..., dim], matrix, 990 output_shape=output_shape, --> 991 order=order, mode=mode, cval=cval)) 992 out = np.dstack(dims) 993 if orig_ndim == 2: /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so i n skimage.transform._warps_cy._warp_fast (skimage/transform/_warps_cy.c:1636)() TypeError: 'numpy.float64' object cannot be interpreted as an index I've tried casting the image and the transformation matrix to np.float32, but this gave me a different error: /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in applytform(img, tmat, **kwargs) 50 s = SimilarityTransform(matrix=tmat) 51 # import ipdb;ipdb.set_trace() ---> 52 tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) 53 mask = ~np.isnan(tmpimg) 54 tmpimg[~mask] = 0. /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc in warp(image, inverse_map, map_args, output_shape, order, mode, cval, reverse_map) 989 dims.append(_warp_fast(image[..., dim], matrix, 990 output_shape=output_shape, --> 991 order=order, mode=mode, cval=cval)) 992 out = np.dstack(dims) 993 if orig_ndim == 2: /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so in skimage.transform._warps_cy._warp_fast (skimage/transform/_warps_cy.c:1505)() ValueError: Buffer dtype mismatch, expected 'double_t' but got 'float' Any idea what's going on here? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Sun Jul 21 00:37:47 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Sun, 21 Jul 2013 10:07:47 +0530 Subject: Contiguous Array In-Reply-To: References: Message-ID: Hi Ronnie, On Jul 21, 2013 10:00 AM, "Ronnie Ghose" wrote: > > So in skimage/colors why does it matter if the array is contiguous? Is this for Cython operations later? > Yeah it is mainly for using memory views in Cython which is initialized as C contiguous. `cdef some_type[:. ::1] var_name` In thus case ::1 is for C contiguous. Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From marianne.corvellec at ens-lyon.org Sun Jul 21 14:40:11 2013 From: marianne.corvellec at ens-lyon.org (Marianne Corvellec) Date: Sun, 21 Jul 2013 11:40:11 -0700 (PDT) Subject: How to get a region chain code? In-Reply-To: References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Message-ID: Hello, On Tuesday, July 16, 2013 4:46:28 AM UTC-4, Stefan van der Walt wrote: > > This is the third time in about a month that we have the need to determine > geometric properties of regions. The right solution here is to build a > region graph, like I described in the ticket (sorry, I can't check the > number from my phone right now). > I guess this one: https://github.com/scikit-image/scikit-image/issues/622 Marianne -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Sun Jul 21 12:47:11 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Sun, 21 Jul 2013 11:47:11 -0500 Subject: Cython help: Time taken to execute a function (profiling) changes drastically depending on image size In-Reply-To: References: Message-ID: On Sun, Jul 21, 2013 at 4:45 AM, Chintak Sheth wrote: > Hi, > > I am writing the code for Image inpainting using Fast Marching Method. > After writing the initial implementation in Python, I am now cythonising > parts of the code [1]. After profiling, the majority of the time is taken > by the 3 function in [2]. In particular, even after cythonizing, > `inpaint_point` takes the majority of the time. > > The results of profiling for 2 different image sizes are here > http://pastebin.com/aTY1bbn6. The first result is for image size of > 100X100 and the second one for 512X512. The mask size which I use is > constant for both cases. So, the number of function calls to > `inpaint_point` for both are the same as can be seem in the profiling > result. > > Still why do I get such a drastic time difference in the 2 cases ? Any > ideas, what I am missing here or doing inefficiently ? > Having different Cython functions using different copies of your data (i.e. one version as uint8, one as float) seems like a bad idea. And making that copy inside of a loop is probably killing performance: https://github.com/chintak/scikit-image/blob/inpaint/skimage/inpaint/_inpaint.pyx#L179 > Chintak > > [1] https://github.com/chintak/scikit-image/tree/inpaint/skimage/inpaint > > [2] > https://github.com/chintak/scikit-image/blob/inpaint/skimage/inpaint/_inpaint.pyx > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Sun Jul 21 05:45:24 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Sun, 21 Jul 2013 15:15:24 +0530 Subject: Cython help: Time taken to execute a function (profiling) changes drastically depending on image size Message-ID: Hi, I am writing the code for Image inpainting using Fast Marching Method. After writing the initial implementation in Python, I am now cythonising parts of the code [1]. After profiling, the majority of the time is taken by the 3 function in [2]. In particular, even after cythonizing, `inpaint_point` takes the majority of the time. The results of profiling for 2 different image sizes are here http://pastebin.com/aTY1bbn6. The first result is for image size of 100X100 and the second one for 512X512. The mask size which I use is constant for both cases. So, the number of function calls to `inpaint_point` for both are the same as can be seem in the profiling result. Still why do I get such a drastic time difference in the 2 cases ? Any ideas, what I am missing here or doing inefficiently ? Chintak [1] https://github.com/chintak/scikit-image/tree/inpaint/skimage/inpaint [2] https://github.com/chintak/scikit-image/blob/inpaint/skimage/inpaint/_inpaint.pyx -------------- next part -------------- An HTML attachment was scrubbed... URL: From alimuldal at gmail.com Sun Jul 21 18:33:35 2013 From: alimuldal at gmail.com (Alistair Muldal) Date: Sun, 21 Jul 2013 15:33:35 -0700 (PDT) Subject: Issue with skimage.transform.warp - 'numpy.float64' object cannot be interpreted as an index In-Reply-To: <5606E47B-2A15-4FF8-99A7-358DD5340A7B@demuc.de> References: <61182346-c6da-4abe-b000-af753d52eb17@googlegroups.com> <5606E47B-2A15-4FF8-99A7-358DD5340A7B@demuc.de> Message-ID: Hi Johannes, Spot on - I was indeed computing the output_shape as a tuple of floats rather than integers, and casting them to ints fixed the problem. I'm a bit surprised it actually worked in v0.7.1! Cheers, Alistair On Sunday, July 21, 2013 10:17:14 PM UTC+1, Johannes Sch?nberger wrote: > > Hi, > > does the **kwargs contain the output_shape? > > Make sure that the the values are integers: `output_shape = (int(rows), > int(cols))`. > > Johannes Sch?nberger > > Am 21.07.2013 um 17:20 schrieb Alistair Muldal >: > > > > Hi all, > > > > I've been using skimage.transform.warp to apply affine transformations > to a series of movie frames, using this wrapper function: > > > > def applytform(img,tmat,**kwargs): > > """ > > A wrapper to call skimage.transform.warp for fast similarity > > transformations. Also returns the mask of the transformed image (a > > boolean array, True only in pixels containing the transformed > image). > > All keyword arguments are passed directly to warp. > > """ > > > > # warp needs floating point images -1.0 <= I <= 1.0 > > origtype, imin, imax = img.dtype, img.min(), img.max() > > tmpimg = (np.float64(img) - imin) / (imax-imin) > > > > # tmpimg = np.require(tmpimg,np.float32,'CAOW') > > # tmat = np.require(tmat,np.float32,'CAOW') > > > > # construct a callable transform object, apply it using warp > > s = SimilarityTransform(matrix=tmat) > > # import ipdb;ipdb.set_trace() > > tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > > mask = ~np.isnan(tmpimg) > > tmpimg[~mask] = 0. > > > > # convert back to original scaling and type > > img = tmpimg*imax + imin > > img = img.astype(origtype) > > > > return img,mask > > > > I've had no problems using skimage v0.7.1, but I've recently tried > updating to v0.8.2 and now the same code gives me this error: > > > > /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in > applytform(img, tmat, **kwar > > gs) > > 50 s = SimilarityTransform(matrix=tmat) > > 51 # import ipdb;ipdb.set_trace() > > ---> 52 tmpimg = > warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > > 53 mask = ~np.isnan(tmpimg) > > 54 tmpimg[~mask] = 0. > > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc > > > in warp(image, inverse_map, map_args, output_shape, order, mode, cval, > reverse_map) > > 989 dims.append(_warp_fast(image[..., dim], matrix, > > 990 output_shape=output_shape, > > --> 991 order=order, mode=mode, cval=cval)) > > 992 out = np.dstack(dims) > > 993 if orig_ndim == 2: > > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so > i > > n skimage.transform._warps_cy._warp_fast > (skimage/transform/_warps_cy.c:1636)() > > > > TypeError: 'numpy.float64' object cannot be interpreted as an index > > > > I've tried casting the image and the transformation matrix to > np.float32, but this gave me a different error: > > > > /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in > applytform(img, tmat, **kwargs) > > 50 s = SimilarityTransform(matrix=tmat) > > 51 # import ipdb;ipdb.set_trace() > > ---> 52 tmpimg = > warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > > 53 mask = ~np.isnan(tmpimg) > > 54 tmpimg[~mask] = 0. > > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc > in warp(image, inverse_map, map_args, output_shape, order, mode, cval, > reverse_map) > > 989 dims.append(_warp_fast(image[..., dim], matrix, > > 990 output_shape=output_shape, > > --> 991 order=order, mode=mode, cval=cval)) > > 992 out = np.dstack(dims) > > 993 if orig_ndim == 2: > > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so > in skimage.transform._warps_cy._warp_fast > (skimage/transform/_warps_cy.c:1505)() > > > > ValueError: Buffer dtype mismatch, expected 'double_t' but got 'float' > > > > Any idea what's going on here? > > > > -- > > You received this message because you are subscribed to the Google > Groups "scikit-image" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to scikit-image... at googlegroups.com . > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Sun Jul 21 16:22:18 2013 From: stefan at sun.ac.za (=?iso-8859-1?Q?St=E9fan?= van der Walt) Date: Sun, 21 Jul 2013 22:22:18 +0200 Subject: How to get a region chain code? In-Reply-To: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> Message-ID: <20130721202218.GA13488@shinobi> Hi Valeriy On Sat, 13 Jul 2013 02:58:33 -0700, Valeriy Sokolov wrote: > I am studying a shape descriptors and would like to compute a chain code > description of a labeled shape. I was trying to look into docs but have not > find a direct way to get this region property with skimage. Is there any > way to do it in a few calls which I missed? Unfortunately, we do not currently have any chain codes. If you'd like to write it yourself, we could give a hand with that (depending on the speed you need, it should not be too hard). Otherwise, a longer term plan would be to implement the connectivity graph Marianne referred to. St??????fan From jschoenberger at demuc.de Sun Jul 21 17:17:14 2013 From: jschoenberger at demuc.de (=?iso-8859-1?Q?Johannes_Sch=F6nberger?=) Date: Sun, 21 Jul 2013 23:17:14 +0200 Subject: Issue with skimage.transform.warp - 'numpy.float64' object cannot be interpreted as an index In-Reply-To: <61182346-c6da-4abe-b000-af753d52eb17@googlegroups.com> References: <61182346-c6da-4abe-b000-af753d52eb17@googlegroups.com> Message-ID: <5606E47B-2A15-4FF8-99A7-358DD5340A7B@demuc.de> Hi, does the **kwargs contain the output_shape? Make sure that the the values are integers: `output_shape = (int(rows), int(cols))`. Johannes Sch?nberger Am 21.07.2013 um 17:20 schrieb Alistair Muldal : > Hi all, > > I've been using skimage.transform.warp to apply affine transformations to a series of movie frames, using this wrapper function: > > def applytform(img,tmat,**kwargs): > """ > A wrapper to call skimage.transform.warp for fast similarity > transformations. Also returns the mask of the transformed image (a > boolean array, True only in pixels containing the transformed image). > All keyword arguments are passed directly to warp. > """ > > # warp needs floating point images -1.0 <= I <= 1.0 > origtype, imin, imax = img.dtype, img.min(), img.max() > tmpimg = (np.float64(img) - imin) / (imax-imin) > > # tmpimg = np.require(tmpimg,np.float32,'CAOW') > # tmat = np.require(tmat,np.float32,'CAOW') > > # construct a callable transform object, apply it using warp > s = SimilarityTransform(matrix=tmat) > # import ipdb;ipdb.set_trace() > tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > mask = ~np.isnan(tmpimg) > tmpimg[~mask] = 0. > > # convert back to original scaling and type > img = tmpimg*imax + imin > img = img.astype(origtype) > > return img,mask > > I've had no problems using skimage v0.7.1, but I've recently tried updating to v0.8.2 and now the same code gives me this error: > > /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in applytform(img, tmat, **kwar > gs) > 50 s = SimilarityTransform(matrix=tmat) > 51 # import ipdb;ipdb.set_trace() > ---> 52 tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > 53 mask = ~np.isnan(tmpimg) > 54 tmpimg[~mask] = 0. > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc > in warp(image, inverse_map, map_args, output_shape, order, mode, cval, reverse_map) > 989 dims.append(_warp_fast(image[..., dim], matrix, > 990 output_shape=output_shape, > --> 991 order=order, mode=mode, cval=cval)) > 992 out = np.dstack(dims) > 993 if orig_ndim == 2: > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so i > n skimage.transform._warps_cy._warp_fast (skimage/transform/_warps_cy.c:1636)() > > TypeError: 'numpy.float64' object cannot be interpreted as an index > > I've tried casting the image and the transformation matrix to np.float32, but this gave me a different error: > > /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in applytform(img, tmat, **kwargs) > 50 s = SimilarityTransform(matrix=tmat) > 51 # import ipdb;ipdb.set_trace() > ---> 52 tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > 53 mask = ~np.isnan(tmpimg) > 54 tmpimg[~mask] = 0. > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc in warp(image, inverse_map, map_args, output_shape, order, mode, cval, reverse_map) > 989 dims.append(_warp_fast(image[..., dim], matrix, > 990 output_shape=output_shape, > --> 991 order=order, mode=mode, cval=cval)) > 992 out = np.dstack(dims) > 993 if orig_ndim == 2: > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so in skimage.transform._warps_cy._warp_fast (skimage/transform/_warps_cy.c:1505)() > > ValueError: Buffer dtype mismatch, expected 'double_t' but got 'float' > > Any idea what's going on here? > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From jschoenberger at demuc.de Mon Jul 22 01:04:10 2013 From: jschoenberger at demuc.de (=?iso-8859-1?Q?Johannes_Sch=F6nberger?=) Date: Mon, 22 Jul 2013 07:04:10 +0200 Subject: Issue with skimage.transform.warp - 'numpy.float64' object cannot be interpreted as an index In-Reply-To: References: <61182346-c6da-4abe-b000-af753d52eb17@googlegroups.com> <5606E47B-2A15-4FF8-99A7-358DD5340A7B@demuc.de> Message-ID: We changed the C type of variables internally between 0.7 and 0.8, so not your fault :-) Johannes Sch?nberger Am 22.07.2013 um 00:33 schrieb Alistair Muldal : > Hi Johannes, > > Spot on - I was indeed computing the output_shape as a tuple of floats rather than integers, and casting them to ints fixed the problem. I'm a bit surprised it actually worked in v0.7.1! > > Cheers, > > Alistair > > On Sunday, July 21, 2013 10:17:14 PM UTC+1, Johannes Sch?nberger wrote: > Hi, > > does the **kwargs contain the output_shape? > > Make sure that the the values are integers: `output_shape = (int(rows), int(cols))`. > > Johannes Sch?nberger > > Am 21.07.2013 um 17:20 schrieb Alistair Muldal : > > > Hi all, > > > > I've been using skimage.transform.warp to apply affine transformations to a series of movie frames, using this wrapper function: > > > > def applytform(img,tmat,**kwargs): > > """ > > A wrapper to call skimage.transform.warp for fast similarity > > transformations. Also returns the mask of the transformed image (a > > boolean array, True only in pixels containing the transformed image). > > All keyword arguments are passed directly to warp. > > """ > > > > # warp needs floating point images -1.0 <= I <= 1.0 > > origtype, imin, imax = img.dtype, img.min(), img.max() > > tmpimg = (np.float64(img) - imin) / (imax-imin) > > > > # tmpimg = np.require(tmpimg,np.float32,'CAOW') > > # tmat = np.require(tmat,np.float32,'CAOW') > > > > # construct a callable transform object, apply it using warp > > s = SimilarityTransform(matrix=tmat) > > # import ipdb;ipdb.set_trace() > > tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > > mask = ~np.isnan(tmpimg) > > tmpimg[~mask] = 0. > > > > # convert back to original scaling and type > > img = tmpimg*imax + imin > > img = img.astype(origtype) > > > > return img,mask > > > > I've had no problems using skimage v0.7.1, but I've recently tried updating to v0.8.2 and now the same code gives me this error: > > > > /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in applytform(img, tmat, **kwar > > gs) > > 50 s = SimilarityTransform(matrix=tmat) > > 51 # import ipdb;ipdb.set_trace() > > ---> 52 tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > > 53 mask = ~np.isnan(tmpimg) > > 54 tmpimg[~mask] = 0. > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc > > in warp(image, inverse_map, map_args, output_shape, order, mode, cval, reverse_map) > > 989 dims.append(_warp_fast(image[..., dim], matrix, > > 990 output_shape=output_shape, > > --> 991 order=order, mode=mode, cval=cval)) > > 992 out = np.dstack(dims) > > 993 if orig_ndim == 2: > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so i > > n skimage.transform._warps_cy._warp_fast (skimage/transform/_warps_cy.c:1636)() > > > > TypeError: 'numpy.float64' object cannot be interpreted as an index > > > > I've tried casting the image and the transformation matrix to np.float32, but this gave me a different error: > > > > /home/alistair/src/python/ca_tadpoles2/opt/d/imtransform3.pyc in applytform(img, tmat, **kwargs) > > 50 s = SimilarityTransform(matrix=tmat) > > 51 # import ipdb;ipdb.set_trace() > > ---> 52 tmpimg = warp(tmpimg,s.inverse,mode='constant',cval=np.nan,**kwargs) > > 53 mask = ~np.isnan(tmpimg) > > 54 tmpimg[~mask] = 0. > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_geometric.pyc in warp(image, inverse_map, map_args, output_shape, order, mode, cval, reverse_map) > > 989 dims.append(_warp_fast(image[..., dim], matrix, > > 990 output_shape=output_shape, > > --> 991 order=order, mode=mode, cval=cval)) > > 992 out = np.dstack(dims) > > 993 if orig_ndim == 2: > > > > /home/alistair/.venvs/newskimage/lib/python2.7/site-packages/skimage/transform/_warps_cy.so in skimage.transform._warps_cy._warp_fast (skimage/transform/_warps_cy.c:1505)() > > > > ValueError: Buffer dtype mismatch, expected 'double_t' but got 'float' > > > > Any idea what's going on here? > > > > -- > > You received this message because you are subscribed to the Google Groups "scikit-image" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image... at googlegroups.com. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From tsyu80 at gmail.com Tue Jul 23 10:10:14 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Tue, 23 Jul 2013 09:10:14 -0500 Subject: Welcome to the core team, @jni! In-Reply-To: References: Message-ID: Congratulations, Juan. It's great to have you on the team! On Tue, Jul 23, 2013 at 8:00 AM, Juan Nunez-Iglesias wrote: > Woot! Thank you. It's great to be here. I love the project and the team. > > > On Tue, Jul 23, 2013 at 9:29 PM, St?fan van der Walt wrote: > >> Dear all, >> >> It gives me great pleasure to welcome Juan Nunez-Iglesias to the core >> skimage team! Juan certainly earned his way by suffering through many >> of our most nit picky reviews, and through his excellent >> contributions, including the recent N-d extension to SLIC >> segmentation. >> >> Juan, it's great to have you on board. >> >> St?fan >> >> -- >> You received this message because you are subscribed to the Google Groups >> "scikit-image" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to scikit-image+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Tue Jul 23 07:29:26 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Tue, 23 Jul 2013 13:29:26 +0200 Subject: Welcome to the core team, @jni! Message-ID: Dear all, It gives me great pleasure to welcome Juan Nunez-Iglesias to the core skimage team! Juan certainly earned his way by suffering through many of our most nit picky reviews, and through his excellent contributions, including the recent N-d extension to SLIC segmentation. Juan, it's great to have you on board. St?fan From jni.soma at gmail.com Tue Jul 23 09:00:25 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 23 Jul 2013 23:00:25 +1000 Subject: Welcome to the core team, @jni! In-Reply-To: References: Message-ID: Woot! Thank you. It's great to be here. I love the project and the team. On Tue, Jul 23, 2013 at 9:29 PM, St?fan van der Walt wrote: > Dear all, > > It gives me great pleasure to welcome Juan Nunez-Iglesias to the core > skimage team! Juan certainly earned his way by suffering through many > of our most nit picky reviews, and through his excellent > contributions, including the recent N-d extension to SLIC > segmentation. > > Juan, it's great to have you on board. > > St?fan > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From praks.putchala at gmail.com Fri Jul 26 09:13:55 2013 From: praks.putchala at gmail.com (Ravi Prakash) Date: Fri, 26 Jul 2013 06:13:55 -0700 (PDT) Subject: Error executing plot_circular_hough_transform.py Message-ID: <1e2d1614-35d1-4f6f-9aa2-49b89cb8045d@googlegroups.com> Hi, When I execute plot_circular_hough_transform.py it gives the following error: Traceback (most recent call last): File "plot_circular_hough_transform.py", line 69, in image[cy, cx] = (220, 20, 20) IndexError: index 102 is out of bounds for axis 0 with size 95 I am at version skimage 0.8.2, Python 2.7.2+, os: Linux Mint 12 Lisa. Could you please help me execute this? Please let me know if you need more information about my execution environment. Thank you. Ravi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoenberger at demuc.de Fri Jul 26 02:46:33 2013 From: jschoenberger at demuc.de (=?iso-8859-1?Q?Johannes_Sch=F6nberger?=) Date: Fri, 26 Jul 2013 06:46:33 +0000 Subject: Welcome to the core team, @jni! In-Reply-To: References: Message-ID: <7A3AEF75-E317-4CF4-B07D-25F5F304FFFF@demuc.de> Hi, Sorry for the delayed welcome from my side... Great to have you in the team! Johannes Sch?nberger Am 23.07.2013 um 13:29 schrieb "St?fan van der Walt" : > Dear all, > > It gives me great pleasure to welcome Juan Nunez-Iglesias to the core > skimage team! Juan certainly earned his way by suffering through many > of our most nit picky reviews, and through his excellent > contributions, including the recent N-d extension to SLIC > segmentation. > > Juan, it's great to have you on board. > > St?fan > > -- > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > From littlemumford at gmail.com Fri Jul 26 11:18:19 2013 From: littlemumford at gmail.com (Stuart Mumford) Date: Fri, 26 Jul 2013 08:18:19 -0700 (PDT) Subject: How to get a region chain code? In-Reply-To: <20130721202218.GA13488@shinobi> References: <1ebae76c-b375-4080-988d-096c2e918801@googlegroups.com> <20130721202218.GA13488@shinobi> Message-ID: Hello, Chain code extraction would be quite a cool feature for SunPy as well. We have a basic implementation for handling specified chain codes, though it needs work!! https://github.com/sunpy/sunpy/tree/master/sunpy/roi Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Fri Jul 26 09:51:52 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Fri, 26 Jul 2013 15:51:52 +0200 Subject: Error executing plot_circular_hough_transform.py In-Reply-To: <1e2d1614-35d1-4f6f-9aa2-49b89cb8045d@googlegroups.com> References: <1e2d1614-35d1-4f6f-9aa2-49b89cb8045d@googlegroups.com> Message-ID: Hi Ravi On Fri, Jul 26, 2013 at 3:13 PM, Ravi Prakash wrote: > Traceback (most recent call last): > File "plot_circular_hough_transform.py", line 69, in > image[cy, cx] = (220, 20, 20) > IndexError: index 102 is out of bounds for axis 0 with size 95 > > I am at version skimage 0.8.2, Python 2.7.2+, os: Linux Mint 12 Lisa. Could you try with the latest version from GitHub? It might have been a bug in 0.8.2. St?fan From tsyu80 at gmail.com Fri Jul 26 20:40:50 2013 From: tsyu80 at gmail.com (Tony Yu) Date: Fri, 26 Jul 2013 19:40:50 -0500 Subject: Error executing plot_circular_hough_transform.py In-Reply-To: References: <1e2d1614-35d1-4f6f-9aa2-49b89cb8045d@googlegroups.com> Message-ID: On Jul 26, 2013 8:52 AM, "St?fan van der Walt" wrote: > > Hi Ravi > > On Fri, Jul 26, 2013 at 3:13 PM, Ravi Prakash wrote: > > Traceback (most recent call last): > > File "plot_circular_hough_transform.py", line 69, in > > image[cy, cx] = (220, 20, 20) > > IndexError: index 102 is out of bounds for axis 0 with size 95 > > > > I am at version skimage 0.8.2, Python 2.7.2+, os: Linux Mint 12 Lisa. > > Could you try with the latest version from GitHub? It might have been > a bug in 0.8.2. > > St?fan > > -- Just to expand on Stefan's reply: the old implementation (0.8) searched for any part of the circle in the image, so the center could as much as "r" outside the image. You can convert the 0.8 result to the 0.9 result with hough_result = hough_result[r:-r, r:-r] Best, Tony > You received this message because you are subscribed to the Google Groups "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From praks.putchala at gmail.com Sat Jul 27 02:58:50 2013 From: praks.putchala at gmail.com (Ravi Prakash) Date: Fri, 26 Jul 2013 23:58:50 -0700 (PDT) Subject: Error executing plot_circular_hough_transform.py In-Reply-To: References: <1e2d1614-35d1-4f6f-9aa2-49b89cb8045d@googlegroups.com> Message-ID: Hi St?fan, I tried with the latest version. It worked fine. Thank you. Hi Tony, I did not understand what r's value should be. Could you please elaborate? I am new to skikit-image as well as numpy. Ravi On Saturday, July 27, 2013 6:10:50 AM UTC+5:30, Tony S Yu wrote: > > > On Jul 26, 2013 8:52 AM, "St?fan van der Walt" > > wrote: > > > > Hi Ravi > > > > On Fri, Jul 26, 2013 at 3:13 PM, Ravi Prakash > > wrote: > > > Traceback (most recent call last): > > > File "plot_circular_hough_transform.py", line 69, in > > > image[cy, cx] = (220, 20, 20) > > > IndexError: index 102 is out of bounds for axis 0 with size 95 > > > > > > I am at version skimage 0.8.2, Python 2.7.2+, os: Linux Mint 12 Lisa. > > > > Could you try with the latest version from GitHub? It might have been > > a bug in 0.8.2. > > > > St?fan > > > > -- > > Just to expand on Stefan's reply: the old implementation (0.8) searched > for any part of the circle in the image, so the center could as much as "r" > outside the image. You can convert the 0.8 result to the 0.9 result with > > hough_result = hough_result[r:-r, r:-r] > > Best, > Tony > > > You received this message because you are subscribed to the Google > Groups "scikit-image" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to scikit-image... at googlegroups.com . > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From boulogne.f at gmail.com Sat Jul 27 13:35:09 2013 From: boulogne.f at gmail.com (boulogne.f at gmail.com) Date: Sat, 27 Jul 2013 10:35:09 -0700 (PDT) Subject: euroscipy sprint In-Reply-To: <20130727144750.GB26247@phare.normalesup.org> References: <20130727144750.GB26247@phare.normalesup.org> Message-ID: <953b2f35-260d-4869-a2b7-208be2d9cd94@googlegroups.com> I hope I'll be there too. :) Fran?ois. -- Fran?ois Boulogne.http://www.sciunto.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmanuelle.gouillart at nsup.org Sat Jul 27 10:47:50 2013 From: emmanuelle.gouillart at nsup.org (Emmanuelle Gouillart) Date: Sat, 27 Jul 2013 16:47:50 +0200 Subject: euroscipy sprint Message-ID: <20130727144750.GB26247@phare.normalesup.org> Hi all, do we plan to have a scikit-image sprint at Euroscipy in Brussels? There is one day for sprints, Sunday August 25. I'll be there! Anyone else? Cheers, Emmanuelle From praks.putchala at gmail.com Sun Jul 28 00:04:49 2013 From: praks.putchala at gmail.com (Ravi Prakash) Date: Sat, 27 Jul 2013 21:04:49 -0700 (PDT) Subject: Error executing plot_circular_hough_transform.py In-Reply-To: <51F42A9B.60806@sciunto.org> References: <1e2d1614-35d1-4f6f-9aa2-49b89cb8045d@googlegroups.com> <51F42A9B.60806@sciunto.org> Message-ID: <814c3ad6-8c0d-4b5b-869f-f9a4948b9af7@googlegroups.com> Thank you, Fran?ois. Got it. Ravi On Sunday, July 28, 2013 1:46:27 AM UTC+5:30, Fran?ois Boulogne wrote: > > Le 27/07/2013 08:58, Ravi Prakash a ?crit : > > Hi St?fan, > > > > I tried with the latest version. It worked fine. Thank you. > > > > Hi Tony, > > > > I did not understand what r's value should be. Could you please > > elaborate? I am new to skikit-image as well as numpy. > > > > > r is the larger radius you pass to the function. In the first > implementation, it looks for centers everywhere it is possible. You can > imagine you have a arc near an edge, the center is 'outside' the frame. > If I remember correctly, we changed the API such that this behaviour is > not the default one (because the resulting picture has not the same > size as the original, but size + 2r), and that's confusing. And I > remember I also fixed a bug, but I can't remember if it was before the > release or not. I must check the log. > > > > -- > Fran?ois Boulogne. > http://www.sciunto.org > GPG fingerprint: 25F6 C971 4875 A6C1 EDD1 75C8 1AA7 216E 32D5 F22F > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fboulogne at sciunto.org Sat Jul 27 16:16:27 2013 From: fboulogne at sciunto.org (=?ISO-8859-1?Q?Fran=E7ois_Boulogne?=) Date: Sat, 27 Jul 2013 22:16:27 +0200 Subject: Error executing plot_circular_hough_transform.py In-Reply-To: References: <1e2d1614-35d1-4f6f-9aa2-49b89cb8045d@googlegroups.com> Message-ID: <51F42A9B.60806@sciunto.org> Le 27/07/2013 08:58, Ravi Prakash a ?crit : > Hi St?fan, > > I tried with the latest version. It worked fine. Thank you. > > Hi Tony, > > I did not understand what r's value should be. Could you please > elaborate? I am new to skikit-image as well as numpy. > > r is the larger radius you pass to the function. In the first implementation, it looks for centers everywhere it is possible. You can imagine you have a arc near an edge, the center is 'outside' the frame. If I remember correctly, we changed the API such that this behaviour is not the default one (because the resulting picture has not the same size as the original, but size + 2r), and that's confusing. And I remember I also fixed a bug, but I can't remember if it was before the release or not. I must check the log. -- Fran?ois Boulogne. http://www.sciunto.org GPG fingerprint: 25F6 C971 4875 A6C1 EDD1 75C8 1AA7 216E 32D5 F22F From jostein.floystad at gmail.com Sun Jul 28 12:49:40 2013 From: jostein.floystad at gmail.com (jostein.floystad at gmail.com) Date: Sun, 28 Jul 2013 09:49:40 -0700 (PDT) Subject: Request for review: #654 Message-ID: Dear core devs, I'd like to ask for review on this PR, https://github.com/scikit-image/scikit-image/pull/654 which will hopefully finish the clean-up of the Radon transform module. Kind regards, Jostein -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Sun Jul 28 10:35:41 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 29 Jul 2013 00:35:41 +1000 Subject: euroscipy sprint In-Reply-To: <953b2f35-260d-4869-a2b7-208be2d9cd94@googlegroups.com> References: <20130727144750.GB26247@phare.normalesup.org> <953b2f35-260d-4869-a2b7-208be2d9cd94@googlegroups.com> Message-ID: Yep, I'm in! =D On Sun, Jul 28, 2013 at 3:35 AM, wrote: > I hope I'll be there too. :) > > Fran?ois. > > > -- > Fran?ois Boulogne.http://www.sciunto.org > > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Tue Jul 30 16:23:39 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Tue, 30 Jul 2013 22:23:39 +0200 Subject: Blog updated In-Reply-To: References: Message-ID: Hi Chintak On Tue, Jul 30, 2013 at 10:12 PM, Chintak Sheth wrote: > https://chintaksheth.wordpress.com/2013/07/31/numpy-the-tricks-of-the-trade-part-ii/ The part about einsum is really nice! I propose we add a nice comment in the code (of your PR) to explain what's happening on that einsum line, because most people won't have a clue :) You can often write einsum as some operation + a reduction over one or more axes. Can this operation be expressed in both ways? If so, which do you find to be more readable and understandable? Thanks! St?fan From emmanuelle.gouillart at nsup.org Tue Jul 30 16:50:16 2013 From: emmanuelle.gouillart at nsup.org (Emmanuelle Gouillart) Date: Tue, 30 Jul 2013 22:50:16 +0200 Subject: random walker segmentation Message-ID: <20130730205016.GA27240@phare.normalesup.org> Hello, a while ago, I contributed to skimage an implementation of the random walker segmentation algorithm (which has been improved and extended by many others since then). This algorithm computes a multilabel segmentation using seeds (already labeled pixels), by determining for an unlabeled pixel the probability that a seed diffuses to the pixel (with an anisotropic diffusion coefficient depending on the gradient between neighboring pixels). In the current implementation in skimage, the computation of the probability map is done by inverting a large sparse linear system (involving the Laplacian of the graph of pixels). Different methods can be chosen to solve the linear system: a brute force inversion only works for tiny images; a conjugate gradient method works well but is quite slow. If the package pyamg is available, a multigrid method is used to compute a preconditioner, which speeds up the algorithm -- but it requires pyamg. Also, the memory cost of the algorithm is important (linear, I think, though. I haven't yet taken the time to use a memory profiler but I should). Recently, a colleague brought to my attention that the linear system was just a set of fixed-point equations, that could be solved iteratively. Indeed, the solution verifies that the probability of a pixel is the weighted sum (with weights on edges that are a decreasing function of gradients) of the probabilities of its neighbors. I have written a quick and dirty implementation (only for 2-D grayscale images and for 2 labels) of this "local" version, available on https://github.com/emmanuelle/scikits.image/blob/local_random_walker/skimage/segmentation/local_random_walker.py It turns out that this implementation is slower than the conjugate gradient with multigrid acceleration (typically 2 to three times slower), but it has several advantages. First, it can be as fast as the "simple" conjugate gradient (without pyamg's muligrid acceleration), which is the mode that most users will use (we don't expect users to install pymag when they are just trying out algorithms). Second, its memory cost is lower (for example, the weight of an edge is stored only once, while it appears twice in the Laplacian matrix). Finally, because the operations only involve neighboring pixels, it is possible that further speed optimization can be done (using cython... or maybe a GPU implementation, even if we're not that far yet with skimage). So, should we replace the linear algebra implementation with this simpler local and iterative implementation ? I'd be interested in knowing about your opinion. Cheers, Emmanuelle From deklerkmc at gmail.com Wed Jul 31 03:39:33 2013 From: deklerkmc at gmail.com (Marc de Klerk) Date: Wed, 31 Jul 2013 00:39:33 -0700 (PDT) Subject: Contiguous Array In-Reply-To: References: Message-ID: Hi guys, I've been using np.ravel(). This morning I tried to lookup the difference between np.ravel() and np.ascontiguousarray(). Does anybody know? Marc On Sunday, July 21, 2013 6:37:47 AM UTC+2, Chintak Sheth wrote: > > Hi Ronnie, > > On Jul 21, 2013 10:00 AM, "Ronnie Ghose" > > wrote: > > > > So in skimage/colors why does it matter if the array is contiguous? Is > this for Cython operations later? > > > > Yeah it is mainly for using memory views in Cython which is initialized as > C contiguous. > `cdef some_type[:. ::1] var_name` > > In thus case ::1 is for C contiguous. > > Chintak > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Tue Jul 30 16:12:02 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Wed, 31 Jul 2013 01:42:02 +0530 Subject: Blog updated Message-ID: Hi, Blog updated. Any feedback, welcome! https://chintaksheth.wordpress.com/2013/07/30/numpy-the-tricks-of-the-trade-part-i/ https://chintaksheth.wordpress.com/2013/07/31/numpy-the-tricks-of-the-trade-part-ii/ Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Wed Jul 31 05:36:49 2013 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Wed, 31 Jul 2013 11:36:49 +0200 Subject: Contiguous Array In-Reply-To: References: Message-ID: Hi Marc On Wed, Jul 31, 2013 at 9:39 AM, Marc de Klerk wrote: > I've been using np.ravel(). This morning I tried to lookup the difference > between np.ravel() and np.ascontiguousarray(). Does anybody know? np.ravel docstring: A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. np.ascontiguousarray: Return a contiguous array in memory (C order). In [13]: x = np.array(([1, 2], [3, 4])) In [14]: np.ravel(x) Out[14]: array([1, 2, 3, 4]) In [15]: np.ascontiguousarray(x) Out[15]: array([[1, 2], [3, 4]]) Since the default "order" parameter for ravel is "C", and 1-D arrays with order "C" can only be contiguous, you happen to get contiguous memory layout. However, if you want to preserve shape, you cannot use ravel. St?fan From aaaagrawal at gmail.com Wed Jul 31 04:15:35 2013 From: aaaagrawal at gmail.com (Ankit Agrawal) Date: Wed, 31 Jul 2013 13:45:35 +0530 Subject: Contiguous Array In-Reply-To: References: Message-ID: Hi Marc, On Wed, Jul 31, 2013 at 1:09 PM, Marc de Klerk wrote: > Hi guys, > > I've been using np.ravel(). This morning I tried to lookup the difference > between np.ravel() and np.ascontiguousarray(). Does anybody know? > I am not sure if this helps as I don't know your purpose for using np.ravel / np.ascontiguousarray. I got to know about the ndarray.flags method yesterday from Stefan while discussion on this PR . In [15]: a = np.arange(20).reshape((4,5)) In [16]: a Out[16]: array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]]) In [17]: a.flags Out[17]: C_CONTIGUOUS : True F_CONTIGUOUS : False OWNDATA : False WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False In [18]: b = np.ravel(a) In [20]: b Out[20]: array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) In [21]: b.flags Out[21]: C_CONTIGUOUS : True F_CONTIGUOUS : True OWNDATA : False WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False Hope this helps!! Marc > > On Sunday, July 21, 2013 6:37:47 AM UTC+2, Chintak Sheth wrote: > >> Hi Ronnie, >> >> On Jul 21, 2013 10:00 AM, "Ronnie Ghose" wrote: >> > >> > So in skimage/colors why does it matter if the array is contiguous? Is >> this for Cython operations later? >> > >> >> Yeah it is mainly for using memory views in Cython which is initialized >> as C contiguous. >> `cdef some_type[:. ::1] var_name` >> >> In thus case ::1 is for C contiguous. >> >> Chintak >> > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From evan.daugharthy at gmail.com Wed Jul 31 16:55:20 2013 From: evan.daugharthy at gmail.com (Evan Daugharthy) Date: Wed, 31 Jul 2013 13:55:20 -0700 (PDT) Subject: label Message-ID: <6ce6f26e-d5cd-4a49-b31c-bd0be22ee345@googlegroups.com> Hello all, Based on the discussion here: https://groups.google.com/forum/#!topic/pythonvision/AVrnueiKKYI It seems like this label function should be faster than the scipy version. However, I find it to be much slower: from skimage import morphology from scipy import ndarray as nd k = np.zeros((4000,4000),dtype=int) k[100,100] = 1 strel = np.ones((3,3)) %timeit morphology.label(k) 1 loops, best of 3: 1.46 s per loop %timeit nd.label(k,strel) 1 loops, best of 3: 355 ms per loop If you have any insight, I would be very grateful. I am using version 0.8.2 on the versions of python/numpy/cython, etc. included in the most recent edition of Enthought/Canopy. Thanks, Evan Daugharthy -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvertrumpet999 at gmail.com Wed Jul 31 18:31:19 2013 From: silvertrumpet999 at gmail.com (Josh Warner) Date: Wed, 31 Jul 2013 15:31:19 -0700 (PDT) Subject: random walker segmentation In-Reply-To: <20130730205016.GA27240@phare.normalesup.org> References: <20130730205016.GA27240@phare.normalesup.org> Message-ID: Hi Emmanuelle, I think this would be a good step forward, and would be happy to help! My guess is that this approach could be sped up further in Cython with code we control, making it easier to maintain and expose similar performance to all users. The memory issue is a real one, particularly for larger (multichannel) datasets. That alone probably justifies the addition, even at the expense of a small performance hit. But we'll see how small we can make the hit ;) Also, the iterative solution framework might be useful for other algorithms. Josh On Tuesday, July 30, 2013 3:50:16 PM UTC-5, Emmanuelle Gouillart wrote: > > Hello, > > a while ago, I contributed to skimage an implementation of the > random walker segmentation algorithm (which has been improved and > extended by many others since then). This algorithm computes a multilabel > segmentation using seeds (already labeled pixels), by determining for an > unlabeled pixel the probability that a seed diffuses to the pixel (with > an anisotropic diffusion coefficient depending on the gradient between > neighboring pixels). > > In the current implementation in skimage, the computation of the > probability map is done by inverting a large sparse linear system > (involving the Laplacian of the graph of pixels). Different methods can > be chosen to solve the linear system: a brute force inversion only > works for tiny images; a conjugate gradient method works well but is > quite slow. If the package pyamg is available, a multigrid method is used > to compute a preconditioner, which speeds up the algorithm -- but it > requires pyamg. Also, the memory cost of the algorithm is important > (linear, I think, though. I haven't yet taken the time to use a memory > profiler but I should). > > Recently, a colleague brought to my attention that the linear > system was just a set of fixed-point equations, that could be solved > iteratively. Indeed, the solution verifies that the probability of a > pixel is the weighted sum (with weights on edges that are a decreasing > function of gradients) of the probabilities of its neighbors. I have > written a quick and dirty implementation (only for 2-D grayscale images > and for 2 labels) of this "local" version, available on > > https://github.com/emmanuelle/scikits.image/blob/local_random_walker/skimage/segmentation/local_random_walker.py > > It turns out that this implementation is slower than the > conjugate gradient with multigrid acceleration (typically 2 to three > times slower), but it has several advantages. First, it can be as fast as > the "simple" conjugate gradient (without pyamg's muligrid acceleration), > which is the mode that most users will use (we don't expect users to > install pymag when they are just trying out algorithms). Second, its > memory cost is lower (for example, the weight of an edge is stored only > once, while it appears twice in the Laplacian matrix). Finally, because > the operations only involve neighboring pixels, it is possible that > further speed optimization can be done (using cython... or maybe a GPU > implementation, even if we're not that far yet with skimage). > > So, should we replace the linear algebra implementation with this > simpler local and iterative implementation ? I'd be interested in knowing > about your opinion. > > Cheers, > Emmanuelle > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Wed Jul 31 06:55:25 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Wed, 31 Jul 2013 16:25:25 +0530 Subject: Blog updated In-Reply-To: References: Message-ID: Added the explanation and another example in einsum section. Hope that makes it more understandable. Thanks for pointing it out, Juan! :D @Stefan, sure I'll add it in a bit. I'm trying to get Python3 up and rolling as you had instructed. Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Wed Jul 31 05:14:03 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Wed, 31 Jul 2013 19:14:03 +1000 Subject: Blog updated In-Reply-To: References: Message-ID: Yep, very cool posts Chintak! Especially the second one where you turn it up to 11! =) And it really shows the power of numpy, beyond what I realised! On Wed, Jul 31, 2013 at 6:23 AM, St?fan van der Walt wrote: > The part about einsum is really nice! I propose we add a nice comment > in the code (of your PR) to explain what's happening on that einsum > line, because most people won't have a clue :) > This is definitely true of me! Actually I don't really understand the "real" einsum expression in your blog post, the one doing the SSD computation. Can you explain it in a bit more detail? What's the arrow? Anyway, good stuff. =) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Wed Jul 31 05:47:52 2013 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Wed, 31 Jul 2013 19:47:52 +1000 Subject: Contiguous Array In-Reply-To: References: Message-ID: @Marc: They are very different functions. ravel() gives you a view or a copy of the array as a 1D array that happens to be contiguous. ascontiguousarray will give you a view or a copy of the array *of the same shape* as the original, but guaranteed to be contiguous. Let me try to illustrate: In [1]: x = np.arange(20, dtype=np.uint8).reshape((4,5)) In [2]: x Out[2]: array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]], dtype=uint8) In [3]: x.strides Out[3]: (5, 1) So I've made an array x that has 4 rows and 5 columns. Internally, the data in x is stored as a contiguous block of memory of length 20 bytes. The strides tell numpy that to get to the next row in the array, you need to skip 5 bytes in the memory, but to get to the next column, you only need to go to the next (+1) byte in memory. This is called C-contiguous. Now, let's get a weird view of x: In [4]: y = x.T[1::2] I've taken the transpose of x (5 rows and 4 columns) and then taken the 1st and 3rd rows of that. By default, numpy will use nice tricks with strides to avoid a copy: In [5]: y.strides Out[5]: (2, 5) In [6]: y Out[6]: array([[ 1, 6, 11, 16], [ 3, 8, 13, 18]], dtype=uint8) In [7]: y[1, 1] = 45 In [8]: x Out[8]: array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 45, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]], dtype=uint8) So, y is actually pointing to the same memory as x, but it uses different strides to access its own rows and columns. Notice that changing an entry in y changed the corresponding entry in x. In [10]: np.ravel(y) Out[10]: array([ 1, 6, 11, 16, 3, 45, 13, 18], dtype=uint8) np.ravel gives you a "linearised" version of y, concatenating all the rows together. In [11]: z = np.ascontiguousarray(y) In [12]: z Out[12]: array([[ 1, 6, 11, 16], [ 3, 45, 13, 18]], dtype=uint8) In [13]: z.strides Out[13]: (4, 1) np.ascontiguousarray gives you the same thing as y, except now it's a separate contiguous block of memory: look at the strides. You can tell that it's a copy because modifying z has no effect on x: In [14]: z[0, 0] = 72 In [15]: x Out[15]: array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 45, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]], dtype=uint8) In [16]: z Out[16]: array([[72, 6, 11, 16], [ 3, 45, 13, 18]], dtype=uint8) But, if an array is already contiguous, np.ravel() avoids a copy and returns a view into the same data. So: In [19]: a = np.ravel(x) In [20]: a[0] = 72 In [21]: x Out[21]: array([[72, 1, 2, 3, 4], [ 5, 6, 7, 45, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]], dtype=uint8) If you try to get a contiguous version of x, which is already contiguous, you are actually getting x back: In [22]: b = np.ascontiguousarray(x) In [23]: b is x Out[23]: True In [25]: b[3, 4] = 0 In [26]: x Out[26]: array([[72, 1, 2, 3, 4], [ 5, 6, 7, 45, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 0]], dtype=uint8) Hope that clarifies a few things! It takes quite a bit of playing around before you can get an intuition for what's a copy, what's a view, what's contiguous, etc. On Wed, Jul 31, 2013 at 6:15 PM, Ankit Agrawal wrote: > Hi Marc, > > > On Wed, Jul 31, 2013 at 1:09 PM, Marc de Klerk wrote: > >> Hi guys, >> >> I've been using np.ravel(). This morning I tried to lookup the difference >> between np.ravel() and np.ascontiguousarray(). Does anybody know? >> > I am not sure if this helps as I don't know your purpose for using > np.ravel / np.ascontiguousarray. I got to know about the ndarray.flags > method yesterday from Stefan while discussion on this PR > . > > In [15]: a = np.arange(20).reshape((4,5)) > > In [16]: a > Out[16]: > array([[ 0, 1, 2, 3, 4], > [ 5, 6, 7, 8, 9], > [10, 11, 12, 13, 14], > [15, 16, 17, 18, 19]]) > > In [17]: a.flags > Out[17]: > C_CONTIGUOUS : True > F_CONTIGUOUS : False > OWNDATA : False > WRITEABLE : True > ALIGNED : True > UPDATEIFCOPY : False > > In [18]: b = np.ravel(a) > > In [20]: b > Out[20]: > array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, > 17, 18, 19]) > > In [21]: b.flags > Out[21]: > C_CONTIGUOUS : True > F_CONTIGUOUS : True > OWNDATA : False > WRITEABLE : True > ALIGNED : True > UPDATEIFCOPY : False > > Hope this helps!! > > Marc >> >> On Sunday, July 21, 2013 6:37:47 AM UTC+2, Chintak Sheth wrote: >> >>> Hi Ronnie, >>> >>> On Jul 21, 2013 10:00 AM, "Ronnie Ghose" wrote: >>> > >>> > So in skimage/colors why does it matter if the array is contiguous? Is >>> this for Cython operations later? >>> > >>> >>> Yeah it is mainly for using memory views in Cython which is initialized >>> as C contiguous. >>> `cdef some_type[:. ::1] var_name` >>> >>> In thus case ::1 is for C contiguous. >>> >>> Chintak >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "scikit-image" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to scikit-image+unsubscribe at googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaaagrawal at gmail.com Wed Jul 31 13:18:03 2013 From: aaaagrawal at gmail.com (Ankit Agrawal) Date: Wed, 31 Jul 2013 22:48:03 +0530 Subject: Blog updated In-Reply-To: References: Message-ID: Great posts Chintak !! They cleared up a lot of the ambiguities I had about ndarray's working at a lower level of abstraction. Same goes for Stefan's clear 'The Numpy Array' paper. Thanks a lot. Ankit Agrawal, Communication and Signal Processing, IIT Bombay. On Wed, Jul 31, 2013 at 4:25 PM, Chintak Sheth wrote: > Added the explanation and another example in einsum section. Hope that > makes it more understandable. Thanks for pointing it out, Juan! :D > > @Stefan, sure I'll add it in a bit. I'm trying to get Python3 up and > rolling as you had instructed. > > Chintak > > -- > You received this message because you are subscribed to the Google Groups > "scikit-image" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to scikit-image+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chintaksheth at gmail.com Wed Jul 31 13:22:05 2013 From: chintaksheth at gmail.com (Chintak Sheth) Date: Wed, 31 Jul 2013 22:52:05 +0530 Subject: Blog updated In-Reply-To: References: Message-ID: Thanks a lot Ankit! =) Yeah, I beginning to really like NumPy! :D Chintak -------------- next part -------------- An HTML attachment was scrubbed... URL: