Region according to value

조회 수: 3 (최근 30일)
Rutuja Kate
Rutuja Kate 2017년 11월 21일
댓글: Image Analyst 2017년 11월 21일
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
Image Analyst
Image Analyst 2017년 11월 21일
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 2017년 11월 21일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2017년 11월 21일
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
Rutuja Kate
Rutuja Kate 2017년 11월 21일
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 2017년 11월 21일
So did you try what I said - to use imdilate? If not, why not?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by