Identifying objects in a picture containing several objects
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to find a object inside an image and I wrote code like down below, but I think in some part I made a mistake. It's showing me a different object than what I want.
Here is my code;
image = imread(['wheres_walle.png']);
bender = imread('bender.png');
imtool(image);
gray_img = rgb2gray(image);
gray_bla = rgb2gray(bode)
imtool(gray_bla);
I = gray_img
object = gray_bla
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);
0 comentarios
Respuestas (1)
Image Analyst
el 1 de Nov. de 2022
See my attached demo for finding a template in an image.
Or see examples in the Computer Vision Toolbox.
0 comentarios
Ver también
Categorías
Más información sobre Computer Vision with Simulink en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!