标签:blog http os ar 2014 sp log on c
clear all;close all;clc;
img=imread(‘E:\4.jpg‘);
subplot(121);imshow(img);
[x y]=size(img);%求像素大小!x=243,y=1026
img=double(img);%将img变成double类型的
%%sobel边缘检测
w=fspecial(‘sobel‘);%指定滤波器类型‘sobel‘
img_w=imfilter(img,w,‘replicate‘);%求横边缘
w=w‘;
img_h=imfilter(img,w,‘replicate‘);%求竖边缘
img=sqrt(img_w.^2+img_h.^2); %注意这里是平方和在开方
subplot(122);imshow(uint8(img))
impixelinfo;
A=ginput(3);
p= (A(1)+A(2)+A(3))/3;
q= (A(4)+A(5)+A(6))/3;
hold on;
plot(p,q,‘*‘);
[p,q] %质点坐标
标签:blog http os ar 2014 sp log on c
原文地址:http://www.cnblogs.com/qxql2016/p/3965106.html