Skip to content

Commit

Permalink
Use grayscale image for census transform
Browse files Browse the repository at this point in the history
  • Loading branch information
sometimesfood committed May 27, 2011
1 parent 238d4f9 commit abb0ea5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions censusTransformImage.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
function censusTransformedImage = censusTransformImage(image)
censusTransformedImage = zeros(size(image)-2, 'uint8');
[height, width] = size(image);
grayImage = rgb2gray(image);
censusTransformedImage = zeros(size(grayImage)-2, 'uint8');
[height, width] = size(grayImage);
for x = 2:width-1
for y = 2:height-1
censusTransformedImage(y-1, x-1) = censusTransform(image, x, y);
censusTransformedImage(y-1, x-1) = censusTransform(grayImage, x, y);
end
end
end

0 comments on commit abb0ea5

Please sign in to comment.