Adding black border within video (similar to padarray)
Mostrar comentarios más antiguos
Hi, I am a new user to Matlab, and I was wondering if there is a function to add a black border within a video frame such that the size of the matrix does not change. Thank you in advance!
Respuesta aceptada
Más respuestas (2)
Keith
el 9 de Ag. de 2014
0 votos
Image Analyst
el 9 de Ag. de 2014
If you want a box over a live or recorded video that is playing, you can put hold on and then use plot() or line() to put up a frame/box in the overlay. Make the color black and the line width whatever you want
xBox = [x1,x2,x2,x1,x1];
yBox = [y1,y1,y2,y2.y1];
hold on;
plot(xBox, yBox, 'Color', 'k', 'LineWidth', 7);
This way might be faster since you don't actually have to change any image values and redisplay the new image - it all just happens in the overlay. The black box in the overlay "covers up" the underlying image. I do it all the time to show various region outlines over a live video stream.
Categorías
Más información sobre Video Formats and Interfaces 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!