Pcolor: Draw a square around (highlight) a single pixel

4 ビュー (過去 30 日間)
Edward
Edward 2014 年 5 月 27 日
コメント済み: Image Analyst 2014 年 5 月 27 日
I would like to draw a square around a single pixel to emphasize it. I envision something like the default grid of pcolor, but only around a single pixel. Is this possible, or are there other ways to draw the eye to a single position on a pcolor grid?

回答 (1 件)

Image Analyst
Image Analyst 2014 年 5 月 27 日
You might try this:
Otherwise, just write into the columns and rows like you'd expect
yourImage(row-1:row+1, column - 1) = 255; % Left edge
yourImage(row-1:row+1, column + 1) = 255; % Right edge
yourImage(row-1, column) = 255; % Top edge
yourImage(row+1, column) = 255; % Bottom edge
  2 件のコメント
Edward
Edward 2014 年 5 月 27 日
Thank you for your prompt response. This is pretty much what I would like to do, but I was hoping to not have to change the image matrix C itself.
In my application, the C matrix is only ~30 by 20, so this approach would really impose itself on the presentation of the data.
Image Analyst
Image Analyst 2014 年 5 月 27 日
You can use plot() or line() to plot lines in the overlay above the image.

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by