From: ImageAnalyst on
On Nov 11, 5:37 am, "Hugh Thompson" <nads_2...(a)hotmail.com> wrote:
> Oh, wow, thanks once more! I never dreamed they were actually connected, they were so far apart.
> Incidentally, 'thin' worked better than 'skel', which left lots of stray spikes connected to the line.
> I followed your blob example and it was extremely helpful. I have just one question, though: I did what you did to get the largest blob. I kept increasing the threshold until I had just the line I wanted and none of the other noisy blobs dotted around the picture. But assuming I want this technique to work for all pictures, where the main 'blob' may be smaller, is there a way to find the largest blob? I can't seem to be able to find the correct syntax.
> Can't thank you enough, ImageAnalyst!
> Hugh

----------------------------------------------------------------------------------------
I think you'd start with this:
allBlobAreas = [blobMeasurements.Area];
then if you want to find the label (index) that refers to the largest
blobs, you'd do something like this
largestBlobIndex = find(allBlobAreas == max(allBlobAreas ), 1,
'first')
I'm not sure what you want to do after that.