• Support PF! Buy your school textbooks, materials and every day products Here!

Matlab images pixels invert

  • Thread starter Jordon
  • Start date
  • #1
1
0

Homework Statement



1.invert all pixel of a 20x20 window around I(X,Y)
2.set all pixel aroud the in the inverted images

Homework Equations


cant make work right way.
Please help me to solve problem.
Thanks,


The Attempt at a Solution


I=imread('test7.jpg'); % Load the image file and store it as the variable I.
x1=floor(rand*240+8);% generate random varible x1
y1=floor(rand*240+8);% generate random varible y1
for i=y1-7:y1+7
for j=x1-7:x1+7 % Show15x15 With (x,y) in the center
Ired(i,j)=I(i,j);
end
end
B=inv(Ired);
imshow(B); % show the modified image
 

Answers and Replies

Related Threads on Matlab images pixels invert

Replies
11
Views
8K
Replies
1
Views
2K
Replies
56
Views
11K
Replies
1
Views
984
Replies
1
Views
714
  • Last Post
Replies
4
Views
8K
Replies
4
Views
2K
Replies
4
Views
4K
  • Last Post
Replies
3
Views
2K
Top