How to remove background from an image?
显示 更早的评论
Hello,
I'm doing project on object recognition, and in one of my module, i need to extract the feature but for that removal of background is necessary.. so how can i do this?? please help me!
The link for database which i am referring is as mentioned below, http://www.imageprocessingplace.com/downloads_V3/root_downloads/image_databases/MPEG7_CE-Shape-1_Part_B.zip
Thanks!
采纳的回答
In every one of the images in that .zip file, the background has already been removed.
Removal of background is what you do when you have a picture of a real object, or at least a model of that object whose picture has been taken. For example if you had a picture of an apple sitting on a plate, you would need to remove the plate (and the table and everything else that was not the object of interest.)
15 个评论
sir here all the images contains only one object!! i just need to remove that black background, so i would like to know, how can i do this??
What would you like to replace the black background with?
black background with nothing!! i just want to remove that.
Wait... I think I may finally have it:
C = num2cell(YourImage);
C(~YourImage) = {};
This will give you a cell array in which there are empty cells ("nothing") where the background was, and cells containing [1] where the foreground was.
sir it gave me an error 2nd line.
The error is " In an assignment A(:) = B, the number of elements in A and B must be the same."
C = num2cell(YourImage);
C(~YourImage) = {{}};
yes sir it worked but sir how can i make it visible??
Oh, if you want to make it visible, you use the technique I told you to use before:
imagesc(YourImage, 'AlphaData', YourImage)
colormap(gray)
set(gca, 'color', 'none')
Depending on what you have done before in that session you might need to add
set(gcf, 'renderer', 'opengl')
It worked!!
Thanks a ton sir, you helped me through out! Thanks once again!
Sir with this code i implemented to my histopathological image.... now i need to calculate statistical and textural features... how can i process it again.. i have segmented cell as in color cell segmentation in matlab.. now with this code removed the black color... but hw can i proceed with further processing. give ur suggestion sir.. i've tried cell2mat ,, but its not supporting...
Please start your own question. Upload your image , then tell us where it is. You also would need to explain, in that new question, what exactly "further processing" means because that is way too vague to answer.
Sir i doing Pattern recognition Letters Project.. I see the lot math works web page . But i have don't collect How to Remove background from image? I need the coding for remove background from the image..... Advance Thanks...
sir i am doing dust particle monitoring project for this i have to remove all background expect dust particle from the image... What should i do? Could you suggest me some matlab codes?
Sneha Rauniyar I recommend you start a new Question, and post a couple of images. You will need to clarify how you know whether a particular dust particle is a foreground dust particle to be kept, or a background dust particle to be removed.
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Language Support 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
