identifying objects in a picture containing several objects
Mostrar comentarios más antiguos
I have a picture that contains more obiecte.Obiectele I have separated into smaller pictures (cut from full size) must make a sequence of code that I find an object and make a circle around him. 10x
Respuesta aceptada
Más respuestas (5)
Chandra Kurniawan
el 21 de Dic. de 2011
Just the same code.
You just need to change the I and J with your 'reference' image and the object
clear; clc;
I = imread('di-5Y01.jpg');
object = imread('di-FNMJ.jpg');
c = normxcorr2(object(:,:,1),I(:,:,1));
[max_c, imax] = max(abs(c(:)));
[ypeak, xpeak] = ind2sub(size(c),imax(1));
corr_offset = [(xpeak-size(object,2)) (ypeak-size(object,1))];
figure, imshow(I); hold on;
rectangle('position',[corr_offset(1) corr_offset(2) 30 60],...
'curvature',[1,1],'edgecolor','g','linewidth',2);
And the result :

5 comentarios
Tomescu
el 21 de Dic. de 2011
Image Analyst
el 21 de Dic. de 2011
The ellipse in the overlay is there from the call to rectangle() function. Just look it up in the help and modify its arguments. You shouldn't need Chandra to do that simple thing.
Tomescu
el 21 de Dic. de 2011
Arash
el 9 de Jul. de 2012
Hi Chandra,
How about the objects that have some rotation, I mean consider some frames and in each frame the object has a little rotation and translation, is it possible to detect the object in all of the frames? if yes How?
Thanks in advance,
Arash
jeyshree
el 7 de Ag. de 2013
hi, i used the above code.i downloaded an image from http://imageshack.us/photo/my-images/825/obiect10inpoza.png/ and used it instead of di-5Y01.jpg.similarly i downloaded the image in URL http://imageshack.us/photo/my-images/690/obiect5.jpg/ and used it instead of di-FNMJ.jpg.only i changed the images used.but still it is not detecting the cup from the image.what shall i do?
Tomescu
el 21 de Dic. de 2011
0 votos
Tomescu
el 21 de Dic. de 2011
0 votos
1 comentario
Image Analyst
el 21 de Dic. de 2011
This is not an answer. This should be a comment on someone's answer, which you did above, so you can delete this "answer" lest someone respond to it and then you mark this (your follow-up comment) as the solution.
sneha
el 18 de Abr. de 2012
0 votos
hi....experts.....sneha here..........very amazing detection of objects.....i also worked on license plate detection of car...can u give me this type of code for detecting car license plate...please.........m waitng for reply............
Francesco Violo
el 28 de Jul. de 2015
0 votos
Hello, I am Francesco , for a university work let me know if you can extract from a video the license plates of cars , and then get a file of alphanumeric text . Thank you, you can contact me also on francescoviolo8@yahoo.it
Categorías
Más información sobre Computer Vision with Simulink en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

