New answers tagged

2

I am not sure I understand exactly what is required but I'll try something. In the last image all pixels are set to 0 except in the areas of interest (where the pixels of the original image are shown). img = Import["https://i.stack.imgur.com/YDCGF.png"] markers = MaxDetect[GaussianFilter[img, 10], 0.03, Padding -> 1] comp = ImageMultiply[img, ...


3

The following defines the URL where the image is located, imports it and checks it size panimg = With[ { imgurl = "https://mars.nasa.gov/system/resources/deepzooms/25622_1_-_\ PIA24422_-_Navcam_360_-_Maki_7_Navcam_360_08_N_LRGB_0002_RAS_0010052_\ CYL_S_UNCORCLJ01-stretched-v2.png" } , Import[imgurl] ]; ImageDimensions[panimg] ...


2

There is also built-in functionality that is much like what you ask for. If you import your image, click on it, and choose the "Coordinates Tool" then you get a numerical readout of the position and r-g-b values of the image. You can "zoom in" by selecting the Tooltip Options to set the range of pixel values displayed in the popup box.


0

You are right, Manipulate capture the mouse. A way around this is to make the zoom and the point choice separate functionalities. Toward this aim, I draw 2 images, the first one to choose a point. The second smaller one to choose the zoom window. img = ExampleData[{"TestImage", "Lena"}]; {w0, h0} = ImageDimensions@img; Column[{pt = {0.5, ...


0

The Manipulate is a kind of DynamicModule and it does not like when you try to put another such module (DynamicImage) inside it. Let's say, the img=a. I tried something like this: {w, h} = ImageDimensions[a]; pt = Round[{w, h}/2]; pb = {}; zmax = 120; fixed = False; Manipulate[ Column@{ Panel@Row@{ Button[ If[fixed, "Unfix zoom", &...


0

The reason that the marker image changes is because of the different coordinate origins used by ImageTake and PixelValuePositions. A quick fix is to add ImageDimensions after Import, and change row = min[[2]] to adjust for the different origins. {w, h} = ImageDimensions[image]; (*needed to adjust image origin*) The origin problem is easily fixed by changing ...


1

I made a version of your code mostly to understand it. But the timing issue seems to have disappeared as well, so I will post it. If I have time later I might try to optimize it further. getPixels[imageData_, center_, 0] := {center} getPixels[imageData_, center_, radius_] := Module[{ resx = Length[imageData[[1]]], resy = Length[imageData], ...


0

Okay it turns out, that if i replace last (...)&/@kpnk with Do[...,{i,Length[kpnk]}] it works normally Do[ If[Normalize[baarva].Normalize[ slikapiksli[[kpnk[[i, 1]], kpnk[[i, 2]] ]] ] > 1 - \[Epsilon], \[CapitalDelta]naštetih++; \[CapitalDelta]vsotatakih += slikapiksli[[i1, i2]]; \[CapitalDelta]vsotakord += {i1, i2}; ], {i, ...


1

Define the derivatives as pure functions, like: dI1x := Derivative[1, 0][I1]; dI1y = Derivative[0, 1][I1]; dI2x := Derivative[1, 0][I2]; dI2y := Derivative[0, 1][I2]; Then e.g.: SeedRandom[1]; ibigsize = {99, 99}; isize = {20, 20}; Idata = imgen[ibigsize, isize, 1, 1]; Idata[[1, 3]][1, 1] (*-0.123381*)


4

Break the image into r, g, b components and then use the second argument of Binarize to make the conditions different on each channel. The product of the three binary matrices is then your desired image. {r, g, b} = ColorSeparate[imgBig]; Binarize[r, {0, 0.7}] Binarize[g, {0.5, 1}] Binarize[b, {0.5, 1}] I think you'll find this is a lot faster.


1

First, let's get the scale bar out of the image. There are a few ways to do this (MorphologicalBinarize and friends), but I went with the more eye-bally approach of using ColorReplace. Here, we're replacing black pixels with white, and all other pixels with black, to get a mask. Note that ColorReplace has a third argument d, which you could use to fine-tune ...


7

Start by running DominantColors on the image to find the colors of the disks. We find that there are five colors in the image, black, white, red, green, and blue. We are interested in the red, green and blue, so we assign those to variables: red = RGBColor[0.7946611400853826, 0.041682311725958814, 0.19884515506202294, 1.]; green = RGBColor[0....


3

Here's how I (sort of) solved this problem. I took each source line segment (specified by the user) and computationally tipped it around its midpoint so that the line (extended) passed through a user-specified vanishing point. Then, I created $n$ surrogate or interpolated points along each source line and each corresponding (tipped) target line. So if I ...


Top 50 recent answers are included