0
J'utilise le SURF d'Emgu CV et j'ai utilisé int j = CvInvoke.cvCountNonZero(mask);
pour trouver des paires appariées. Le problème comment retourner cette valeur dans main()
?Comment obtenir la valeur d'une variable d'une autre classe
...
...
...
public static Image<Bgr, Byte> Draw(Image<Gray, Byte> modelImage, Image<Gray, byte> observedImage, out long matchTime)
{
HomographyMatrix homography;
VectorOfKeyPoint modelKeyPoints;
VectorOfKeyPoint observedKeyPoints;
Matrix<int> indices;
Matrix<byte> mask;
FindMatch(modelImage, observedImage, out matchTime, out modelKeyPoints, out observedKeyPoints, out indices, out mask, out homography);
//Draw the matched keypoints
Image<Bgr, Byte> result = Features2DToolbox.DrawMatches(modelImage, modelKeyPoints, observedImage, observedKeyPoints, indices, new Bgr(255, 255, 255), new Bgr(255, 255, 255), mask, Features2DToolbox.KeypointDrawType.DEFAULT);
int j = CvInvoke.cvCountNonZero(mask);
return result;
}
Je fait votre idée , mais j'ai une erreur dans main(). Parce que la classe DrawingResult a écrit dans une autre classe nommée par DrawMatches. Comment puis-je résoudre ce problème. – Kurd
La solution la plus simple a mis le DrawingResult dans sa propre classe. –
mais mon erreur dans le main(). Résultat DrawingResult = MyClass.Draw (...); – Kurd