2012-11-24 49 views
2

我的主要動機是從簡單的RGB圖像(來自我的網絡攝像頭的圖像)中檢測手。 我發現了一個示例代碼find_hand_point如何創建Kinect深度圖像?可以將簡單的RGB圖像轉換爲像這些深度圖像的圖像嗎?

function [result, depth] = find_hand_point(depth_frame) 

    % function result = find_hand_point(depth_frame) 
    % 
    % returns the coordinate of a pixel that we expect to belong to the hand. 
    % very simple implementation, we assume that the hand is the closest object 
    % to the sensor. 

    max_value = max(depth_frame(:)); 
    current2 = depth_frame; 
    current2(depth_frame == 0) = max_value; 
    blurred = imfilter(current2, ones(5, 5)/25, 'symmetric', 'same'); 
    minimum = min(blurred(:)); 
    [is, js] = find(blurred == minimum); 
    result = [is(1), js(1)]; 
    depth = minimum; 

結果變量是最近的東西到相機(手)的座標。

從超高動力學裝置的深度圖像被傳遞給該函數,其結果是爲:

http://img839.imageshack.us/img839/5562/testcs.jpg

綠色矩形示出最接近於相機(手)。

問題:

  1. ,我的筆記本電腦的攝像頭能捕捉不是深度圖像,但都是簡單的RGB圖像的圖像。
  2. 有沒有辦法將我的RGB圖像轉換爲這些深度圖像?
  3. 有沒有一種簡單的替代技術來檢測手?
+1

此[鏈接]以檢測手(http://www.cs.washington.edu/rgbd-dataset/software.html)有太多的消息,但希望你找到一些方向。但我確實記得我們使用了一個內部庫來將大多數凸輪圖片轉換爲圖像處理的深度。我會發布 – bonCodigo

+0

謝謝朋友:)如果我真的可以從我的24位RGB圖像中創建這些24位深度圖像,那將非常有幫助。請向我介紹該庫及其可以幫助的功能! – khurram

+0

您給出的鏈接主要關注的是從深度圖像轉換爲不到深度圖像 – khurram

回答

1

Kinect使用額外的傳感器來檢索深度數據。單個攝像頭圖像中沒有足夠的信息來重建3D圖片。但是可以根據一系列圖像做出深遠的估計。這是XTR-3D及類似解決方案的原理。

+0

是啊!我認爲是時候接受真相了:p – khurram

1

一個更簡單的方法可以在http://www.andol.info/hci/830.htm

在那裏找到了筆者的RGB圖像轉換爲HSV,他只是不斷的H,S和V值的具體範圍,他假設是手狀的顏色。

在Matlab中:

function [hand] = get_hand(rgb_image) 
    hsv_image = rgb2hsv(rgb_image) 
    hand = ((hsv_image(:,:,1)>= 0) & (hsv_image(:,:,1)< 20)) & ((hsv_image(:,:,2)>= 30) & (hsv_image(:,:,2)< 150)) & ((hsv_image(:,:,3)>= 80) & (hsv_image(:,:,3)< 255)) 
end 

hand=...會給你一個矩陣,將在像素1S其中

= H < 20和30 < = S < 150和80 < = V
+0

是的,我已經經歷了這一點:p 我實際上使用java opencv和matlab已經爲我的應用程序 結合在C代碼將創建一塌糊塗,如果你能提出相應的建議,我將不勝感激。 – khurram

+0

Woah:將rgb轉換爲hsv後的p值你想要做什麼..請編輯你的原始答案並在那裏給出正確的格式化代碼:) – khurram