Region according to value

3 views (last 30 days)
Rutuja Kate
Rutuja Kate on 21 Nov 2017
Commented: Image Analyst on 21 Nov 2017
I have a pixellated 8*8 data set in which the pixels have value either 1 or 2.
1 1 1 1 1 1 1 1,
1 1 c2 2 2 1 1 1,
1 1 2 2 2 1 1 1,
1 1 2 1 2 2 1 1,
1 1 1 2 2 2 1 1,
1 1 1 1 2 1 1 1,
1 1 1 2 2 1 c1 1,
1 1 1 1 1 1 1 1,
There are 2 control points C1 and C2 which have their value as 0. I need to create a continuous region around the control points such that the region around C1 has a summation of the pixel value as 32 and the region around c1 has the value of 44. The summation of values in the dataset is 32+44=76. As I need to create a region, I thought of using the region grow algorithm using my control points as the seed point but it grows the region according to the similar intensity of pixels. Is there any way to do this? Thanks in advance.
  2 Comments
Image Analyst
Image Analyst on 21 Nov 2017
Explain in detail exactly how you get the 32 and 44 from a surrounding group of 1's and 2's.
Rutuja Kate
Rutuja Kate on 21 Nov 2017
If I start from c1 and start growing around it, acquiring neighbouring pixels, the pixels shown in bold satisfy the criteria. Once I finish this region, then I start from c2 and the rest of the pixels give me a value of 44.
1 1 1 1 1 1 1 1
1 1 c2 2 2 1 1 1
1 1 2 2 2 1 1 1
1 1 2 1 2 2 1 1
1 1 1 2 2 2 1 1
1 1 1 1 2 1 1 1
1 1 1 2 2 1 c1 1
1 1 1 1 1 1 1 1

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 21 Nov 2017
You can set c1 and c2 as "true" in a binary image and then repeatedly call imdilate() and then call reqionprops() to find out the resulting area after a layer of pixels has been grown around it. Or just compute the area you need and make a circle with that area centered at that point. See the FAQ
What do you really want to do? What's the use case?
  4 Comments
Rutuja Kate
Rutuja Kate on 21 Nov 2017
1 and 2 represent the population of the particular village.
when growing around c1, it will follow the 8-neighbour approach and calculate the total value of those 9 pixels. if the summation of values of the 9 pixels is less than the criteria of 32, it will again grow and occupy next neighbouring pixels. again it will calculate the summation of the values, and check against the criteria, it will continue to grow till the summation of the values is 32, and then it will terminate.
Image Analyst
Image Analyst on 21 Nov 2017
So did you try what I said - to use imdilate? If not, why not?

Sign in to comment.

More Answers (0)

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!