是否有用於檢測在圖像平面中旋轉的臉部的庫?或者有什麼方法可以使用opencv進行直立人臉檢測級聯?旋轉臉部檢測
Q
旋轉臉部檢測
22
A
回答
2
樸素的方式:
- 生成角的列表(例如,從-170至180在10度的步驟)
- 對於列表中的每個角度
n
:由n
- 旋轉圖像度
- 旋轉圖像上的運行人臉檢測器
- 計算原始圖像中檢測到的人臉位置(撤消旋轉)
- 上從各個角度連接結果執行非最大抑制(你可能會得到多次檢測從鄰近的角度)基於顏色直方圖的人臉檢測
+1
這使得檢測非常緩慢,並返回更多的誤報,但可能是使哈爾檢測類型旋轉不變的唯一方法... – Ben 2011-11-18 11:41:15
0
方法是獨立的面部朝向的。
0
你可以使用袋子裏的單詞/袋子的特徵方法來約束AAM,ASM方法。 ,但它們也可以給出不是最優解收斂到全局最大值。
也haar-like-features只是功能的集合,你可以使用旋轉不變的功能,然後把它放在adaboost classifer。
6
這裏有一個簡單的我與Python CV2
這不是最有效的事情寫的,並且它使用etarion建議用簡單的方式,但它的工作原理相當不錯的只是正常的頭傾斜(從檢測什麼 - 40至40頭傾斜,這大概就像你可以傾斜你的頭留直立。
import cv2
from math import sin, cos, radians
camera = cv2.VideoCapture(0)
face = cv2.CascadeClassifier("haarcascade_frontalface_alt2.xml")
settings = {
'scaleFactor': 1.3,
'minNeighbors': 3,
'minSize': (50, 50),
'flags': cv2.cv.CV_HAAR_FIND_BIGGEST_OBJECT|cv2.cv.CV_HAAR_DO_ROUGH_SEARCH
}
def rotate_image(image, angle):
if angle == 0: return image
height, width = image.shape[:2]
rot_mat = cv2.getRotationMatrix2D((width/2, height/2), angle, 0.9)
result = cv2.warpAffine(image, rot_mat, (width, height), flags=cv2.INTER_LINEAR)
return result
def rotate_point(pos, img, angle):
if angle == 0: return pos
x = pos[0] - img.shape[1]*0.4
y = pos[1] - img.shape[0]*0.4
newx = x*cos(radians(angle)) + y*sin(radians(angle)) + img.shape[1]*0.4
newy = -x*sin(radians(angle)) + y*cos(radians(angle)) + img.shape[0]*0.4
return int(newx), int(newy), pos[2], pos[3]
while True:
ret, img = camera.read()
for angle in [0, -25, 25]:
rimg = rotate_image(img, angle)
detected = face.detectMultiScale(rimg, **settings)
if len(detected):
detected = [rotate_point(detected[-1], img, -angle)]
break
# Make a copy as we don't want to draw on the original image:
for x, y, w, h in detected[-1:]:
cv2.rectangle(img, (x, y), (x+w, y+h), (255,0,0), 2)
cv2.imshow('facedetect', img)
if cv2.waitKey(5) != -1:
break
cv2.destroyWindow("facedetect")
2
就個人而言,我不知道一個圖書館。但是,我可以說的是,用眼睛檢測然後,您可以使用atan
函數並查找頭部旋轉的角度編輯。 (假設人對同一水平的雙眼時,頭不旋轉)
deg = atan((leftEye.y - rightEye.y)/(leftEye.x - rightEye.x))
一旦你得到這個角度,轉動你必須負deg
度的圖像,你應該有一個面可以是使用Haar Cascades進行檢測。
相關問題
- 1. 檢測旋轉臉部微軟認知服務
- 2. UIImage臉部檢測
- 3. VNDetectFaceRectanglesRequest檢測臉部
- 4. 臉部臉部檢測和識別
- 5. 在OpenCV中檢測臉部並保存檢測到的臉部
- 6. 檢測iPhone旋轉旋轉?
- 7. emguCV 3.1 - 臉部檢測
- 8. Android - 臉部特徵檢測
- 9. iOS,人臉檢測,檢測遠離臉部的位置
- 10. Android:旋轉到臉
- 11. 如何選擇在Android相機上檢測臉部檢測的臉部?
- 12. Google臉部檢測在轉換爲圖像並嘗試檢測臉部時崩潰
- 13. 檢測臉部,獲取臉部的邊框
- 14. 人臉檢測
- 15. 臉型檢測
- 16. 如何檢測Android中的臉部和笑臉和臉部匹配?
- 17. 爲什麼OpenCV人臉檢測識別臉部未受過訓練的臉部?
- 18. 使用基於CNN的人臉檢測器檢測臉部圖案
- 19. 無法檢測到人臉檢測示例中的任何臉部
- 20. 檢測從旋轉270到旋轉90的旋轉變化
- 21. iOS - UIViewcontroller檢測旋轉?
- 22. 當iphone旋轉時檢測
- 23. 從cctv圖像中檢測臉部
- 24. 檢測後的臉部匹配
- 25. 使用OpenCV檢測臉部一側
- 26. 檢測視頻文件中的臉部
- 27. C# - 檢測臉部和裁剪圖像
- 28. 如何使用jviolajones庫檢測臉部?
- 29. Android的臉部特徵檢測
- 30. 臉部檢測特徵提取
你有沒有試過EXIF庫?我相信它會有幫助。 – 2016-01-15 05:25:13