Reputation
18,291
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
2 41 82
Newest
 Good Answer
Impact
~192k people reached

9h
comment Is there a bug of InverseDistanceTransform?
Try e.g. InverseDistanceTransform[ImageMultiply[pic, 10]] to get disks with radius 10
9h
comment Is there a bug of InverseDistanceTransform?
If you evaluate Max[ImageData[pic]] with the image in the documentation, you get 13, i.e. the values of the white pixels are larger than 1, namely the disk radii in pixels. I'm guessing your image contains values between 0 and 1, so InverseDistanceTransform creates disks with radii between 0 and 1
Feb
3
comment Improving visibility of text in scanned image
Related: dsp.stackexchange.com/a/1934/291
Feb
1
comment NelderMeadMinimize for 2D Gaussian fitting
Dumb question: why not just take the log of the images, then fit a 2nd order polynomial to them? That way, it's a linear least squares problem, and you can use LeastSquares
Jan
31
comment Can I get the curvature at any point of a random curve?
@yode: You mean instead of the spanning tree? But the shortest tour (or any tour) goes through all points, then returns to the beginning. I don't want to visit all points, I want to remove those little "branches" that Thinning produces. And I don't want my path the return to the beginning. Also, finding a the shortest tour is an NP-complete problem where only approximate solutions are realistically possible, while finding a spanning tree is cheap.
Jan
30
comment Grayscale Morphology
I'm just translating the formulas on the wikipedia page azt linked. Apparently, to get the same result as in binary morphology, the kernel should contain 0 and -infinity: greyKernel = DiskMatrix[4] /. {0 -> -\[Infinity], 1 -> 0}; fil = ImageFilter[Max[# + greyKernel] &, img, 4]
Jan
29
comment Grayscale Morphology
I think (?) it should be ImageFilter[Max[# + ker] & ...
Jan
29
comment Convex and concave regions of a closed curve
Related: mathematica.stackexchange.com/q/95425/242
Jan
26
comment Convert (rescale) 16 Bit png image
Why don't you just use imageData/8?
Jan
25
comment Get an array of coordinates of the edges of an image
Note that Position[ImageData[...]] returns indices, not coordinates. (The distinction is a bit confusing in MMA image processing, see for example: mathematica.stackexchange.com/a/104047/242). Use PixelValuePositions[edge, 1] to get the coordinates. Rule of thumb: If you want to manipulate the raw array returned by ImageData, use indices. If you want to draw something over the image using e.g. Show, use coordinates
Jan
24
comment How to get a full closed contour image
In coordinatescontour = [...] // DeleteSmallComponents the DeleteSmallComponents is probably a mistake. Other than that, your code seems to do what you want already.
Jan
14
comment What's wrong when I use ImageApplyIndexed?
Related: mathematica.stackexchange.com/a/32377/242
Dec
14
comment Integration of incomplete rings (ellipses) pattern
MinMax is new in 10.3 I think. You can define it simply as {Min[#], Max[#]}&
Dec
12
comment a light bulb is connected as in the circuit shown below.
Also not the site for "do my homework for me questions"...
Dec
7
comment How can I calculate $(y - A \,x)^{T}(y -A\,x)$ symbolically?
Also relevant: mathematica.stackexchange.com/a/40368/242 (esp. the first three paragraphs)
Dec
2
comment Repeatedly applying a function
@holistic: Sure, just apply Flatten and DeleteDuplicates earlier
Nov
26
comment Finding pixel coordinates from morphological components
Except that those aren't coordinates, they're array indices. Indices start at the top-left corner, which is 1/1, and the first index is the row (y-direction). Coordinates start at the bottom-left corner, which is 0/0, and the first coordinate is the x-direction. If you need coordinates, and you don't want to do the error-prone conversion yourself, the easiest way is probably PixelValuePositions[Image[#], 1]& - might be slower, though.
Nov
11
comment How to extract “this text” between specific characters: 1) this text 1)
@NicolasJosephScozzaro: There are great websites like regex101, where you can test regular expressions online. If you plan to do a lot of text processing, do yourself a favor and google for tutorials about regular expressions. They're not hard to use, and make text processing so much easier...
Nov
10
comment How to simplify writing LibraryLink code?
Ah, I see now. I've looked in the reference page for LibraryFunctionLoad, but memory management options weren't mentioned there. I've used LTemplate to access "libSVM" for machine learning (more options and faster than Classify), and it worked perfectly! Thank you very much for this.
Nov
10
comment How to simplify writing LibraryLink code?
Wow, this is really, really great! Question: In LFun["compute", {{Real, _, "Constant"}}, "Void"],, what does "Constant" mean?