0% found this document useful (0 votes)
3 views20 pages

20bec048 Ip Sa Code

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 20

SPECIAL ASSIGNMENT

DEEP SPACE PROBE

Concept 1

(Detection of distance of stars from ISS)

Theory-

Further the star, more the distance light has to travel from it to the telescope and hence lesser the
intensity.

a=imread("C:\Users\Jugal\Downloads\th.jpg");
imshow(a);

b=rgb2gray(a);
imshow(b);

1
[c,d]=size(b);
for i=1:c
for j=1:d
if b(i,j)>50
b(i,j)=0;
end
end
end
imshow(b);

2
d=labeloverlay(a,b);
imshow(d);title('Detection of stars very far');

a=imread("C:\Users\Jugal\Downloads\th.jpg");
imshow(a);

3
b=rgb2gray(a);
imshow(b);

[c,d]=size(b);
l=graythresh(b);
for i=1:c
for j=1:d
if b(i,j)>l
b(i,j)=0;

4
end
end
end
imshow(b);

d=labeloverlay(a,b);
imshow(d);title('Detection of stars very far');

5
g=rgb2gray(a);
imshow(g);

[e,f]=size(g);
for k=1:e
for l=1:f
if g(k,l)<230
g(k,l)=0;
end
end
end
imshow(g);

6
d=labeloverlay(a,g);
imshow(d);title('Detection of stars very near');

Concept 2

7
(Meteor detection)

a=imread("C:\Users\Jugal\Downloads\beginners-guide-to-deep-space-photography-7.jpg");
imshow(a);

b=im2bw(a);
imshow(b);

8
d=labeloverlay(a,b);
imshow(d);title('Meteor detection');

9
Concept 3

(Finding approximate distance between 2 biggest galaxy)

clc;
close all;
clear all;
a=imread("C:\Users\Jugal\Downloads\OIP (5).jpg");
imshow(a);
b=im2bw(a);
imshow(b);
s1=strel('sphere',7);
d1=imerode(b,s1);
imshow(d1,[]);
[x,y]=size(d1);
e=[];

10
f=[];
for i=1:x
for j=1:y
if d1(i,j)==1
e=[e i];
f=[f j];
end
end
end
x1=min(e);
y1=min(f);
x2=max(e);
y2=max(f);
d=(((x1-x2)^2)+((y1-y2)^2))^0.5;
d %in light years

Concept 4

(Topography of a star)

a=imread("C:\Users\Jugal\Downloads\R (2).jpg");
imshow(a);

11
[x,y,z]=size(a);
for i=1:x
for j=1:y
if a(i,j,1)>a(i,j,2) && a(i,j,1)>a(i,j,3)
a(i,j,2)=0;
a(i,j,3)=0;
end
end
end
for i=1:x
for j=1:y
if a(i,j,2)>a(i,j,1) && a(i,j,2)>a(i,j,3)
a(i,j,1)=0;
a(i,j,3)=0;
end
end
end

12
for i=1:x
for j=1:y
if a(i,j,3)>a(i,j,2) && a(i,j,3)>a(i,j,1)
a(i,j,1)=0;
a(i,j,2)=0;

end
end
end
imshow(a);

Concept 5

(Speed of a star)

a=imread("C:\Users\Jugal\Downloads\ip-1.png");

13
b=imread("C:\Users\Jugal\Downloads\ip-2.png");
imshow(a);

imshow(b);

c=a-b;
imshow(c);

14
d=b+c;
imshow(d);

e=d-a;
imshow(e);

15
f=c+e;
imshow(f);

g=im2bw(f);
imshow(g);

16
[x,y]=size(g);
h=[];
i=[];
for j=1:x
for k=1:y
if g(j,k)==1
h=[h j];
i=[i k];
end
end
end
x1=min(h);
y1=min(i);
x2=max(h);
y2=max(i);
distance=(((x1-x2)^2)+((y1-y2)^2))^0.5;
distance %in 10^4 km

distance = 88.2836

%time=1 day
s=distance*10^4/(24);
s

s = 3.6785e+04

Concept 6

(Pseudo coloring)

a=imread("C:\Users\Jugal\Downloads\R (3).jpg");

17
imshow(a);

[x,y]=size(a);
b=zeros(x,y,3);
b=im2uint8(b);
for i=1:x
for j=1:y
if a(i,j)<100
b(i,j,1)=a(i,j);
end
end
end
for i=1:x
for j=1:y
if 100 <= a(i,j) && a(i,j)<130
b(i,j,1)=a(i,j);
b(i,j,2)=a(i,j);
end
end

18
end
for i=1:x
for j=1:y
if 130<= a(i,j) && a(i,j)<170
b(i,j,2)=a(i,j);
end
end
end
for i=1:x
for j=1:y
if 170<= a(i,j) && a(i,j)<200
b(i,j,3)=a(i,j);
b(i,j,2)=a(i,j);
end
end
end
for i=1:x
for j=1:y
if a(i,j)>=200
b(i,j,3)=a(i,j);
end
end
end

imshow(b,[]);

19
20

You might also like