how can i get the indexes

조회 수: 1 (최근 30일)
shima said
shima said 2013년 8월 16일
|| I am working in CBIR by histogram color my prof just wants to test me if i understand it or no so it is not my final project
now I have file has 161 images inside and I have 10 query images
I have extracted histogram color for the images files and i put them in vectory then I compute Euclidean distance for each images for query image and images file and i put them all in vectory so now I have 10*161 .until here is my work is good ?? then now if I sort the vectory ok how could i get the reall index for the images have smallest Euclidean distance , I try to do this
[x, y] = sort[vectory4] and then take the index but it gave me the first 10 images in database not that i want .
hope anyone help me .
thank you ||*
  댓글 수: 2
Jan
Jan 2013년 8월 18일
It is hard to estimate if "I have 10*161" is correct or not. Actually "10*161" is 1610, but you certainly mean a matrix. Afterwards you are looking for a kind of sorting. But what is "vector4"?
shima said
shima said 2013년 8월 20일
"vector4" it is a vector where i put the result of compute Euclidean distance

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

채택된 답변

Image Analyst
Image Analyst 2013년 8월 18일
Did you look at the min function?
% Generate sample data.
array10by161 = randi(1000, [10, 161]);
% Find min distance for each image (each row)
% and it's location (column number)
[minDistances, indexOfMin] = min(array10by161, [], 2)
  댓글 수: 5
Image Analyst
Image Analyst 2013년 8월 21일
Well then, you're not building up your array properly. Isn't the row number the number of the image that you processed? So results from image #11 should have gone into row #11?
shima said
shima said 2013년 8월 21일
편집: shima said 2013년 8월 21일
yes each row for one query image so 10 rows * 161 Columns
let me explain more i meant the 10 queries image ok , in my database there is others images are similar to them so for example q1 have 4 similar images so i want to show all them for each image . hope u understand me . ur answered worked good but it just show me 10 images i need more .

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by