Reputation
11,933
Next privilege 15,000 Rep.
Protect questions
Badges
2 30 59
Newest
 Guru
Impact
~142k people reached

Mar
13
answered Image processing for extracting regions of book pages that are covered by text
Mar
9
comment Can I solve this graph theory problem with Mathematica?
I see. The solution got lost in translation...
Mar
9
comment Can I solve this graph theory problem with Mathematica?
Which number is which? Could you maybe draw one of them in a graph? I thought they were top-to-bottom, left-to-right, but then 4,5 in the first example would be neighbors.
Mar
4
awarded  Popular Question
Feb
20
answered Calculating displacement for a circular disc
Feb
11
comment Using 2D Fourier transform of an image to detect typical wavelengths
@SjoerdC.deVries is right, I didn't notice that. IIRC, this is done to "rotate" the 0 frequencies to the center of the FFT output. If you want to interpret the values numerically (instead of displaying the FT as a picture), you'd want to remove that line.
Feb
11
comment Using 2D Fourier transform of an image to detect typical wavelengths
fw contains the values. I.e. fw[[1,1]] is the value for frequency 0/0, fw[[1,2]] is the value for frequency 0/1...
Feb
7
comment Efficient Lloyd Sampling of Images
Calculating the distance to the nearest seed for each pixel, good idea, I didn't think of that! It might get slower if nx and ny get large (10^4? 10^5?), but for 200, it's pretty fast. I don't have time to update my answer right now, but I think Nearest[seeds -> Range[Length[seeds]], pos][[All, All, 1]] is even faster than your Compiled code.
Feb
7
comment Efficient Lloyd Sampling of Images
@paw: It seems as if Rasterize[Graphics[...]] creates an 8-bit image, and using GrayLevel[index/200] leads to rounding errors. GrayLevel[index/255] seems to work better; If you have more than 255 seeds, you'll have to use RGBColor to encode the seed index. Also, I've noticed that the seed centers seem to be "moving downwards" - I'm guessing Polygon and ComponentMeasurements are rounding in different directions - that's why I've added the (admittedly, ugly) -1 in the PlotRange
Feb
7
revised Efficient Lloyd Sampling of Images
deleted 11 characters in body
Feb
7
revised Efficient Lloyd Sampling of Images
added 1045 characters in body
Feb
7
comment Efficient Lloyd Sampling of Images
@belisarius: Using image processing to approximate a Voronoi diagram is much more expensive than actually calculating a Voronoi diagram. At least in 2d, calculating a VD is about as complex as sorting all the points by their Y-coordinate.
Feb
7
revised Efficient Lloyd Sampling of Images
(added animation)
Feb
7
answered Efficient Lloyd Sampling of Images
Feb
7
accepted Is there a CDF Player for Mathematica 10? (Yes)
Jan
29
awarded  Enlightened
Jan
29
awarded  Nice Answer
Jan
26
awarded  Yearling
Jan
22
awarded  Nice Question
Jan
16
comment Plotting y'[x] vs y[x]
ParametricPlot?