this code is not working......pls give me a hint ....the input is a fingerprint image

조회 수: 1 (최근 30일)
clc;
close all; clear all;
[filename, pathname]=uigetfile({'*.bmp;*.jpg;*.tif;*.png;*.gif','All Image Files';... '*.*','All Files' },'mytitle');
a=strcat(pathname ,'/', filename);
I = imread(a);
small_img=I(210:220,210:220);
T=[0 0 0 0 0 0 0 1 0 0 0; 1 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 1 0; 0 0 0 1 0 0 0 0 0 0 0; 0 1 0 0 0 0 0 0 0 0 0; 0 0 1 0 0 0 0 0 0 0 0; 0 0 0 0 1 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0 1; 0 0 0 0 0 1 0 0 0 0 0; 0 0 0 0 0 0 1 0 0 0 0; ] figure(1);imshow(small_img); J=mtimes(small_img,T); figure(1);imshow(J);
  댓글 수: 1
Jan
Jan 2013년 5월 24일
A copy of the error message is much better than just claiminh, that the code does not work.
The brute clearing header "clc, close all; clear all" deletes all breakpoints in the code, such that debugging is impeded. This is a really bad idea, because the debugger is the best friend of the programmer. In addition "clear all" deletes all loaded files from the memory, and reloading them from the disk wastes a lot of time. Therefore it is frightening, how many beginners use this brute header. It seems like an ugly fashion without benefits.

댓글을 달려면 로그인하십시오.

채택된 답변

Chiranjit
Chiranjit 2013년 5월 23일
Hi Arul
small_img is 2*2 matrix are you sure you want to use imshow on it? Also can you please specify what error it is exactly producing?
  댓글 수: 2
Arul
Arul 2013년 5월 24일
편집: Arul 2013년 5월 24일
?? Error using ==> mtimes Inner matrix dimensions must agree.
Error in ==> matrix at 31 J=mtimes(small_img,T);
this was the error occured during run this code.....need not to show the small_img...it is for our convenience.......this code is used to interchange the position of matrix values among the image...
Arul
Arul 2013년 5월 24일
we may use J=small_img*T instead of mtimes(small_img,T);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by