日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人工智能 > 循环神经网络 >内容正文

循环神经网络

matlab矩阵按坐标取,在Matlab中获取inlier点的坐标(Get coordinates of inlier points in Matlab)...

發布時間:2024/10/8 循环神经网络 91 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab矩阵按坐标取,在Matlab中获取inlier点的坐标(Get coordinates of inlier points in Matlab)... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在Matlab中獲取inlier點的坐標(Get coordinates of inlier points in Matlab)

我需要找到使用impixel()在對象檢測中獲得的內部點的像素值。 我使用鏈接中的示例中提供的相同代碼

如何獲得內點的x,y坐標相對于圖像尺寸。(圖像的左上角被視為0行, 0 col),以便我可以使用坐標來查找各自的像素值。 我在Matlab中找不到任何與C++中的KeyPoint對象相同的解決方案,它可以輕松地提供坐標值。

I need to find pixel values of inlier points obtained in object detection using impixel(). I am using the same code as provided in the example at the link

How can I get x,y coordinates of the inlier points being with respect to image dimensions.(Top-left corner of image considered as 0 row, 0 col) so that I can use the coordinates to find their respective pixel values. I couldn't find any solution in Matlab same as KeyPoint object in C++ that gives coordinate values easily.

原文:https://stackoverflow.com/questions/29530724

更新時間:2020-01-08 00:29

最滿意答案

你這里不需要impixel 。 impixel可讓您從圖中顯示的圖像中獲取像素值,這不是您想要做的。

在您使用的示例中, inlierBoxPoints和inlierScenePoints是SURFPoints對象。 您可以將點的(x,y)位置設為inlierBoxPoints.Location 。 然后你可以得到第i個點的像素值,如下所示:

loc = round(inlierBoxPoints.Location(i, :));

pixVal = boxImage(loc(2), loc(1), :);

請記住,在MATLAB中,圖像被索引為(row,col),左上角像素為(1,1),而不是(0,0)。 您必須舍入坐標,因為以子像素精度檢測點。

You do not need impixel here. impixel lets you get the pixel value from in image displayed in a figure, which is not what you are trying to do.

In the example you are using, inlierBoxPoints and inlierScenePoints are SURFPoints objects. You can get the (x,y) locations of the points as inlierBoxPoints.Location. Then you can get the pixel value for the i-th point as follows:

loc = round(inlierBoxPoints.Location(i, :));

pixVal = boxImage(loc(2), loc(1), :);

Keep in mind that in MATLAB the images are indexed as (row, col), and that the top-left corner pixel is (1,1), not (0,0). You have to round off the coordinates, because the points are detected with sub-pixel accuracy.

2015-04-09

相關問答

只需使用regionprops : stats = regionprops(B,'Centroid')

以下是如何使用它的詳細方法: 首先我會產生一些隨機點 a=zeros(50);

a(ind2sub(size(a),randi(numel(a),7,1)))=1;

a=padarray(a,[10 10]);

a=conv2(a,fspecial('gaussian',7,1),'same');

b=a>0.02;

imagesc(b);

然后使用regionprops: stats

...

data = [2,2 ; 2,3 ; 1,2 ; 1,3 ; 2,1 ; 1,1 ; 3,2 ; 3,3 ; 3 ,1]

% corresponding sort-value, pick one out or make one up yourself:

sortval = data(:,1); % the x-value

sortval = data(:,2); % y-value

sortval = (data(:,1)-x0).^2 + (data(:,2)-y0).^2; % distan

...

一旦你進入matirx(這應該相對容易),簡單的方法是使用imresize,否則困難的方法是使用interp2將值拉伸或壓縮到另一個的大小。 然后只需使用減法來獲得矩陣之間的差異 Once you get it into a matirx (this should be relatively easy), the easy way is to use imresize, otherwise the hard way is to use interp2 to stretch or condense

...

你這里不需要impixel 。 impixel可讓您從圖中顯示的圖像中獲取像素值,這不是您想要做的。 在您使用的示例中, inlierBoxPoints和inlierScenePoints是SURFPoints對象。 您可以將點的(x,y)位置設為inlierBoxPoints.Location 。 然后你可以得到第i個點的像素值,如下所示: loc = round(inlierBoxPoints.Location(i, :));

pixVal = boxImage(loc(2), loc(1),

...

編輯:無可否認,這只是一個部分答案,因為我只是解釋為什么這些方法甚至可以用這些擬合方法,而不是如何改進輸入關鍵點從一開始就避免這個問題。 正如其他答案中所述,關鍵點匹配的分布存在問題,并且在關鍵點檢測階段有辦法解決這個問題。 但是,對于具有相同關鍵點對的 estimateFundamentalMatrix 矩陣的重復執行, 相同輸入會產生不同結果的原因是因為以下原因。 (同樣,這并不能為改善關鍵點提供合理的建議以解決這個問題)。 重復執行的不同結果的原因與RANSAC方法(以及LMedS和MSAC

...

您可以使用pcshow函數繪制您的點,它將直接采用M-by-N-by-3陣列。 然后,您可以打開數據提示并單擊繪圖中的點以查看其坐標。 如果您仍想創建3乘N矩陣,那么最簡單的方法是: x = xyzPoints(:,:,1);

y = xyzPoints(:,:,2);

z = zyzPoints(:,:,3);

points3D = [x(:)'; y(:)', z(:)'];

You can use the pcshow function to plot your points, and i

...

關于你的第二個要求,當用戶按下一個鍵時,控件會從圖形窗口移動到命令窗口,除非你使用的是waitforbuttonpress ,這會使事情變得不必要。 因此,可以建議使用雙擊來表示輸入坐標結束的替代解決方案。 這是在下面顯示的鏈接stackoverflow代碼的修改版本中完成的。 碼 function varargout = ginput_ax_mod2(ha,n)

if nargin<2

n=1;

end

k = 0;

button = 0;

%%// Tolerance so that

...

為了進一步理解,我在此鏈接中嘗試了以下代碼。 % Extract SURF features

I = imread('cameraman.tif');

points = detectSURFFeatures(I);

[features, valid_points] = extractFeatures(I, points);

% Visualize 10 strongest SURF features, including their

% scales and orientation

...

使用detectSURFFeatures和detectSURFFeatures本質上返回一個結構 ,其中每個字段包含有關在圖像中檢測到的興趣點的相關信息。 為了給出一個可重現的例子,讓我們使用作為圖像處理工具箱一部分的cameraman.tif圖像。 讓我們同時使用兩個功能檢測框架和默認參數: >> im = imread('cameraman.tif');

>> harrisPoints = detectHarrisFeatures(im);

>> surfPoints = detectSURF

...

這總是很有趣:) 首先:Mohsen Nosratinia的回答是好的,只要 你不需要知道實際的距離 你可以絕對肯定地保證你永遠不會去極地附近 并且永遠不會接近±180°子午線 對于給定的緯度,-180°和+ 180°經度實際上是相同的點 ,因此僅僅觀察角度之間的差異是不夠的。 這在極地地區將是一個更大的問題,因為那里的大經度差異對實際距離的影響較小。 球面坐標對于導航,繪圖和類似的東西非常有用和實用。 然而,對于空間計算,就像您嘗試計算的表面距離一樣,球面坐標實際上非常麻煩。 雖然可以直接使用角

...

總結

以上是生活随笔為你收集整理的matlab矩阵按坐标取,在Matlab中获取inlier点的坐标(Get coordinates of inlier points in Matlab)...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。