How do i fit a square around a point in an image?

1 visualizzazione (ultimi 30 giorni)
burges
burges il 18 Mar 2017
Commentato: Image Analyst il 19 Mar 2017
I have the image:
I = [1 1 1 3 3 3 3 3
1 1 1 1 3 3 3 3
1 1 1 1 3 3 3 3
1 1 1 1 2 2 2 3
1 1 1 1 2 2 2 3
1 1 1 1 2 2 2 3
1 1 1 1 2 2 2 2];
How can i fit a square of size say two pixels around the point (4,6)? Many thanks for your help/suggestions.

Risposte (1)

Walter Roberson
Walter Roberson il 18 Mar 2017
If you are asking to draw a square on the screen then use rectangle()
  1 Commento
Image Analyst
Image Analyst il 19 Mar 2017
"i fit a square of size say two pixels"
"my actual intention is to get the area of the square"
So if your square is 2 pixels by 2 pixels, then your area will be 4 pixels. Why do you even need to ask?

Accedi per commentare.

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by