-1
Q
用Matlab
A
回答
1
我建議隔離兩個輸入點之間的黑色區域,然後找到此連接組件中的最高點。 你可以嘗試下面的方法(你可能需要調整一些參數,但它應該是一個好的開始)。
I = rgb2gray(imread('<your path>'));
%input parameters - points which represents two finger tips.
x1 = 408; y1 = 441;
x2 = 454; y2 = 373;
%binarize image
I = im2bw(I);
%noise reduction - close holes
I2 = imclose(I,strel('disk',10));
%draw a line between p1 and p2
ind = drawline([y1 x1],[y2 x2],size(I));
lineMat = zeros(size(I));
lineMat(ind) = 1;
%adds the line to the image
I2 = I2 | lineMat;
%finds a point in the middle of the line
[lineY, lineX] = ind2sub(size(I),ind);
midX = lineX(ceil(length(ind)/2));
midY = lineY(ceil(length(ind)/2));
%finds a point which resides in the connected component which is between
%the line and the two finger.
xSeed = midX;
ySeed = midY -5;
%perform imfill operation, starting from (xSeed,ySeed),
%in order to find the conected component in which the point (xSeed,ySeed)
%resides.
diffMat = imfill(I2,[ySeed xSeed])~=I2;
%finding the highest point in this connected component
[Y, X] = ind2sub(size(diffMat),find(diffMat));
minInd = find(Y==min(Y),1,'first');
yValley = Y(minInd);
xValley = X(minInd);
%presents result
imshow(I);hold on;
plot(x1,y1,'r.','MarkerSize',20);
plot(x2,y2,'r.','MarkerSize',20);
plot(xValley,yValley,'b.','MarkerSize',20);
*畫線功能取自drawline webpage。
-1
這只是算法,但所有這些功能MatLab中肯定存在:
- 計算的凸包
- 計算的區別:凸包減去原來的形狀。然後,你有所有的山谷你正在尋找,再加上一些小圖案。
- 連接組件標籤。
- 刪除小部件。然後你的手指之間有了所有的山谷。
- 然後您可以使用指尖座標選擇您想要的那個。
相關問題
- 1. 用Matlab
- 2. 用matlab
- 3. 調用Matlab
- 4. 利用Matlab
- 5. 從利用Matlab
- 6. 使用MATLAB
- 7. 在利用Matlab
- 8. PHP調用Matlab
- 9. 如何用Matlab
- 10. 使用horzcat MATLAB
- 11. 使用MATLAB
- 12. 使用MATLAB
- 13. 用於在Matlab
- 14. trunc使用matlab
- 15. 用MATLAB繪製
- 16. 要使用MATLAB
- 17. 使用MATLAB
- 18. 用於在Matlab
- 19. 調用從MATLAB
- 20. 用Matlab 2013a
- 21. 使用MATLAB svmtrain
- 22. 使用MATLAB
- 23. C#調用MATLAB
- 24. 調用Matlab中
- 25. 使用MATLAB
- 26. Matlab - 使用imquantize()
- 27. 使用MATLAB
- 28. 用於在Matlab
- 29. MATLAB NET.ASSEMBLY用C#
- 30. 如何用matlab
有很多方法。你可以試着找到一些使用谷歌,然後問更具體的問題。 – RobAu
我知道兩個手指之間的黑色區域中的一個點的位置。我的想法是從這一點開始並搜索山谷(搜索區域由白色像素和兩個手指尖的X座標分隔)。但我不知道我該如何搜索谷點。 –
研究:「凸度缺陷」,這是一種通常用於處理這種手部圖像的方法。 – RobAu