function x=vidihsv(rgbImage)

rgbImage = imgaussfilt(rgbImage, 0.8);
% [rows columns numberOfColorBands] = size(rgbImage);
hsv = rgb2hsv(rgbImage);
hueImage = hsv(:, :, 1);
saturationImage = hsv(:, :, 2);
valueImage = hsv(:, :, 3);
% [pixelCounts values] = hist(hueImage, 500);
bluePixels = hueImage > 0.55 & hueImage < 0.7 & valueImage < 0.8 & valueImage > 0.2 & saturationImage > 0.4;
%bluePixels = hueImage > 0.5 & hueImage < 0.7 & valueImage < 1 & valueImage > 0 & saturationImage > 0.5;
binaryImage = bluePixels;
binaryImage = bwareaopen(binaryImage, 300);
se = strel('disk',50);
binaryImage = imclose(binaryImage,se);
binaryImage = imfill(binaryImage,'holes');

x=binaryImage;