Delete selected image in 2D array imtool

Hello,
below is the values in my 2D array represented using imtool. Is there a way to select one of the curve to be deleted but keep the rest the same (index and values of the curve that is not deleted the same). I need to do some calculations on one curve at a time without having the other curve values influence the calculation. Is there a way? Thanks so much.

댓글 수: 7

Jon
Jon 2023년 11월 1일
Please attach an example array. How do you identify the set of points that correspond to a curve?
DB
DB 2023년 11월 1일
attached is the array
Jon
Jon 2023년 11월 1일
Looks like the "curves" are made up of the points with negative values. Do you already have an algorithm for distinguishing the points that are in each individual curve?
Jon
Jon 2023년 11월 1일
편집: Jon 2023년 11월 1일
Actually, looking closer I see that the boundaries of the "curves" are the negative values, but the "curves" have some width. For example on the right hand edge we have a negative pixel at (48,168), but also one a little below that at (52,168). So what exactly do you mean by removing a curve? Is it all the pixels included between the boundaries as well as the boundary pixels?
In any case, how do you propose to identify the points that are in one "curve" from the points that are in the other "curve". Easy to see with the human eye, but what will you algorithm be?
DB
DB 2023년 11월 1일
I need to remove one "curve" - all pixels included between boundaries as well as the boundary pixels of that curve. I could do it in paint to color one of the "curve" with the same backround (black) for example so that there's only 1 curve that has different values than the background. Then I can read back that manipulated image. I'm just wondering if there's an easier way to do it all in matlab (such as imfreehand for example - but can it be done in imtool image?).
I don't have an algorithm to distinguish between those 2 curves since they're captured data.
Jon
Jon 2023년 11월 2일
Is the situation always quite similar to the one shown in the example image, that is, two similarly shaped "curves" with one translated vertically relative to the other?
DB
DB 2023년 11월 2일
in this test case, yes.

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

 채택된 답변

Image Analyst
Image Analyst 2023년 11월 2일

0 개 추천

No, there is no way to "paint" or mask pixels using imtool. You'll have to write a script for that. Demo attached.

댓글 수: 3

Jon
Jon 2023년 11월 2일
편집: Jon 2023년 11월 2일
For future reference, is there some algorithmic approach that could be used to automate the op's task? It's interesting that it is immediately clear to a human how that there are two translated "curves" in this image, and a human could easily, "paint" over the pixels in one of the "curves", but is not obvious (at least to me) how/if you could automate this.
Image Analyst
Image Analyst 2023년 11월 3일
@Jon yes, there are automatic ways. I made a partial stab at it but it's not done. It's only partially working and I don't have time to finish it. I've attached as far as I got. It will take maybe another half hour or hour to finish it and I don't have time. Finish it if you want.
Jon
Jon 2023년 11월 3일
Hi @Image AnalystThanks for sharing your code. It seemed like a challenging problem and I was interested to see how you would approach it. I will look through your code so I can learn more about how this type of problem can be solved.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

DB
2023년 11월 1일

댓글:

Jon
2023년 11월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by