Computing Color Gaussian Kernel

Can anybody help me how to compute the color Gaussian Kernel described in the paper.I am confused what is Uj and Uk.
Thanks

2 commentaires

José-Luis
José-Luis le 18 Fév 2013
Modifié(e) : José-Luis le 18 Fév 2013
What have you done so far? What specific Matlab problems have you encountered in your implementation? Do you seriously expect someone to read a Paper and give you the code? For that please try the file exchange. Otherwise, people generally get paid for such tasks.
Algorithms Analyst
Algorithms Analyst le 18 Fév 2013
I am not expecting from anyone to implement it.As I have impelemnt it uptill Spatial Gaussian Kernel.Just need to get idea what is Uk and Uj for computing Color Gassian Kernel?For color Quantization I transformed rgbimage into YUV color space and then I selected only two of them U and V as described in the paper then I reduce UV image using Kmeans algorithm upto 40 after that I computer Spatial Gaussian Kernel now the Problem is how to compute du and dv as they did not described in detail what is Uk and UJ?I assumed they are two different clusters in U image?thats why i need to clear myself.
Thanks.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 18 Fév 2013

0 votes

You compute the YUV image from the RGB image. The Uk and Uj are just pixel values from the U image, taken from different locations, location j and location k. They are not clusters.

15 commentaires

Algorithms Analyst
Algorithms Analyst le 18 Fév 2013
So can I say that
[Uk Uj]=size(Uimage); ??? if not how can I extract these values. Thanks
Image Analyst
Image Analyst le 18 Fév 2013
No. Uk = U(rowAtSomePixel, columnForThatSamePixel).
Algorithms Analyst
Algorithms Analyst le 18 Fév 2013
ah.Ok can I say like I have Uimage and its size is 576x706 so
Uk=Uimage(111,111) and Uj=Uimage(115,115)
Is this good aproach?or impixel can solve this issue?
Thanks
Image Analyst
Image Analyst le 18 Fév 2013
That's a good approach. One of them is the pixel at the center of a sliding window - the Gaussian slides around your image. The other is one of the other pixels in the window, say one of the other 8 pixels surrounding the center pixel.
Algorithms Analyst
Algorithms Analyst le 18 Fév 2013
Can you post some piece of source code plz?
Thanks
Image Analyst
Image Analyst le 18 Fév 2013
Sorry, no I don't have time, as I said in your duplicate post, and as you said in this post " I am not expecting from anyone to implement it." FAQ: http://matlab.wikia.com/wiki/FAQ#Can_you_program_up_the_algorithm_in_this_article_for_me_and_explain_it_to_me.3F
Algorithms Analyst
Algorithms Analyst le 18 Fév 2013
Ok no problem.so every time if i want to change the pixel locations I can change like previous i choosed (111) and (115).is there any function for it???
You need a pair of nested for loops to index over rows and columns to get the value from every pixel in the window.
for windowRow = -1 : 1
row = pixelsRow + windowRow;
for windowCol = -1 : 1
col = pixelsCol + windowCol;
% Now do something with U(row, col).
end
end
pixelsRow and pixelsCol change - they're the center of the window as it moves around the image. You might have two outer loops over them.
Algorithms Analyst
Algorithms Analyst le 19 Fév 2013
Goood.But what should be the size of sliding window(i assumed the same length size as of UImage or 3x3 ) and how can i extract its centre pixels as I did it like that
UImage=double(UImage)
im=ones(3))/9; or im=ones(length(UImage))/9;
slidingwin=filter2(im,UImage); or slidwin=conv2(im,UImage);
Now
[pixelsrow pixelscol]=size(slidingwin);
for windrow=-1:1
row=pixelrow+windrow
for windcol=-1:1
col=pixelcol+windowcol
Uk=UImage(row);
Uj=UImage(col);
end end
Algorithms Analyst
Algorithms Analyst le 19 Fév 2013
Can I say that the centre of sliding window pixels are..
center_pixels=floor((size(SlidingWindow))+1)/2);
[pixelrow pixelcol]=size(center_pixels);
??????
I compute the window some other way like that but still did not find the Uk and Uj pixels.what should be te size of slidingwindow as in this case i assumed 512x512.
image=imread('UImage');
imageWidth = size(image, 2);
imageHeight = size(image, 1);
windowWidth = 512;
windowHeight = 512;
for j = 1:imageHeight - windowHeight + 1
for i = 1:imageWidth - windowWidth + 1
window = image(j:j + windowHeight - 1, i:i + windowWidth - 1, :);
[x y z]=size(window);
center_pixels=floor(([x y z]+1)/2);
[pixelsrow pixelscol colors]=size(center_pixels);
for windowrow=-1:1
row=pixelsrow+windowrow;
for windowcol=-1:1
col=pixelscol+windowcol;
Uk=window(row:row+windowrow-1);
end
end
Algorithms Analyst
Algorithms Analyst le 19 Fév 2013
Any help???
Image Analyst
Image Analyst le 19 Fév 2013
Algorithms Analyst
Algorithms Analyst le 20 Fév 2013
thanx.I appreciate you...
But if you have time then you can guide me.AS you told I did it like that
Image=imread('Uimage');
imageWidth = size(image, 2);
imageHeight = size(image, 1);
windowWidth = 100;
windowHeight = 100;
for j = 1:imageHeight - windowHeight + 1
for i = 1:imageWidth - windowWidth + 1
slidingwindow = image(j:j + windowHeight - 1, i:i + windowWidth - 1, :);
end
end
%%Now I got the sliding window and need to compute the centre pixels
center_pixels=floor(([x y z]+1)/2);
[pixelsrow pixelscol]=size(centre_pixel);
for windowrow=-1:1 row=pixelsrow+windowrow;
for windowcol=-1:1
col=pixelscol+windowcol
Uk=UImage(row);
Uj=UImage(col); end end
Thankyou once again for you concern.

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by