Correlation of 300 frames
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Please provide a solution for how to find a correlation value for 300 frames by considering its pixel values and stored it in array or some memory space. For example if we found correlation of first and second image, we will get one correlation value like 0.9. Then we should find a correlation between second and third image, third and fourth, etc. Like this how to find for 300 adjacent images.
채택된 답변
Austin Thai
2021년 4월 17일
0 개 추천
You can use the 2-D correlation coefficient function
corr2(A,B)
Depending on how the data for your frames are stored, you can write a for loop to compare consecutive pairs.
For example, if you had a 3D array of frames called frameArray that is 512x512x300 :
imageCorrelation=zeros(299,1)
for i=1:299
imageCorrelation(i)=corr2(frameArray(:,:,i),frameArray(:,:,i+1))
end
댓글 수: 16
SUJITH D S
2021년 4월 17일
I'm having frame 0 to frame 299 in single folder
Austin Thai
2021년 4월 17일
편집: Austin Thai
2021년 4월 18일
Are you asking how to read the frames into matlab? I don't know what your filenames look like, but you should try the imread function first:
frameArray=zeros(512,512,300)
for i=1:300
frameArray(:,:,i)=imread(['frame' num2str(i-1) '.tif'])
end
Edit: I just realized you want 0 to 299 instead of 1 to 300. This should work then. Use this to import the frames and run the corr2 for loop in the main answer to get the coefficients. Just modify the filenames appropriately.
SUJITH D S
2021년 4월 17일
yea first i should read the 300 frames from frame0 to frame 299 which is stored in a folder... Then i should calculate the correlation of those 300 frames and that correlation values should be store in array sir
SUJITH D S
2021년 4월 17일
for corr2() which are the parameters i should pass.
Because frame0 to frame299 are in single folder.... Should I pass the whole folder... If i should can u please say how to pass
SUJITH D S
2021년 4월 17일
Can u provide complete code please
Austin Thai
2021년 4월 17일
Give me the name of your folder and an example name of your file.
SUJITH D S
2021년 4월 17일
folder name is images... file name is frame0
Austin Thai
2021년 4월 17일
What's the filetype?
SUJITH D S
2021년 4월 17일
frame0.jpg
Austin Thai
2021년 4월 17일
편집: Austin Thai
2021년 4월 18일
Okay, so if you're running in a directory containing the subdirectory "images", you can run the full code as:
frameArray=zeros(512,512,300)
for i=1:300
frameArray(:,:,i)=imread(['images/frame' num2str(i-1) '.jpg'])
end
imageCorrelation=zeros(299,1)
for i=1:299
imageCorrelation(i)=corr2(frameArray(:,:,i),frameArray(:,:,i+1))
end
SUJITH D S
2021년 4월 17일
Thank you so much sir
SUJITH D S
2021년 4월 17일
sir if there are 298 images... which value should be changed sir??
Austin Thai
2021년 4월 17일
편집: Austin Thai
2021년 4월 18일
I assume you're going from frame0 to frame297 now? Just modify the matrix sizes and for loop indices appropriately:
frameArray=zeros(512,512,298)
for i=1:298
frameArray(:,:,i)=imread(['images/frame' num2str(i-1) '.jpg'])
end
imageCorrelation=zeros(297,1)
for i=1:297
imageCorrelation(i)=corr2(frameArray(:,:,i),frameArray(:,:,i+1))
end
SUJITH D S
2021년 4월 17일
No sir frame0 to frame298
SUJITH D S
2021년 4월 17일
Please change and send the code sir it's more important for me sir please
SUJITH D S
2021년 4월 18일
Please can u solve this below error sir... I'm getting an error like this...
Subscripted assignment dimension mismatch.
Error in matlab1 (line 3)
frameArray(:,:,i)=imread(['images/frame' num2str(i-1) '.jpg'])
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
참고 항목
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)
