How to extract figure profile coordinates
이전 댓글 표시
Hello,
I am working on a substrate curvature driven tissue growth model.
I create a sinusoidal interface, evaluate the curvature of the profile at each point, evaluate the amount of tissue growth for each point (curvature dependent) at the current step and overwrite the figure showing the tissue deposited.
This is what I obtain, with "old" tissue painted in blue and growth tissue painted in red (no tissue growth where the curvature is negative):

Now I should repeat the process considering the new interface profile obtained after the tissue deposition.
How can I obtain the coordinates of the new profile points (as a 2D matrix) by this Figure keeping the same matrix size (199x199)?
I tried to use getframe but it acquires the profile with the screen resolution (much higer) and then I used the following code to extract the point coordinates:
binaryImage = BW < 1;
[rows, columns, numberOfColorChannels] = size(BW);
for c = 1 : columns
newprofile(c) = rows - find(binaryImage(:,c), 1, 'first') + 1;
end
This works but:
1) I don't know how to "rescale" it along both x and y axes.
2) The updated profile is not smooth (see next image) and that reflects on the curvature measurement in the following steps. I could extract the fitting law but I should still tackle the issue (1).

Thanks.
댓글 수: 2
DGM
2022년 7월 11일
How exactly is the plot being generated? If it's already a raster process, why not generate the working "image" in the workspace to begin with? Is that possible?
I generally suggest to consider figures as tools for visualization only, and to avoid using them as composition tools -- but I'm not sure if your case is one where it's easy to do that.
MarzioDG
2022년 7월 12일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!