필터 지우기
필터 지우기

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 CenterFile Exchange에서 Get 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