6 views (last 30 days)
Condition for region growing are as follows :
  1. The pixel should not already belong to a region. p(i,j) does not belong to R.
  2. The pixel is not part edge detected. p(i,j) does not belong to E.
  3. The pixel should not be be similar to seed pixel P(i; j)
after using edge detection.
selected the seed pixel from bottom of the image, the seed pixel in the row should be equal median value of the row.
mg1= imread('IMAGE.JPG');
e1= edge(img,'canny');
%%seed pixels
[rows, columns, numberOfColorChannels] = size(e1);
y = int16(columns/2);
x= rows;
Iintialseed = e1(x,y);
Gseed = imgradient(e1(x,:)); % (gradient value of row)
Should the gradient value be checked for 0 and 1? Or for 0 to 255?
How do I check the whether a pixel belongs to region and edge detected data?

Answers (1)

Image Analyst
Image Analyst on 30 Dec 2015
Try grayconnected():
BW = grayconnected(I,row,column) finds connected regions of similar intensity in the grayscale image I. You specify the intensity value to use as a starting point, the seed pixel, by row and column indices. By default, grayconnected includes connected pixels with values in the range [seedpixel–32,seedpixel+32] for integer-valued images and within the range [seedpixel-0.1,seedpixel+0.1] for floating point images. grayconnected returns a binary mask image, BW, where all of the foreground pixels are 8-connected to the seed pixel at (row, column) by pixels of similar intensity.

Community Treasure Hunt

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

Start Hunting!