how to select the parts in image that match the image i have in my database?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
i select certain part of an image and i its features in data base and then i use different images so i want to find out if features are in them or not
채택된 답변
Image Analyst
2013년 1월 8일
What do you mean by features? Do you mean that your "certain part of an image ... in data base" is contained as a sub-image in the "different images"? If so, you can use normxcorr2 (let me know if you want a demo). Otherwise you just have to compare feature vectors and you can do a weighted sum of differences. Or maybe you mean CBIR, like "show me all beach scenes" or "Show me photos of babies" or something like that.
댓글 수: 10
"features" i want to know if the images contain the part of image i had saved in my database .so i said if i can get it feature and the matching it with my images.
and demo of normxcorr2 is useful .
i don't familiar with CBIR what do mean of it it technique or what?
CBIR is "Content Based Image Retrieval" and is the name given to queries like I gave examples for.
Below is the demo of normxcorr2():
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures.
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
format longg;
format compact;
fontSize = 20;
% Check that user has the Image Processing Toolbox installed.
hasIPT = license('test', 'image_toolbox');
if ~hasIPT
% User does not have the toolbox installed.
message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')
% User said No, so exit.
return;
end
end
% Read in a standard MATLAB color demo image.
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
baseFileName = 'peppers.png';
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, 'file')
% Didn't find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, 'file')
% Still didn't find it. Alert user.
errorMessage = sprintf('Error: %s does not exist.', fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
rgbImage = imread(fullFileName);
% Get the dimensions of the image. numberOfColorBands should be = 3.
[rows columns numberOfColorBands] = size(rgbImage);
% Display the original color image.
subplot(2, 2, 1);
imshow(rgbImage, []);
axis on;
title('Original Color Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
smallSubImage = imcrop(rgbImage, [192 82 60 52]);
subplot(2, 2, 2);
imshow(smallSubImage, []);
axis on;
title('Template Image to Search For', 'FontSize', fontSize);
% Search the red channel for a match.
correlationOutput = normxcorr2(smallSubImage(:,:,1), rgbImage(:,:,1));
subplot(2, 2, 3);
imshow(correlationOutput, []);
title('Correlation Output', 'FontSize', fontSize);
[maxCorrValue, maxIndex] = max(abs(correlationOutput(:)));
[ypeak, xpeak] = ind2sub(size(correlationOutput),maxIndex(1));
corr_offset = [(xpeak-size(smallSubImage,2)) (ypeak-size(smallSubImage,1))];
subplot(2, 2, 4);
imshow(rgbImage);
hold on;
rectangle('position',[corr_offset(1) corr_offset(2) 50 50],...
'edgecolor','g','linewidth',2);
title('Template Image Found in Original Image', 'FontSize', fontSize);
my image(in my database) -lets called it target -is so small and the images contain many of my target image and i want to select all targets in the images. can this CBIR do that.
example
my target image is circle and my images contains many of circles so i want to select all circles in the image
Yes. That is the whole concept of CBIR. For example, find me all scenes in a movie with the sun in it. Or find me all scenes with a tree and a person. It is rapidly getting very sophisticated. Fast progress is being made. At the last Electronic Imaging meeting I saw some very impressive results, but there are still challenges of course.
Sorry but this code cant select the other Onion in the image even though it has the same color and Features
{Sorry for being late to respond but due to busy at work.And The time difference }
Correct. It was designed specifically not to do that -- not to produce false positives. The other onion is not the same even though it looks somewhat similar.
i want to select the other onion also and similar to it Features
Then you're wanting to get into the field of CBIR. I'm not an expert in that field. There are whole conferences on it though, plus plenty of literature. It's a growing field right now with the explosion of imagery available now and people wanting to search stock databases, the web, and videos. You will be able to find lots of people in that field without too much trouble and some of them may help you. For example, a web search on CBIR and section 19.4 of VisionBib.
thanks a lot "Image Analyst" and i will search for it on web
Thank you for your interest.
If we're done then please mark it as Accepted.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
참고 항목
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)
