In: Electrical Engineering
Saliency detection using scale change.you have to take two window of different sizes and calculate the saliency by considering the feature vector.
if you know the answer then only write or else leave for other.
image processing ELECTRICAL.
i1 = imread('input_image.jpg');%Provide input image path
d= size(i1);
w = d(2);h = d(1);
md = min(w, h);%minimum dimension
cform = makecform('srgb2lab', 'whitepoint',
whitepoint('d65'));
lab = applycform(i1,cform);
l = double(lab(:,:,1));
a = double(lab(:,:,2));
b = double(lab(:,:,3));
smT = zeros(h, w);
off1 = int32(md/2); off2 = int32(md/4); off3 = int32(md/8);
for j = 1:h
y11 = max(1,j-off1); y12 =
min(j+off1,height);
y21 = max(1,j-off2); y22 =
min(j+off2,height);
y31 = max(1,j-off3); y32 =
min(j+off3,height);
for k = 1:w
x11 = max(1,k-off1); x12
= min(k+off1,width);
x21 = max(1,k-off2); x22
= min(k+off2,width);
x31 = max(1,k-off3); x32
= min(k+off3,width);
lm1 =
mean2(l(y11:y12,x11:x12));am1 = mean2(a(y11:y12,x11:x12));bm1 =
mean2(b(y11:y12,x11:x12));
lm2 =
mean2(l(y21:y22,x21:x22));am2 = mean2(a(y21:y22,x21:x22));bm2 =
mean2(b(y21:y22,x21:x22));
lm3 =
mean2(l(y31:y32,x31:x32));am3 = mean2(a(y31:y32,x31:x32));bm3 =
mean2(b(y31:y32,x31:x32));
cv1 = (l(j,k)-lm1).^2 +
(a(j,k)-am1).^2 + (b(j,k)-bm1).^2;
cv2 = (l(j,k)-lm2).^2 +
(a(j,k)-am2).^2 + (b(j,k)-bm2).^2;
cv3 = (l(j,k)-lm3).^2 +
(a(j,k)-am3).^2 + (b(j,k)-bm3).^2;
smTj,k) = cv1 + cv2 +
cv3;
end
end
imshow(smT,[]);
smT is the final result. if you have any doubt regarding the
question please comment. Thank you