We’re rewarding the question askers & reputations are being recalculated! Read more.

# Tag Info

9

Since the object you want to track is moving slowly, you can use ImageDisplacements to calculate a per-pixel optical flow: f = frames[[200 ;; ;; 3]]; flow = Image /@ ImageDisplacements[f]; Now flow contains a dx/dy displacement vector for each pixel for each pair of frames, that tells you the relative displacement between two frames. $*$ So the idea would ...

8

MorphologicalComponents seems like a promising way to go, like High Performance Mark says. So let's try it: img = Import["https://i.stack.imgur.com/e4dN6.jpg"]; MorphologicalComponents[img] // Colorize We see here that there are more non-zero pixels (foreground pixels) than the original image lets on from looking at it. This causes MorphologicalComponents ...

7

ImageAlign should probably be at least part of the solution: img = Import["https://i.stack.imgur.com/pc6ul.png"]; {xdim, ydim} = ImageDimensions[img]; images = Flatten@ImagePartition[img, {xdim/4, ydim/4}]; aligned = ImageAlign[images]; ListAnimate[aligned] Here is an attempt to make it more robust and to prevent it from clipping parts of the figure off at ...

7

img = Import["https://i.stack.imgur.com/e4dN6.jpg"]; Binarize // MorphologicalTransform // ComponentMeasurements // ImageTrim boxes = MorphologicalTransform[Binarize@img, "BoundingBoxes", ∞] trim = ComponentMeasurements[boxes, "BoundingBox"][[All, -1]]; ImageTrim[img, trim] Combining all steps in a function: imgPartition = ImageTrim[#, ...

5

Here is another approach (though this seems overly complicated - I'm sure there's a better way). Pre-process the image for component detection: img = ColorConvert[img, "Grayscale"]; img2 = Binarize[ColorNegate[img], .07] img3 = ImageAdjust@DistanceTransform[img2] Detect centroids of components: spots = MorphologicalComponents[img3, .4, Method -> "...

5

This is a tricky problem for some algorithms because there are multiple grids that we may be referring to. The lines can be horizontal and vertical, but we can also find a grid of lines of equal separation that run along the diagonal. And these lines are not very well separated from other lines that we don't consider part of any grid, at all, based on our ...

4

The following works well: poly = Polygon[{{10, 10}, {120, 10}, {100, 100}}]; ImageMeasurements[lena, "Mean", Masking -> poly] Masking requires the graphical primitive instead your image. The sequence of arguments in ImageMeasurements have to be [image, measured value, options]. It does not work otherwise.

2

Thanks I found this! Free ebook. Basic Image Processing In Mathematica for version 10 https://www.wolfram.com/books/profile.cgi?id=8299 There is also a YouTube tutorial series on version 11 https://m.youtube.com/watch?v=MbNht55nVPs!

2

Here is a small example: (* Export images *) frames = Table[Plot[Sin[x + delta], {x, 0, 2 Pi}], {delta, 0, Pi/2, 0.01}]; MapThread[ Export["~/Desktop/video_frames/" <> ToString[#] <> ".png", #2] &, {Range@Length@frames, frames} ]; (* Import them again *) sortedFilenames = SortBy[ FileNames["~/Desktop/video_frames/*.png"], ...

1

You can do this with the Geo functionality, which knows the "Hammer" projection: GeoImage["World", GeoStyling[{Import["..."], "Projection" -> "Hammer"}], GeoProjection -> "Equirectangular"]

Only top voted, non community-wiki answers of a minimum length are eligible