Cross-Correlation between 2 images
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
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일
3 개 추천
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에서 Template Matching에 대해 자세히 알아보기
참고 항목
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)
