How do I create 5x5 matrix from a binary image?

14 views (last 30 days)
The binary images I have appear in a 5x5 grid. But the grid can appear anywhere on the screen, and in different sizes. From the image, I need to produce a 5x5 matrix, 1s for white 0s for black. Any thoughts on how to accomplish this?
  2 Comments
Walter Roberson
Walter Roberson on 1 Aug 2016
At the moment the required result is ambiguous, as you have not defined that the visible grid will always occupy a visual 5 x 5 grid fully. For example at the moment we do not know that it is not possible for there to be
** *
****
* **
** *
which only occupies a 4 x 5 visual grid. The difficulty being that we would not know whether the row of black should be assumed to be on the top or the bottom.
Image Analyst
Image Analyst on 1 Aug 2016
Please insert a screenshot with the green and brown frame icon. Make it easy for us to see your images. It's not easy to see when they're in a .fig file. I have to save them to disk first then open them up in MATLAB. I didn't even bother to look at them. Make it easy for us, not hard.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!