clc
close all
clear all
I= imread('C:\Data\November\30\2.jpg');
imshow(I);
I=rgb2gray(I);
I=imresize(I,0.1);
I=edge(I,'canny');
[m,n]= size(I);
p=1;
for i=1:1:m
for j=1:1:n
if(I(i,j)==1)
x(p)=i;
y(p)=j;
p=p+1;
end
end
end
theta=0;
for theta=0:(pi/2):2*pi
for i1=1:1:(p-1)
figure(2)
hold all
plot3(y(i1)*sin(theta),(y(i1)*cos(theta)-(n*0.5)),-x(i1));
end
end
close all
clear all
clc
%imaqhwinfo;
%dev_info = imaqhwinfo('winvideo',1)
vid=videoinput('winvideo',1, 'YUY2_640x480');
%preview(vid);
im=getsnapshot(vid);
figure(),imshow(im);
%% conversion of data format optional
im=ycbcr2rgb(im);
figure(),imshow(im);
%% backup of image
I=im;
%%convert image to gray scale for edge detection
I = rgb2gray(I);
figure(),imshow(I);
%% Edge detection
I=edge(I,'canny');
figure(),imshow(I);
% I=edge(I,'sobel');
% figure(),imshow(I);
[m,n] = size(I);
p=1;
for i=1:1:m
for j= 1:1:n
if(I(i,j)==1)
x(p)=i;
y(p)=j;
p=p+1;
end
end
end
theta1=0;
for i11=1:1:(p-1)
x1(i11)= x(i11)*cos(theta1);
y1(i11)= x(i11)* sin(theta1);
z1(i11)=y(i11);
end
if(m>n)
finalmodel1= zeros(m,n,m);
else
finalmodel1= zeros(m,n,n);
end
x11=y1;
y11=m-x1;
plot3(x11,y11,z1,'*');
close all
clear all
clc
%imaqhwinfo;
%dev_info = imaqhwinfo('winvideo',1)
vid=videoinput('winvideo',1, 'YUY2_640x480');
%preview(vid);
im=getsnapshot(vid);
figure(),imshow(im);
%% conversion of data format optional
im=ycbcr2rgb(im);
figure(),imshow(im);
%% backup of image
I=im;
%%convert image to gray scale for edge detection
I = rgb2gray(I);
figure(),imshow(I);
%% Edge detection
I=edge(I,'canny');
figure(),imshow(I);
I=edge(I,'sobel');
figure(),imshow(I);
clear all
clc
%imaqhwinfo;
%dev_info = imaqhwinfo('winvideo',1)
vid=videoinput('winvideo',1, 'YUY2_640x480');
%preview(vid);
im=getsnapshot(vid);
figure(),imshow(im);
%% conversion of data format optional
im=ycbcr2rgb(im);
figure(),imshow(im);
%% backup of image
I=im;
%%convert image to gray scale for edge detection
I = rgb2gray(I);
figure(),imshow(I);
%% Edge detection
I=edge(I,'canny');
figure(),imshow(I);
I=edge(I,'sobel');
figure(),imshow(I);