Error using vertcat Dimensions of matrices being concatenated are not consistent.
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
sir i m getting this error i dont know how to rectify it please help me
%%appendimages
% im = appendimages(image1, image2)
%
% Return a new image that appends the two images side-by-side.
function im = appendimages(image1, image2)
% Select the image with the fewest rows and fill in enough empty rows
% to make it the same height as the other image.
rows1 = size(image1,1);
rows2 = size(image2,1);
if (rows1 < rows2)
image1(rows2,1) = 0;
else
image2(rows1,1) = 0;
end
% Now append both images side-by-side.
im = [image1 ; image2] %%in this line im getting error.
thanks with regards
댓글 수: 2
@vani shree: please tell us the exact outputs from these commands:
size(image1)
size(image2)
sir it does not show any output. but my input file of image1 and image 2 is
채택된 답변
Instead of adding extra zeros, you can resize the images to same dimensions. you may consider the following:
I1 = imread('ORIGINAL1.jpg') ;
I2 = imread('FAKE.jpg') ;
if numel(I1)>numel(I2)
I2 = imresize(I2,[size(I1,1) size(I1,2)]) ;
else
I1 = imresize(I1,[size(I2,1) size(I2,2)]) ;
end
I12 = [I1 I2] ;
figure
imshow(I12)
I12 = [I1 ; I2] ;
figure
imshow(I12)
댓글 수: 19
sir i get rid of that error. but again one more error like " error using horzcat dimensions of matrics being concatenated are not consistent." error in I12 = [I1 I2] ; line
What are sizes of I1 and I2 ?
I1 size is 37 kb and 234*234 dimension I2 size is 32.7kb and 236*234 dimension
@vani shree: the two images have different numbers of rows, therefore cannot be concatenated horizontally.
I said that, you can get them to same dimensions to join..I have given it in code..you accepted the answer and situation came to the question.
sir i acccept that answer but still it is showing me the same error. please guide me sir. im new to matlab. wat do i do now? can i give the same size of image?
same error i m getting sir" Error using horzcat Dimensions of matrices being concatenated are not consistent."
I12 = [I1 I2] ; in this line
Attach the images with which you have tried the above code.
good evening sir. origanal image will be my I1 and fake image will be my I2. sir i have attached my two images.
my code is
% code
function im = appendimages(image1, image2)
if numel(image1)>numel(image2)
image2 = imresize(image2,[size(image1,2) size(image1,2)]);
else
image1 = imresize(image1,[size(image2,1) size(image2,2)]);
end
im = [image1 image2];
figure
imshow(im)
im = [image1 ; image2]; figure imshow(im)
this is my code sir. and i have attached sift function call code also thank you very much sir
<<
<<

>>
>>
sir please help me. i m doing project based on this code sir
I will answer tomorrow..Morning.
thank you so much sir
my project title is Identifying fake products by matching their logos based on context. only 50% coding i have done sir. still matching process is pending.
image1 = imread('FAKE.jpg') ;
image2 = imread('ORIGINAL.jpg') ;
if numel(image1)>numel(image2)
image2 = imresize(image2,[size(image1,1) size(image1,2)]);
else
image1 = imresize(image1,[size(image2,1) size(image2,2)]);
end
im = [image1 image2];
figure
imshow(im)
im = [image1 ; image2];
figure
imshow(im)
I am not getting any error.
sir did u gave fake and original imag ?
sir when i run this code separately i m getting correct output. the problem is when i add function and map that function in another code file i m getting error sir. can you help me sir
sir when i gave another image it is not running sir. it shows same error Error using horzcat Dimensions of matrices being concatenated are not consistent.
Hello...Are both files RGB? There is a small correction...copy the code now and run.
thank you sir.. its running successfully. thank you very much. you explained me well.
추가 답변 (1개)
Image Analyst
2017년 4월 22일
A very general stitching app with a GUI is given here: http://www.mathworks.com/matlabcentral/fileexchange/25797-stitch
댓글 수: 1
thank you sir for sharing this gui file. sir can u help me to run ASIFT code in matlab. i have tried but i dont know how to run this sir.
카테고리
도움말 센터 및 File Exchange에서 Vehicle Dynamics Blockset에 대해 자세히 알아보기
참고 항목
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)
