Created
February 1, 2012 19:45
-
-
Save semihozkoroglu/1718869 to your computer and use it in GitHub Desktop.
Görüntü lab final son soru cevabı..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renk_sayisi=different() | |
I = imread('autumn.tif'); | |
J = {}; | |
[R C L] = size(I); | |
for r=1:R | |
for c=1:C | |
if ( bul(J,I(r,c,1),I(r,c,2),I(r,c,3))) | |
J{length(J)+1} = [I(r,c,1),I(r,c,2),I(r,c,3)]; | |
end | |
end | |
end | |
renk_sayisi = length(J); | |
function ret = bul(J, x, y, z) | |
ret = 1; %yok olark ilkle | |
for i = J | |
if (J{1}(1) == x & J{1}(2) == y & J{1}(3) == z) | |
ret = 0; %bulduk | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment