Image patching for computing Guassian Kernel
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
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 件のコメント
Algorithms Analyst
2013 年 2 月 8 日
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
Image Analyst
2013 年 2 月 8 日
You can use fspecial() to create a Gaussian kernel.
Algorithms Analyst
2013 年 2 月 8 日
fspecial('gauss',[12 12])
like that as they are using 12x12 size
Algorithms Analyst
2013 年 2 月 8 日
how can I find 12x12 local area from image?this would be the mask
Image Analyst
2013 年 2 月 8 日
You'd probably also want to specify the sigma in the third argument.
Algorithms Analyst
2013 年 2 月 8 日
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...
Image Analyst
2013 年 2 月 8 日
Algorithms Analyst
2013 年 2 月 8 日
Good but I did not find anything related to kernel in the above links.thanks for your concern.
Image Analyst
2013 年 2 月 8 日
fspecial() creates a matrix that can be used as a kernel/template/window in sliding window operations such as blockproc(), conv2(), imfilter(), etc.
Algorithms Analyst
2013 年 2 月 8 日
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
Algorithms Analyst
2013 年 2 月 11 日
looking for a help to solve this issue...
Image Analyst
2013 年 2 月 11 日
You don't compute them. They are the pixel distances and are already computed when fspecial() does its job.
Algorithms Analyst
2013 年 2 月 12 日
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.
Image Analyst
2013 年 2 月 12 日
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.
Algorithms Analyst
2013 年 2 月 12 日
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.
Algorithms Analyst
2013 年 2 月 12 日
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
Algorithms Analyst
2013 年 2 月 12 日
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 件のコメント
Algorithms Analyst
2013 年 2 月 12 日
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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
