MATLAB Answers

How can I mark several features in an image with 'insertMarker' and save the image at full resolution?

11 views (last 30 days)
Tony
Tony on 28 Apr 2018
Commented: Tony on 14 May 2018
I am trying to identify geese in a 8688x5792-pixel image and mark the identified features (geese) with a circle then save the image with the marks at full resolution for editing. Only the last feature in my processing loop is marked and shown the saved image.
dotpic = myImage; for BLOBS = 1:10 if BLOBS == 2 dotpic = 'G:\Iz Pics\Survey 2 Canon\dotpic.jpg'; end pos = [centroids(BLOBS,1),centroids(BLOBS,2)]%position of identified "geese" in photo dotpic = insertMarker(myImage,pos,'o','color','red','size',30); imwrite(dotpic,'G:\Iz Pics\Survey 2 Canon\dotpic.jpg') end imshow(dotpic);

Accepted Answer

Bernhard Suhm
Bernhard Suhm on 11 May 2018
That looks like you are on the right track, and should work if pos corresponds to a vector of (x y) positions for the markers. We don't know what exactly centroids contains - if it was a vector of (x y) coordinates of centroids from a clustering, it should work. If you still need more help, follow the guidelines described in How to ask a MATLAB question

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by