multiple ROI in 2 images
Mostrar comentarios más antiguos
I am trying to draw multiple ROI's in " different images ImgA & ImgB (which are the first 2 frames of a video). But, when I draw one ROI in imgA , it jumps to the step of identifying the salientpoints in the ROI and automatically the same ROI is displayed for imgB.
What change should I make here?
%%Load a video and draw ROI in the video/image frames
%%Input video file which needs to be stabilized.
filename = 'shaky_car.avi';
%Load the video using a video reader object.
videoFReader = vision.VideoFileReader(filename, ...
'ImageColorSpace', 'Intensity',...
'VideoOutputDataType', 'double');
%Create a video player object to play the video file
videoPlayer = vision.VideoPlayer;
while ~isDone(videoFReader)
frame = videoFReader();
videoPlayer(frame);
pause(0.01);
end
imgA = step(videoFReader);
imgB = step(videoFReader);
imshowpair(imgA,imgB,'montage');
objectRegion = round(getPosition(imrect));
objectImageA = insertShape(imgA,'Rectangle',objectRegion,'Color','red');
objectImageB = insertShape(imgB,'Rectangle',objectRegion,'Color','red');
figure;
imshowpair(objectImageA, objectImageB ,'montage');
title('Red box shows object region');
%Detect interest points in the object region.
pointsA = detectMinEigenFeatures(imgA,'ROI',objectRegion);
pointsB = detectMinEigenFeatures(imgB,'ROI',objectRegion);
%Display the detected points.
pointImageA = insertMarker(imgA,pointsA.Location,'+','Color','white');
pointImageB = insertMarker(imgB,pointsB.Location,'+','Color','white');
figure;
imshowpair(pointImageA,pointImageB,'montage');
title('Detected interest points');
release(videoFReader);
release(videoPlayer);
4 comentarios
Image Analyst
el 30 de Ag. de 2018
What line of code lets you draw the ROI, and what line of code (step) does it jump to after you draw it?
Meera chandran
el 30 de Ag. de 2018
Meera chandran
el 30 de Ag. de 2018
Meera chandran
el 3 de Sept. de 2018
Respuesta aceptada
Más respuestas (0)
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!
