Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How can I convert this image in binary image such that region inside red curve is filled with white while rest with black?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
How can I convert this image in binary image such that region inside red curve is filled with white while rest with black? I have around 900 images like this so free hand drawing will be very lengthy. So is there any other way of doing it...maybe by setting some threshold?
0 comentarios
Respuestas (1)
Adam Wyatt
el 9 de Sept. de 2020
Your question is quite vague and the methodology and results depend very much on how the images vary.
Remember that the computer will have no concept of how you decide where to draw that boundary, so you need to come up with some criterion on how to do that. If you have the image processing toolbox, that has many functions that can help you to create a mask from an image.
Assuming that using a threshold will suffice - i.e. all points within the enclosed region are above threshold and outside are below, you can create a mask in 1 line:
mask = (ImgArray>threshold_value);
However, you are likely going to be required to pre-process the data. The most likely is to perform smoothing using e.g. imfilter or filter2 You may then also need to refine the mask - for example by only taking connected points (image processing toolbox will be your friend). A little trick you can use is to smooth the mask and then threshold that - this can help get rid of any holes and create a little extra padding.
If you don't have the toolbox, it is still possible to find the continous region, but it will be slow (I do have a function to do that).
0 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!