Getting rid of a black background surrounding an Image
이전 댓글 표시
Hello, I was wondering how it would be possible to get rid of a black background that I have in an image. My teacher says to use a "green screen", but I do not see how it works for my image. bg is the fixed scene in which my image will be moving across. I understand that he made the black canvas by using the zeros function, but I cannot get it to work with my image. His image that he used also had a black background and his image resulted in only the colored image that he wanted. My image is this: http://www.buzzle.com/articles/how-to-make-a-paper-airplane.html
Here's the code that he used:
[row col pg] = size(bg);
pg = zeros(row,col,'uint8');
canv = cat(3,pg,pg,pg);
image(canv)
답변 (1개)
[row col pg] = size(bg);
pg = zeros(row,col,'uint8');
gr = 255*ones(row,col,'uint8');
canv = cat(3,pg,gr,pg);
image(canv)
댓글 수: 9
Billy
2012년 12월 2일
Vieniava
2012년 12월 2일
I have just edited (255 multiply) my answer
Vieniava
2012년 12월 2일
could you paste all your code?
Billy
2012년 12월 2일
Vieniava
2012년 12월 2일
what is the foreground and what is the background?
Billy
2012년 12월 2일
Vieniava
2012년 12월 2일
How does wind_turbines.jpg look like? How does airplanes.jpg look like?
카테고리
도움말 센터 및 File Exchange에서 Simulink 3D Animation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!