フィルターのクリア

How to extract the content between the vertical lines drawn in an image?

1 回表示 (過去 30 日間)
Poornima Gokhale
Poornima Gokhale 2015 年 12 月 22 日
コメント済み: Meghashree G 2016 年 1 月 11 日
Hello, I have drawn the vertical lines and i want to extract the contents in between them.I have uploaded the code and the image also. Please help me with the code.

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 22 日
fullsegments = floor(columns/spacing);
partialsegment = columns - fullsegments * spacing;
segmentwidths = spacing * ones(1,fullsegments);
if partialsegment > 0
segmentwidths(end+1) = partialsegment;
end
segments = mat2cell(BinaryImage, rows, segmentwidths);
Now segments{1}, segments{2} and so on will be the portions between where the lines would be. If the spacing did not exactly divide the number of columns then the segments{end} will be width less than spacing.
  10 件のコメント
Walter Roberson
Walter Roberson 2016 年 1 月 11 日
Your code has
rectangle('Position',[value 3 2 40],'facecolor','g');
so you do know where the rectangles are going. They are going at row 3, column "value", width 2, height 40. If you prefer to work in the coordinates above, call imcrop() passing in that same vector you are passing in as your Position.
Meghashree G
Meghashree G 2016 年 1 月 11 日
i tried this,
imcrop(binaryImage,[value 3 2 40]);
but im not getting exactly sir.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by