I am doing a study into image processing and motion detection. I am using various filters (ImageDifference
, HighpassFilter
, Binarize
, etc.) to process the image and then ComponentMeasurements
to determine the areas of interest. Having found these areas, I want to indicate them on the original image - to do this I have been using the HighlightImage
function and it is working. However, with more than one coordinate to highlight, the function is really slow (one point = 0.15s, two or more points = 3s). One way I thought to speed it up was to do the single coordinate update recursively, but my code has a glitch that I can't see. Any help to speed this up would be gratefully received.
HighlightImageFast[image_, points_] := Module[{tempImage},
tempImage = image;
Do[tempImage = HighlightImage[tempImage, points[[n]],
Method -> {"CrossMarkers", 50}, "HighlightColor" -> Blue],
{n, Length[points]}];
tempImage
]
N.b. I'm a home use licensee and currently have version 10.0.2.0
HighlightImage
with a list should be faster than you callingHighlightImage
n times. If that really isn't the case, I'd replace yourDo
loop withFold[HighlightImage[#1,#2,...options...]&,image,points]
. Maybe you can provide some data so it's easier to help. $\endgroup$ – N.J.Evans Sep 16 '15 at 15:56HighlightImage
are quite reasonable. Perhaps your images are big ... $\endgroup$ – Dr. belisarius Sep 16 '15 at 16:32