I got 3 color blob(1,2,3).
Firstly, I want to write a loop to create a table which state which blob is connected with another blob.
Then, I want try to merge them to form a same blob.How to solve this?

 Akzeptierte Antwort

Image Analyst
Image Analyst am 27 Nov. 2015

0 Stimmen

It's a poor description of what's going on. I'm going to assume you have an image that you thresholded to get a binary image and then you called bwlabel() and label2rgb() to colorize the blobs differently. So you should have the binary image already. If you don't for some reason, and you don't have the labeled image either, you can recover it from using any
binaryImage = logical(any(rgbImage, 3));

6 Kommentare

Tan Wen Kun
Tan Wen Kun am 27 Nov. 2015
I doing image segmentation.
I trying to merge different blob together to form back the object.
So I need try merge on binary image or color blob?
Image Analyst
Image Analyst am 27 Nov. 2015
You're going to have to use the original color image along with the labeled image, not the labeled/colorized one.
Tan Wen Kun
Tan Wen Kun am 28 Nov. 2015
How to read the color pixel from a region and reassign color of one region to another?
Image Analyst
Image Analyst am 28 Nov. 2015
First of all you have to know what color you want to assign to the other region. Then you need to know the label of the region to accept the new color. Do you know that?
Tan Wen Kun
Tan Wen Kun am 28 Nov. 2015
Bearbeitet: Tan Wen Kun am 28 Nov. 2015
MyImage = imread('MyPicture.jpg')
PixelValue = MyImage(y,x); Gets the Pixel value at position y,x.
or using impixel to get it?
That will work for gray scale images. If it's color you need to do
PixelValue = MyImage(y, x, :);
or you can use impixel() for either color or gray scale images.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by