From: M Ladderman on 13 Jun 2010 16:21 Hi everyone, Thanks for your replies! I do want to change the image matrix. That is why I do not use plot(). This is the loop in which I use imline(). It needs to draw on average 750 lines or so and I use a max performance macbook pro and it takes 2-3 minutes or so. for k = 1:sizeyy(1,2); hLine=(imline(gca,[xc(1,k) xc(2,k)],[yc(1,k) yc(2,k)])); binaryM=hLine.createMask(); closeBW(binaryM)=1; end Help is very welcome and thanks again! L ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <c2dd8299-719d- 4b2c-846c-3516b4595787(a)a30g2000yqn.googlegroups.com>... > On Jun 11, 8:22 am, "M Ladderman" <mirresim...(a)gmail.com> wrote: > > Hi.. > > > > imline() works indeed, but it is quite slow if you want to connect a lot of dots together. Is there any code that does the same faster, I use a loop to do the imline statement for each pixel pair and this takes a lot of time (minutes!!).. (I want to use it with ashape, see my earlier threads). Thanks a lot!! > > > > Cheers > ----------------------------------------------------------------------------------------- > Ladderman: > Why don't you just use plot() - it will plot a polyline and it seems > fast to me. It should be able to plot your shape in a small fraction > of a second. > By the way, there is no reason your line plotting with the line() or > imline() function should take minutes - you're doing something wrong. > And you never said whether having the line in the overlay is what you > want, or if you need to change the underlying image pixel values. Can > you answer that? > ImageAnalyst
From: Michael Hayworth on 13 Jun 2010 19:07
Took 20 seconds on my Windows XP notebook for 750 lines. So it looks like your best bet is Bruno's program, which took only .0078 seconds.. |