Image patching for computing Guassian Kernel
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hi every one
I want to patch the image for Spatial Guassian kernel calculation.with a oatch size 12x12.How can I do it
image=imread('lib.jpg');
patchsize=12;
image=patch(image,patchsize);
채택된 답변
Image Analyst
2013년 2월 8일
I don't know what you want to do, so I can't give an answer. (Try to explain better - upload a diagram or image if you think that would help explain)
But I do know that you should not use "image" as the name of your variable because you'll destroy the built-in function by that name.
댓글 수: 17
thats vey good.Actaully I am implementing the algorithm in this paper(<http://philippe.noriega.free.fr/fichiers/visapp06.pdf).I> am applying spatial gaussian kernel.I have quantize my image using kmeans algorithm in UV space.Now I want to compute spatial gaussian kernel.But I dont no the parameters they used just they showed sigma=3 but no clear informationhow did they compute dx and dy.I hink they used patching concept.can you please help me in this problem?with some piece of code.
Thanks
You can use fspecial() to create a Gaussian kernel.
fspecial('gauss',[12 12])
like that as they are using 12x12 size
how can I find 12x12 local area from image?this would be the mask
You'd probably also want to specify the sigma in the third argument.
Yes this is like that fspecial('gaussian',[12 12],3);
this is correct but as they explain that 'Pixels Sk(xk,yk) in a local area l are weigthed in terms of distance from the area centre. and dx=xk-xl
now what us xk and xl and how to compute them.as I am directly diving the size 12x12 in fspecial function.
Thanks...
Good but I did not find anything related to kernel in the above links.thanks for your concern.
fspecial() creates a matrix that can be used as a kernel/template/window in sliding window operations such as blockproc(), conv2(), imfilter(), etc.
Yes so it means I am right as I did
Gsk=fspecial('gaussian',[12 12],3);
this creates my 12x12 kernel.if I am not wrong. now what is xk and xl as they are computing spatial gaussian kernel like that
G=K/2*pi*sigma*exp(-(dx*dx+dy*dy)/2.sigma*sigma); where dx=xk-xl; dy=yk-yl;
As I got 12x12 kernel now how can I compute dx and dy.
Thanks
looking for a help to solve this issue...
You don't compute them. They are the pixel distances and are already computed when fspecial() does its job.
Yeah but when fspecial() does its job It is taking the normal distance like x.^2 and y,^2 but not the distance from its centre like dx=xk-xl.Can you please clearify it?Thank you.
Let's say you're way out at pixel (106, 106) and you want to filter that pixel with a 12 by 12 window that goes from (100,100) to (111,111). The pixel at the top of the window, 6 away from the center should be a Gaussian value 6 away from the peak, not 100 away, or 106 away, or whatever else you're thinking. That would be wrong if the 12x12 window is supposed to translate across the image filtering each pixel with a 12x12 neighborhood around it. Maybe look halfway down the page here http://www.songho.ca/dsp/convolution/convolution.html for an illustration.
Yes it is clear now that fspecial is doing its job...Thank you very much.. now the problem is in color gaussian kernel here.i have a UV image which is reduced by kmeans using 40 colors and I need to compute the color gaussian kernel.I think in this case i cannot use fspecial() to do its job.becasue
du=Uk-UJ and dv=Vk-Vj
so how can I compute CGK?becasue the du.^2 and dv.^2 changes again.
For more explanation let us suppose that I have a UV image in YUV color space.and I want to compute du=Uk-UJj and dv=Dk-Dj I think that in the paper k and j are two different colors if I am not wrong.Thanks
Can any one help me how to compute color gaussian kernel?
추가 답변 (1개)
I = im2double(imread('cameraman.tif'));
Gsk = fspecial('gaussian',[12 12],3);
Idxy = I - imfilter(I, Gsk);
댓글 수: 1
Image Analyst is right as he described above.
카테고리
도움말 센터 및 File Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기
참고 항목
2013년 2월 8일
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
