Cross-Correlation between 2 images
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
How to select a random POINT on one image than find its corresponding POINT on the other image using cross correlation?
So basically I have image1, I want to select a point on it (automaticaly) then find its corresponding/similar point on image2.
Thanks,
採用された回答
Image Analyst
2014 年 3 月 8 日
You can't do it for a point. Let's say the point in image1 has a value of 100. Well there are lots of points in image2 that might have that value. So you need to look at either the whole image or a window/patch. To look at the whole image and align the two, use imregister(). To look at just a small part of image1 (a template) and find it in image2, use normalized corss correlation, as illustrated in my attached demo.

12 件のコメント
Ramo
2014 年 3 月 8 日
I want to get 4 points if possible, and want them to be as seperated as possible. I have tried something like C_1 = normxcorr2(image1, image2); however C_1 changes size then you cant get the actual points on image1 and 2. even if i use a template It would still change the size of C_1
Image Analyst
2014 年 3 月 8 日
Please illustrate with screenshots, diagrams, figures, etc. Because as I see it, to get the 4 points as separated as possible you'd just take the 4 corners of the image.
Ramo
2014 年 3 月 8 日


Ramo
2014 年 3 月 8 日
each image is 1700by2300 and C_1 is 4500, If i take the peak I cant show it on image 1 or 2
Image Analyst
2014 年 3 月 8 日
Somehow I managed to do it. Study my code and see how I located the white onion in the original image.
Ramo
2014 年 3 月 8 日
xPeak and yPeak are not the coordinates of the onion on the actual image (peppers.png). Its the point on the NCC output, which is not the same.
Image Analyst
2014 年 3 月 8 日
See the code for how I turned the location of the peak location of the correlation image into a location on the original image. You know I did it - you can see it right there . Look how the green box is correctly positioned. It's not an impossible task - I did it.
Ramo
2014 年 3 月 8 日
I have tried doing the same thing, which is basically subtracting the size of the template, but still wouldnt work for my images?
Image Analyst
2014 年 3 月 8 日
Do you want me to do anything to help?
I want the point of the bright spot on the NCC graph on the actual image.
imgray = rgb2gray(image);
imgray2 = rgb2gray(image2);
template = imgray(200:600,540:end);
C_1 = normxcorr2(template, imgray);
C_2 = normxcorr2(template, imgray2);
[y1, x1] = find(C_1 == max(abs(C_1(:))));
[y2, x2] = find(C_2 == max(abs(C_2(:))));
so here i took the highest point of C_1 and C_2, but they are not actual points on image1 and image2. i have subtracted the template size but still wont give me the right points?
Image Analyst
2014 年 3 月 8 日
When you correlate, the output image is larger. So coordinates are not the same. If you want, you can crop out the central part that is the same size as the large image. If you crop it out correctly (watch out because it may be off a pixel or so depending on exactly where you crop and if the image size is even or odd), then the coordinates should be the same.
the image is 1728by2304, template 1251by955 and C_1 is 2978by3258
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Read, Write, and Modify Image についてさらに検索
参考
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)
