parenthesis with compose Plus and Minus

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: parenthesis with compose Plus and Minus

Post by anthony »

Continuing this...

Here is a true 'heat map' for two point sources. which I believe is what you are trying to simulate. Essentually the final steady state condition after an infinite time, where yours would be the condition at a fixed point in time without fixed source interference or normalization.

It is actually just a two point "Shepards" sparse color gradient fill..

Code: Select all

  convert -size 69x42 xc: \
              -sparse-color Shepards '21,21 white   47,21 black' \
              -scale 500% two_point_heatmap.png
Image

It also shows a vertical flat line between the points, but all other lines are curved. To see that lets do a color replacement to mark iso lines using a color lookup tables -clut

Code: Select all

  convert two_point_heatmap.png  -size 1x11 gradient:Blue-Red \
              -interpolate NearestNeighbor -clut   two_point_clut.png
Image
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
nessence

Re: parenthesis with compose Plus and Minus

Post by nessence »

Anthony,

I'm not the original poster but your Shepards example is insightful.

I believe I'm working on a similar problem as the OP and crime occurrences would be a good example as to the kind of data being graphed. High occurrences at points 50,50 and 50,150 in no way create the likelihood of an occurrence at point 50,100; however, interpolation will say that there is. I believe this is why original poster has a "dot" which is essentially a radial gradient. Compositing those dots, done right, is like Shepards method but with a limited radius.

I noticed on wiki for IDW[1], there's a method which "calculates interpolated value using only nearest neighbors within R-sphere".

Would you know how to accomplish this with ImageMagick?



[1] http://en.wikipedia.org/wiki/Inverse_distance_weighting
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: parenthesis with compose Plus and Minus

Post by anthony »

nessence wrote:I noticed on wiki for IDW[1], there's a method which "calculates interpolated value using only nearest neighbors within R-sphere".
Essentially this is a variation of Shepards than sets some limitations on what data points should be considered for the method.

It could be implemented, relatively easily, but their will not be any 'fast shepards' alternative that could be used when the number of data point (only at actual pixel locations) become large.

See Sparse Color Shepards, a Blur Alternative
http://www.imagemagick.org/Usage/canvas/#sparse_blur
and specifically the 'resize' method.

If you like to discuss further, I suggest you start a new topic. Perhaps in the "Digital Image Processing" forum
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
haarts

Re: parenthesis with compose Plus and Minus

Post by haarts »

anthony wrote: If so you may like to look at Shepards Sparse Color, and the later 'faster' methods of global diffusion.
http://www.imagemagick.org/Usage/canvas/#sparse_fill
Wow. I can hardly believe the amount of stuff you can do with Imagemagick. This looks also interesting for generating heatmaps: http://www.imagemagick.org/Usage/canvas/#sparse-color
Post Reply