I want to extract a white image (circled in red) and display it alone.
please help.

Antworten (1)

Image Analyst
Image Analyst am 1 Okt. 2023

0 Stimmen

You can use drawfreehand to hand trace around all the blobs you want to retain. See attached freehand_masking_demo.m. I've attached other demos for other shapes and ways of drawing.

12 Kommentare

Rahmat Anbi Ancing
Rahmat Anbi Ancing am 2 Okt. 2023
Thanks for the help. it's very helpful!!
Do you have any other examples for automatic capture?
Like this example below.
Thanks
Image Analyst
Image Analyst am 2 Okt. 2023
Bearbeitet: Image Analyst am 2 Okt. 2023
It depends on how precisely you can describe what you are trying to find. Can intensity or shape or something else describe it completely?
By the way, I know that's my demo but kmeans is not a reliable or robust way to find things like tumors. For example, even if that image had no tumors at all, kmeans would force it to find one because you must have k clusters. Thus it would give a false positive in the case of "no tumor", which would be very distressing for the patient.
For published papers on how to robustly find medical abnormalities, see VisionBib:
Rahmat Anbi Ancing
Rahmat Anbi Ancing am 2 Okt. 2023
Bearbeitet: Rahmat Anbi Ancing am 2 Okt. 2023
Thank you for your support,
Actually, I want to separate the black mark in the middle of the center (red circle) and separate it like the tumor example above, so as to know the part that is affected by the defect (black mark).
I attach the original image as well
Thank you
Image Analyst
Image Analyst am 2 Okt. 2023
Do you have a "perfect/no defect" image that can be aligned with the test image so that you can use imabsdiff to see how much it differs from a good image? If you have that then you can just call that and threshold it, then call bwareaopen to get rid of small noise pixels.
Rahmat Anbi Ancing
Rahmat Anbi Ancing am 3 Okt. 2023
Thanks for the method input.
I have a perfect image, here I attach it
Do you have an example for the application of the method?
Thanks
Image Analyst
Image Analyst am 3 Okt. 2023
Did you try what I suggested? imabsdiff, bwareaopen, and then thresholding? If not, why not? Did you even look them up in the documentation?
Rahmat Anbi Ancing
Rahmat Anbi Ancing am 3 Okt. 2023
I've tried it, I'm currently adjusting to the program I made before.
I'll ask again when I'm stuck
Thank you
Image Analyst
Image Analyst am 3 Okt. 2023
OK. If they're not perfectly aligned, you might want align them with imregister.
Rahmat Anbi Ancing
Rahmat Anbi Ancing am 7 Okt. 2023
Bearbeitet: Rahmat Anbi Ancing am 7 Okt. 2023
Thanks for your input, How do I get remove of the black color inside the red circle?
Thank you.
Since only SOME of the black holes are to be filled and it's not clear what the criteria are, I think you'll have to use drawfreehand to get the coordinates of the red line, then use poly2mask to make a binary image mask of where you drew, and then do
handDrawnMask = poly2mask(x, y, rows, columns);
mask(handDrawnMask) = true;
See attached demos.
Rahmat Anbi Ancing
Rahmat Anbi Ancing am 8 Okt. 2023
I have tried, and it is correct to remove (the one inside the red line) manually, but how to remove it automatically? Should I define the x, y, width, and height values that I want to remove?
Image Analyst
Image Analyst am 8 Okt. 2023
The rows and columns are the same as for your image.
The x and y are the borders of the blobs you want to fill. You can use bwboundaries, but first you have to identify which blobs are to be filled and which are not, and like I said, I don't know how you're deciding that. If you can spell out some criteria, then it might be possible to do it automatically, but if you can't, then you'll have to do it manually. Since I mentioned earlier that I was not sure what the criteria for filling and not filling were, and you didn't answer that, I'm assuming that there is no repeatable definition, so in that case you have to do it manually.

Melden Sie sich an, um zu kommentieren.

Produkte

Version

R2022a

Gefragt:

am 1 Okt. 2023

Kommentiert:

am 8 Okt. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by