How to divide an array of matrix into two halves using mean distance

I would like to know how to divide this array R1=R(70:194,10:224) into two equal halves? I want to know the central coordinate. for that should i calculate the distance between the two extremes and then calculate mean? If yes, then how to calculate the distance between the co ordinates?

3 件のコメント

Andrei Bobrov
Andrei Bobrov 2014 年 4 月 22 日
How to divide?
Josephine
Josephine 2014 年 4 月 22 日
meaning segment it ...
Image Analyst
Image Analyst 2014 年 4 月 22 日
That's not usually what it means to segment an image. See http://en.wikipedia.org/wiki/Image_segmentation

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

 採用された回答

Mischa Kim
Mischa Kim 2014 年 4 月 22 日
編集済み: Mischa Kim 2014 年 4 月 22 日

0 投票

Josephine, the matrix is a 125-by-215 (row-by-column)
size(R1)
ans =
125 215
therefore, you can't evenly split it into two halves. The center row and column are #62 and #107, if that helps at all.

4 件のコメント

Josephine
Josephine 2014 年 4 月 22 日
編集済み: Josephine 2014 年 4 月 22 日
Dear Kim, Doesn't matter if its not equally dividing. How did u get 62 and 107 as the central co ordinate Thank you, I can divide it using the co ordinate (62,107). Can you explain ?
Mischa Kim
Mischa Kim 2014 年 4 月 22 日
floor(size(R1)/2)
Josephine
Josephine 2014 年 4 月 22 日
Thank you so much, Mr. Kim
Image Analyst
Image Analyst 2014 年 4 月 22 日
But actually 63 and 108 are the centers - think again and you'll see why. 63 has 62 on one side, 62 on the other side, and then include the central row and you get 125. So you should use ceil() and not floor().

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by