Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.1K Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Extract a portion of an image

Posted 5 years ago

I've got an image and I want to obtain the centerlines of the image. (Input image) I could obtain the centerlines using the following commands

img = Input_image
gray = ImagePad[ImageCrop[ColorConvert[img, "Grayscale"], ImageDimensions[img] - 6],10]
bin = Binarize[gray, 0.07]
skeleton = Pruning[Pruning@Thinning[bin], 15]

Now, I would like to obtain the centerlines for a particular region of the original image ( the region below the white marking - image). Could someone suggest how this can be done?

POSTED BY: Natash A
5 Replies

AHA!! RemoveBackground did it. Problem solved!! Thanks

RJB

POSTED BY: Roger J Brown

That worked great, Thanks. But I still have the black background. I need that transparent. I will fiddle with Opacity to see if that works but if you have a better way please send it along.

POSTED BY: Roger J Brown

I have accomplished all of what is shown here successfully but have not been able to restore the B/W region to its original. ColorConvert does not seem to be the answer. What I am after is just the large foot in the attached notebook. Could you help me with this last step? Thanks.

POSTED BY: Roger J Brown
Posted 4 years ago

Hi Roger,

To apply a mask to an image, use ImageMultiply.

ImageMultiply[img, reg]
POSTED BY: Rohit Namjoshi
POSTED BY: Mikayel Egibyan
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard