Borrar filtros
Borrar filtros

Is there any way to return just the pixels inside an area enclosed by a bwperim such as a cell? I need to return the cell I have highlighted by a mouse click. I have as far as the cell has a boundary of white pixels enclosing it from bwperim.

1 visualización (últimos 30 días)
The seed points below are found from the ginput command using a mouse click. So the for loop moves from this point outwards to cover one quarter of the image. Four of these style loops are need to scan the whole image. The line I am having a problem with is contained in the IF statement, if the condition I(i,j)==1 is met then I want the for loop to stop searching on this line and move to the next. I know the clear command would stop the loop but I need it to stop just for the line I am on when the condition is met and start the next line until the condition is met and so on until the loop is completed.
Or is there a matlab command where by a mouse click I could highlight the inside of an are which is surrounded by a white pixel boundary obtained by the use of the bwperim command.
for i = seed_point_i:H-1 for j = seed_point_j:W-1 if I(i,j)==1
end
end
end

Respuestas (1)

Image Analyst
Image Analyst el 24 de Abr. de 2013
bwperim() operates on a binary image, so basically if you're even able to call bwperim, you're already done. If you want to fill holes, you can use imfill(). What you were describing at first was more like a region growing approach, which is probably not what you want either. For that, I do have a Photoshop-like magic wand demo if you're interested, but I really doubt you need it. Why don't you post your image to http://snag.gy so I can advise you on the best approach to take to segment your object(s)? For example, I have no idea why you say that you need 4 region growing regions.
  2 comentarios
Ralph Dunne
Ralph Dunne el 24 de Abr. de 2013
This is the image I have put a boundary around the cell in question using bw_perim. The cell that is alone in the centre of the image is the cell I want. I want to return just that cells image and the rest of the image outside the bw_perim of white pixels to also be white. So in the end I need the cell in questions pixel information and the rest of the image to be white. Is there a function that will return the cells appearance in bw_perim but make all of the rest white? and thank you for replying I appreciate it.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by