Adding black border within video (similar to padarray)
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (2)
Keith
le 9 Août 2014
0 votes
Image Analyst
le 9 Août 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.
Catégories
En savoir plus sur Video Formats and Interfaces dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!