Azzera filtri
Azzera filtri

how to use image in exterma mfile?

3 visualizzazioni (ultimi 30 giorni)
sara
sara il 18 Set 2014
Commentato: sara il 20 Set 2014
i download an mfile named exterma from here,which finds exterma points in an image, http://www.mathworks.com/matlabcentral/fileexchange/12275-extrema-m--extrema2-m/content/extrema/extrema.m and http://www.mathworks.com/matlabcentral/fileexchange/12275-extrema-m--extrema2-m/content/extrema/extrema2.m when I put my image address instead of xy,it gives me the error:(Undefined function 'extrema' for input arguments of type 'uint8'.) I don't know how to locate my image in this mfile,i just write these 2 lines: m=imread('image adress.jpg'); xy=rgb2gray(m); I also find 2 other mfiles here which detect exrema points in an image,but they only give me hundreds of 0 and 1,i want to detect exterma point in my image,show an image for result. http://www.mathworks.com/matlabcentral/fileexchange/45338-findextrema/content/findExtrema.m
http://www.mathworks.com/matlabcentral/fileexchange/41955-find-image-extrema isn't it better to use hit or miss for detecting exterma points?i want to detect top left,right top.... and for each one change the proper strel.?

Risposta accettata

Iain
Iain il 18 Set 2014
Ok, I'll translate the problems:
Undefined function 'extrema' for input arguments of type 'uint8'.
That means that the extrema file is not visible to the matlab path. The command "which extrema.m" should result in a path being printed if it is on the path.
In terms of finding extrema on an image, you need to be very clear with what you mean.
Are you looking for the list of pixels which are higher than all of their neighbours, on a pixel to pixel basis, or are you looking for an area of bright (or dark) pixels (hotspots)?
If you need hotspots, this is something like what you want to do... If you take your image "im" and do this:
im = im - min(im(:));
im = im / max(im(:));
You'll have your image scaled between 0 and 1. You can then find hot spots/regions with this (modify the > 0.9 to suit)
hotspots = im > 0.9;
imagesc(hotspots)
figure
imagesc(hotspots .* im)
  7 Commenti
Image Analyst
Image Analyst il 20 Set 2014
You can use bwboundaries() on the mask image and then use a for loop to find the most distant points. See attached example. (Wow, I'm just posting tons of demos today. But only a fraction of all of them I have, which is about 150 of them.)
sara
sara il 20 Set 2014
thank you so much,i should read it,.thanx

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by