Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- photoRGB = imread('kck/jankos.jpg');
- photoHSV = rgb2hsv(photoRGB);
- [x, y, z] = size(photoRGB);
- photoAfterHSVFilter = ((photoHSV(:,:,1) <= 0.1 | photoHSV(:,:,1) >= 0.9) & ...
- (photoHSV(:,:,2) >= 0.2 & photoHSV(:,:,2) <= 0.6) & ...
- (photoHSV(:,:,3) >= 0.4));
- scale = 0.4;
- photoAfterScale = uint8(imresize(medfilt2(imresize(photoAfterHSVFilter, scale)),[x, y]));
- cuttedPhoto(:,:,1) = photoRGB(:,:,1) .* photoAfterScale;
- cuttedPhoto(:,:,2) = photoRGB(:,:,2) .* photoAfterScale;
- cuttedPhoto(:,:,3) = photoRGB(:,:,3) .* photoAfterScale;
- subplot(2,2,1);
- imshow(photoRGB);
- subplot(2,2,2);
- imshow(photoAfterHSVFilter);
- subplot(2,2,3);
- imshow(photoAfterScale .* 255);
- subplot(2,2,4);
- imshow(cuttedPhoto);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement