# Tag Info

7

My (the?) standard(1) work-around for this problem is to add Pane: Row[{image}] Grid[{{Pane@image}}] Row[{"abcd", Pane@image}] Grid[{{"abcd", Pane@image}}] For more control see: How do I display imported images at actual size? Exporting pictures in their correct size when using Grid

5

As per my comment you will note that images can be pasted into notebooks and used as expressions. They are not rendered at full size but the size information is stored as an option. If all you want to do is have Row and Grid render something to the same specific size then try Show: Row[{"abcd", Show[image, ImageSize -> 300]}] Grid[{{"abcd", Show[image, ...

9

Heres an alternative. pic = Import["http://i.stack.imgur.com/4xyhd.png"] Let's say you are lazy and you don't want to write mathematical equations. We can use built-in transformations to create domain, image of transformation, and create InterpolationFunction based on this data. data = Join @@ Table[{lat, long}, {lat, -89, 89}, {long, -179, 179}]; ...

0

I believe I've figured out what the problem was. The MeanEuclidean method of RegionBinarize was unresponsive to changes in the distance parameter because it expects ImageData for the image and the marker to be in the range {0, 1}. The actual range for computed tomography data in HU is roughly {-1000, 3000}. Expected results are obtained by scaling the ...

4

Change a bit code, also are you sure <|"Apple" -> negative, "None" -> positive|> or did I misunderstood the problem? Anyways this seems logical (works same efficiently without ConformImages but I just wanted to feature it): dir =(*path to dir containing unzipped folders*); ndir = FileNameJoin[{dir, "negative"}]; pdir = FileNameJoin[{dir, ...

1

Get rid of FaceForm[] and it is straight forward: coords[{{x1_, y1_}, {x2_, y2_}}] := {{x1, y1}, {x1, y2}, {x2, y2}, {x2, y1}}; Dynamic[image = CurrentImage[]; faces = coords[First@FindFaces[image]]; Column[{ faces, Show[{image, Graphics[{EdgeForm[{Red, Thick}], Texture[(you will have to insert your image HERE)], ...

12

As was correctly noted in comments, out-of-focus images cannot been correctly detected by a simple gradient filter since out-of-focus images can have sharp edges. I propose another simple idea to detect such images. Introduction Roughly speaking, the brightness of a defocused image $B(x,y)$ is a convolution of a focused image $B_0(x',y')$ with some kernel ...

2

For an alternative approach to counting the number of black pixels in the binarised image you could try getting the image data and counting how many zeroes it has: Count[Flatten@ImageData@yourBinaryImage,0]

6

You only need one more line for evaluation of the coverage of the colors: coverage = DominantColors[yourImageBlackWhite, 2, "Coverage"] {0.762952, 0.213876} - Edit: To answer your comment (posted as an answer), I want to add this: You can show the number of covered pixels as well as the coverage. Using the command: DominantColors[yourImageBlackWhite, ...

1

You can get the values of the pixel intensities directly using the built-in functions PixelValue and/or ImageValue. For example, using DumpsterDoofus's image, the RGB pixel values at location {100,100} are easy to find, and their mean is (roughly) the intensity. data = ...

3

Using ND is not necessary, as Mathematica makes it easy to construct InterpolatingFunction objects, which can then be formally differentiated using Derivative. First, a sample image: data = Import[ "http://41.media.tumblr.com/bece7ed81870c8e9b904290700451eb2/tumblr_\ mv8m2sE2FW1slvzano1_400.jpg"] Convert to grayscale, and then convert the resulting ...

2

Here is a version of your code that produces an image: axes[x_, y_, z_, a_] := Graphics3D[ Join[{Red, Arrowheads[a], Arrow[Tube[#, 0.015]]} & /@ {{{-x, 0, 0}, {x, 0, 0}}, {{0, -y, 0}, {0, y, 0}}, {{0, 0, -z}, {0, 0, z}}}, {Text[ Style["\!$$\*SubscriptBox[\(S$$, $$x$$]\)", 18, Bold, Black], {1.1*x, 0.1*y, 0.1*z}], ...

4

You could use the mean distance from the boundary, which for a long thin object is about 1/4th of its width. image = Import["http://i.stack.imgur.com/2G491.png"]; m = MorphologicalComponents[image]; d = DistanceTransform[image]; widths = ComponentMeasurements[{m, d}, "Mean"] (* {1 -> 2.40336, 2 -> 5.08581, 3 -> 2.7668, ... } *) Here are the ...

1

While not as fast as halirutan's compiled function, Mr.Wizard's renderImage function (from this question) can be used here with reasonable performance: renderImage[array_?MatrixQ, cf_, opts : OptionsPattern[Image]] := Module[{tbl}, tbl = List @@@ Array[cf[#/2047] &, 2048, 0] // N // Developer`ToPackedArray; Image[tbl[[# + 1]] & /@ Round[2047 ...

4

What you can do is, you mimic the behaviour of Blend by creating a function that interpolates linearly between colours. What you change with your parameters are the values where the color transitions take place. Let me give you a simplified example: I use 3 colours. In the compiled function, I only work with their {r,g,b} values. As result, I want a ...

3

This is what I get in Mathematica 10.0.2: In[1]:= img= Import["http://i.stack.imgur.com/natsI.png"]; bin=Binarize[img,0.18]; AbsoluteTiming[pos=PixelValuePositions[bin,1];] AbsoluteTiming[resultImage=ReplacePixelValue[bin,pos->Red];] Out[3]= {0.004004,Null} Out[4]= {2.661534,Null} The performance of ReplacePixelValue and ...

5

Please take a look at the file image_external.c. that you can find in your installation with the command FileNames["image_external.c", {\$InstallationDirectory}, Infinity] Therein, everything you want to know is described. When it comes down to compiling, then you need to ensure you have the development files for opencv and libraw installed and you know ...

1

The above is an excellent answer to the specific question posed. Reading the documentation info on "ImageApply[]" and "Masking" provides another mechanism for performing image processing operations selectively on image regions. Complex masks for ImageApply[] can be generated offline and Imported as mask images using software such as GIMP or Photoshop, ...

6

pic = Import["http://i.stack.imgur.com/TPxVj.png"] alpha = Composition[ GaussianFilter[#, 10] &, Image, BoxMatrix[#/2 - 5, #] &, Reverse, ][ ImageDimensions@pic] SetAlphaChannel[pic, alpha]

Top 50 recent answers are included