Computing pixels value(Uk,Uj) from U -Image in YUV color Space

조회 수: 1 (최근 30일)
Algorithms Analyst
Algorithms Analyst 2013년 2월 20일
댓글: iup geii amiens 2014년 5월 20일
Hi everyone
I want to compute the pixel values let say Uk and Uj from UImage.Here is my code in which I am doing indexing.
UImage=imread(Uimage);
B=ones(length(UImage));
slidingwindow=conv2(B,UIimage,'same');%this part computes only centre pixels.
[pixelrow pixelcol]=size(slidingwindow);%Pixelrow and pixelcol are center pixels of window
for windrow=-1:1
row=pixelsrow+windrow;
for windcol=-1:1
col=pixelscol+windcol;
%% here I need some piece of code further May be Uk=UImage(row,col)???????????
end end
  댓글 수: 1
iup geii amiens
iup geii amiens 2014년 5월 20일
Hello Sir,
I am working on the same sheet. Please can i have your code and we may help each other :D
I will be grateful Have a nice day

댓글을 달려면 로그인하십시오.

답변 (2개)

Thorsten
Thorsten 2013년 2월 20일
To get the pixel values of a gray scale image
I = imread('cameraman.tif');
x = 20; y = 30;
Ixy = I(y, x);
To get the G pixel value of an RGB image
I = imread('peppers.png');
IGxy = I(y, x, 2);
Same should work for your U image if you have stored just the U channel or all three channels in your image.
  댓글 수: 8
Algorithms Analyst
Algorithms Analyst 2013년 2월 20일
and what is Uj and Vj and how did you compute it?
Thorsten
Thorsten 2013년 2월 20일
편집: Thorsten 2013년 2월 20일
I assume that you refer to the paper http://philippe.noriega.free.fr/fichiers/visapp06.pdf
Then x and y are the location in the image where you compute your histograms. n = 12 is the size of your subwindow that is applied with a gap of 3 to your image.
To slide your window, use
gap = 3;
for x = 1:gap:size(I, 1)
for y = 1:gap:size(I, 2)
ind1 = y-n/2:y+n/2;
ind2 = x-n/2:x+n/2;
And for each location you need a third loop over the number of bins in your histogram
for j = 1:Nbins
dU = Uk(:) - Uval(j);
dV = Vk(:) - Vval(j);
Gj = Kj*exp(-(Du.^2+Dv.^2)/(2*sigma^2));
CH(x, y, j) = Gj;
end
end
end

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2013년 2월 20일
Your code is all wrong. Try this:
UImage=imread(Uimage);
windowSize = 5;
sigma = whatever.....
kernel = fspecial('gaussian', windowSize, sigma);
slidingwindow=conv2(UIimage, kernel ,'same');
You don't need double for loops after that - conv2 does the sliding window filtering so it's already done. No need to try to do it again manually.
  댓글 수: 9
Image Analyst
Image Analyst 2013년 2월 20일
Correct, but I haven't really tried to understand what the algorithm does. You're just blurring the U channel. Not sure if that's part of the algorithm or not - I'm just going by what you said.
Algorithms Analyst
Algorithms Analyst 2013년 2월 21일
Yeah. That's so interesting.In the color Gaussian kernel part of the algorithm two other pixels values from i and j locations are computed and they are VJ and Vk respectively.So I think they are taking just UV image from YUV colorspace by ignoring Y channel and computing the color gaussain kernel in UV color space.But anyway thanks for your time and concern.
Thanksssss......cheers..

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by