Tag Info

New answers tagged

2

One way of getting this to work is by using the Locator as a Control of Manipulate. For the convenience of easier spotting the replaced pixel I have cropped and magnified the image. image = ExampleData[{"TestImage", "Lena"}]; img = ImageCrop[image, 100]; Manipulate[ Row@{img, Dynamic@(new = ReplacePixelValue[new, pt -> 0])} // Magnify[#, 10] ...


4

Well I decided to give it a bit of a go...First import the image and convert to grayscale, then crop to focus on the area of interest. Then I used a LaplacianGaussianFilter, which is often used in blob detection. img = ImageAdjust@ColorConvert[Import["http://i.imgur.com/4lDwE33.jpg"], "Grayscale"]; smallimg = ImageAdjust@ImageTake[img, {200, 500}, {200, ...


6

If ImageMeasurements didn't exist we could have used this one-liner: Total[#]/Length[#] &@Flatten[ImageData[img], 1] ImageData will give you a matrix of RGB vectors, Flatten[...,1] will then give you a one-dimensional list of RGB vectors. Total adds them together, by dividing by the number of RGB vectors we get the mean. Also take a look at ...


8

There are ImageMeasurements for this: ImageMeasurements[image, "Mean"] (* {0.427958, 0.559264, 0.130725} *)


4

For this example, it seems that setting the Alpha Channel to .1 yields correct result across all languages without needing to crop. TextRecognize[img ~SetAlphaChannel~ .1, Language -> #] & /@ {"English", "French", "German", "Spanish", "Portuguese", "Italian"} {"12 Catherine FicktEuschAMK", "12 Catherine FicktEuschAMK", "12 Catherine ...


15

I'm not 100% sure what you want: "segmentation" has a well-defined meaning in image processing, and I think that's not what you want. Also, I couldn't reproduce your results (I think DominantColors isn't guaranteed to give the same order or even the same results every time it's run). So this may or may not help... First, this seems more reproducible than ...


3

This link talks about hacking a MagiQuest receiver with an Arduino. It mentions that the modulation rate of the IR signal is somewhere in the region of 37 kHz, a factor of more than 1000 times faster than anything your webcam can detect. So you simply will not be able to do this with a webcam. Even if the modulation rate were much lower you would still ...


7

Simple white balance As described in the Wikipedia article, the simplest white balance is to rescale the RGB channels to make white objects have white pixels. Here's a simple method where I define a white point in the original image by the 0.995 quantile of each colour channel: image = Import["http://i.stack.imgur.com/bUvXg.png"]; white = Quantile[#, ...


13

Histogram Mean Color Balance Your example photographs imgList = Import /@ {"http://i.imgur.com/qzFttRD.jpg", "http://i.imgur.com/fh9tAK1.jpg", "http://i.imgur.com/b2kWM3y.jpg", "http://i.imgur.com/amNRIhh.jpg"}; ImageAssemble[imgList~Partition~2] The following code balances the colors of an image by transforming the histogram ...


6

If you want a quick&dirty method, CornerFilter might be a good place to start: img = Import["http://i.stack.imgur.com/HVRea.png"]; corners = CornerFilter[img, 2]; mask = DeleteSmallComponents[ Closing[MorphologicalBinarize[corners, {0.2, 1}*10^-4], DiskMatrix[2]]]; HighlightImage[img, mask]


0

Adjust the radius of sharpening: Sharpen[myImage, 15] Or try this and play around: Manipulate[ Blur[ Sharpen[ ImageAdjust[myImage, c], n], m], {c, .1, 2}, {n, 1, 20, 1}, {m, 2, 20, 1}]


8

UPDATED VERSION: Import the images: img1 = Import[NotebookDirectory[] <> "Image1.png"]; img2 = Import[NotebookDirectory[] <> "Image2.png"]; imgs = {img1, img2}; ImageCollage[imgs] Binarize the two images using the "MinimumError"-Method, pad the images (hald the size of the original images) and perform an Opening to get rid of binarized ...


1

You can specify the setting for the option Mesh to include graphics directives: ContourPlot3D[y^2 == a*x, {x, 0, 2}, {y, -2, 2}, {a, 0.9, 5.1}, MeshFunctions -> {#3 &}, Mesh -> {Table[{a, Hue[(a - 1)/4]}, {a, 1, 5, 0.5}]}, ContourStyle -> None, BoundaryStyle -> None, BaseStyle -> Thick]


6

A quick one based on your phase diagram context, where bg contains the color of your 2D planes: g = Table[ParametricPlot3D[{y^2/a, y, a}, {y, -2, 2}, PlotStyle -> Hue[(a*2 - 1)/10]], {a, 1, 5, 1}]; bg = Table[ContourPlot3D[z == a, {x, -4, 6}, {y, -4, 4}, {z, .8, 5.2}, Mesh -> None, ContourStyle -> Directive[Hue[1 - (a*2 - 1)/10], Opacity[0.3]]], ...


9

A method of assembling 2d contour plots ... Show[Table[ Graphics3D@ First@Cases[ Normal@ContourPlot[y^2 == a*x, {x, 0, 2}, {y, -2, 2}, Frame -> False], Line[x_] :> {Hue[(a - 1)/4], Line[Append[#, a] & /@ x]}, Infinity], {a, 1, 5, .5}] ,PlotRange->All] ...


6

Here's one way: ContourPlot3D[y^2 == a*x, {x, 0, 2}, {y, -2, 2}, {a, 0.9, 5.1}, MeshFunctions -> {#3 &}, Mesh -> {Table[a, {a, 1, 5, 0.5}]}, ContourStyle -> None, BoundaryStyle -> None] /. GraphicsComplex[p_, g_, opts___] :> GraphicsComplex[p, g /. Line[v_] :> {Hue[((p ~Part~ v[[1]] ~Part~ 3) - 1)/4], Thick, ...


5

You can use the result of FindGeometricTransform to adjust the PlotRange. Starting with the same images: imgOriginal = ImageTake[ExampleData[{"TestImage", "Aerial"}], {1, -2}, {2, -1}]; img1 = ImageTake[imgOriginal, {0, 160}]; img2 = ImageTake[imgOriginal, {-160, -1}]; Finding the transformation with tr = FindGeometricTransform[img1, img2, ...


3

Another approach (from this answer) is to re-set the value of the option ImageSizeMultipliers to {1.,1.} : image = ImageResize[Import["ExampleData/lena.tif"], 250]; image2 = ImageResize[ExampleData[{"TestImage", "Mandrill"}], 150]; With the default settings image image2 Grid[{{"abcd", image, image2}}] gives After evaluating ...


0

Thank you for your help. I have come up with something that is almost what I am looking for: Photo = RandomReal[1, {50, 50}]; Manipulate[ ArrayPlot[Photo, ColorRules -> {y_ /; y < a -> Purple, y_ /; y < b -> Red, y_ /; y < c -> Blue}], {a, 0, 1}, {b, 0, 1}, {c, 0, 1}] What I would like to do is instead of using ArrayPlot ...


7

Here is something 10 x faster. I made the same assumption as george2079 so for each subinterval whole color scheme is used not just exact part like in Simon's answer. Maybe useful, maybe not. Usage colorF ~ createColorFunction ~ {"TemperatureMap", "AvocadoColors"}; pic = Image@ConstantArray[Range[0, 1, .001], 100] Colorize[pic, ColorFunction -> ...


3

You can use Colorize for this Colorize[RandomImage[1, {10, 10}], ColorFunction -> (Piecewise[ {{ColorData["AlpineColors"][#], 0 < # < .5}, {ColorData["SouthwestColors"][#], .5 < # < 1}}] &)]


2

One approach: ImageApply[ List @@ Piecewise[{ {ColorData["AlpineColors"][2 #], 0 < # < .5}, {ColorData["SouthwestColors"][2 # - 1 ], .5 < # < 1} }] &, Image[RandomReal[1, {10, 10}]]] or Image[Map[ List @@ Piecewise[{ {ColorData["AlpineColors"][2 #], 0 < # < .5}, ...


2

After you draw one or more selection rectangles and click away from the image they are still there suspended in a xenon mist but they are only visible if you look dead ahead use the selection tool. We can extract that data from the underlying Cell expression with this Button: Button["Copy ImageMarkers", Cases[ NotebookRead[SelectedNotebook[]], ...


3

data = RandomInteger[1, {300, 300}]; Image[data] or Graphics[Raster[data]] You can also try: ArrayPlot[data] RandomImage[BernoulliDistribution[1/2], {300, 300}] etc.


1

ListDensityPlot[Table[RandomInteger[{0, 1}], {100}, {100}], InterpolationOrder -> 0, ColorFunction -> GrayLevel]



Top 50 recent answers are included