當我任何圖像上做segemtation它與背景和前景的表示返回一個圖像I-E的二值圖像。 現在如果我想使用的圖像的背景只爲任何目的.....怎麼辦it..i均值分割後我得到的二進制圖像現在如何識別(或服用)僅背景值。 ???????在Matlab分割後如何利用背景值從圖像?
0
A
回答
0
我假設你有一個灰度圖像。當你的分割目標爲1,背景爲0時,只需進行元素明智的矩陣乘法運算即可得到目標圖像。這與掩蔽相似。如果你只需要背景,你可以做(1 - 二進制圖像),並做相似的乘法與原始圖像。請記住,這是元素明智的乘法而不是矩陣乘法。
1
% Assume you have these variables:
% 'mask' - binary segmentation results, all 1's or 0's.
% 'img' - original image.
% 'bgImg' - Output, containing background only.
bgImg = zeros(size(img)); % Initialize to all zeros.
bg(mask) = img(mask); % Use logical indexing.
0
如果要衡量前景/背景區域的統計,一個有趣的選擇是regionprops
% img - variable containing original grey-scale image
% mask - binary mask (same size as img) with 0 - background 1 - foreground
% using regionprops to measure average intensity and weighted centroid,
% there are MANY more interesting properties ou can measure, use
% >> doc regionprops
% to discover them
st = regionprops(mask + 1, img, 'MeanIntensity', 'WeightedCentroid');
% get BG avg intensity:
fprintf(1, 'Avg intensity of background = %.2g\n', st(1).MeanIntensity);
相關問題
- 1. 分割從背景
- 2. 圖像分割(MATLAB)
- 3. Matlab - 顯示背景圖像
- 4. 如何在另一個背景圖像背後設置背景?
- 5. 圖像分割Matlab的
- 6. (OpenCV)前景和背景顏色相近的圖像分割?
- 7. matlab繪圖圖像作爲背景圖
- 8. 在背景圖像背景圖像
- 9. 使用MATLAB分割圖像處理
- 10. 如何在matlab中查找圖像分割部分的厚度?
- 11. 設置股利背景圖像
- 12. 如何使用MATLAB檢索任意圖像的背景顏色?
- 13. 分類圖像div背景
- 14. 如何從圖像中提取背景?
- 15. Matlab - 忽略圖像的背景
- 16. 背景減法後如何檢測分割對象?
- 17. 如何在opencv中將背景與前景圖像分開
- 18. 在matlab中從視頻中減去背景圖像
- 19. 分割和中心視口高背景圖像
- 20. C#面板背景圖像滾動分割
- 21. CSS垂直居中分割背景圖像不重疊
- 22. MATLAB中的圖像分割算法
- 23. 肝臟的Matlab圖像分割
- 24. matlab中的圖像處理(分割)
- 25. Matlab圖像分割和圓形識別
- 26. 如何做中值濾波利用MATLAB索引圖像呢?
- 27. JQuery SlideUp - 背景顏色背後圖像
- 28. 在分割視圖的根視圖中的UITableView中的背景圖像
- 29. 使用基於特徵點的MATLAB從背景中分割對象
- 30. 如何申請Matlab的模糊C均值(FCM)輸出用於圖像分割
你們,我有一個灰度圖像,我只是想,用1來表示的背景圖像(在分割後我的圖像的情況)。現在我想從背景像素形成原始圖像,並希望取平均值的背景像素。 – chee 2011-04-14 18:52:48
如果我有命名爲「IMG」 ..比我可以通過使用查找語句等的ind採取背景衣被合計分割圖像=找到(IMG == 1); BT它給了奇怪的事情..... – chee 2011-04-14 18:57:45
@chee請添加這些意見你的問題 - 他們使它更加清晰。 – Shai 2012-12-12 16:20:26