フィルターのクリア

i want to add rows and columns to a binary image

4 ビュー (過去 30 日間)
Raghu Rao
Raghu Rao 2017 年 2 月 21 日
コメント済み: Walter Roberson 2017 年 2 月 22 日
Hi, am working on words i want to add rows and columns to a binary image based on threshold values and also add nodes based on center of mass. please help me and i have attached an images for your refernces
  5 件のコメント
Raghu Rao
Raghu Rao 2017 年 2 月 22 日
Thank you Mr.Walter Roberson i have inserted row and columns to the binary image i get the image in grid view in this i want to find foreground pixel in each segments in the image {example.jpg}
Walter Roberson
Walter Roberson 2017 年 2 月 22 日
I need you to say clearly that you want to overwrite parts of the binary image, or that you want to conceptually break the image up into parts without actually changing the image.

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

回答 (1 件)

Image Analyst
Image Analyst 2017 年 2 月 21 日
You can use padarray() to add any number of rows or columns to any side.
  5 件のコメント
Image Analyst
Image Analyst 2017 年 2 月 22 日
bw = ones(3, 5)
% Add one row to the top, 2 rows to the bottom,
% 3 columns to the left, and 4 columns to the right
bw2 = padarray(bw, [1, 3]);
bw2(6,12) = 0
And get this:
bw =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
bw2 =
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 1 1 0 0 0 0
0 0 0 1 1 1 1 1 0 0 0 0
0 0 0 1 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
Raghu Rao
Raghu Rao 2017 年 2 月 22 日
thank you its working

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

カテゴリ

Help Center および File ExchangeGet Started with Image Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by