0

誰かがコードを共有できる場合

C# EmguCV フレームワークの Image.setValue(...) メソッドに相当する C++(OpenCV) は何ですか。emgucv リファレンス: http://www.emgu.com/wiki/files/2.3.0/document/Index.html

たとえば、次に C++ でコーディングする方法は次のとおりです。

 private static Image<Gray, Byte> FilterPlate(Image<Gray, Byte> plate)
 {
  ...
  Image<Gray, Byte> thresh = plate.ThresholdBinaryInv(new Gray(120), new Gray(255));
  using (Image<Gray, Byte> plateMask = new Image<Gray, byte>(plate.Size))
  plateMask.SetValue(255.0);
  ...
  thresh.SetValue(0, plateMask);
  }

特に、次の C++ と同等のものは次のとおりです。

  thresh.SetValue(0, plateMask);

ありがとう。

4

1 に答える 1

1

私はEmguCVを使用していませんが、ドキュメントが言ったように

 thresh.SetValue(0, plateMask);

特定のマスクを使用して、Array の要素を val に設定します。

だから、私はあなたが使用できると思います

void cvSet(CvArr* arr, CvScalar 値, const CvArr* mask=NULL)

Sets every element of an array to a given value.

http://opencv.willowgarage.com/documentation/operations_on_arrays.html#set

例:

cvSet(thresh, CvScalar(0), plateMask);
于 2012-05-03T08:46:27.413 に答える