MATLAB標記圖像中特殊的點
使用plot函數進行標記:
%% 使用plot函數進行標定
clear; clc; close all;
img = imread('灰度.jpg'); % 讀取圖片
pixel_max = max(max(img)); % 獲取需要的值
pixel_min = min(min(img));
[img_max_x,img_max_y] = find(img == pixel_max); % 找到合適的坐標
[img_min_x,img_min_y] = find(img == pixel_min);
figure;
imshow(img); % 顯示圖像
hold on;
plot(img_max_y,img_max_x,'.r'); % 標定相應的點
plot(img_min_y,img_min_x,'.g');
效果顯示: