Skip to content

Commit 9eb0328

Browse files
authored
Update README.md
1 parent faf5596 commit 9eb0328

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ As mentioned above, objects of classes, such as Mat and MatExpr, have unmanaged
116116
Therefore, a ResourcesTracker class is provided. The ResourcesTracker implements the IDisposable interface, and when the Dispose() method is called, all resources tracked by the ResourcesTracker are disposed. The T() method of ResourcesTracker can trace an object or an array of objects, and the method NewMat() is like T(new Mat(...). All the objects that need to be released can be wrapped with T().For example: t.T(255 - t.T(picMat * 0.8)) . Example code is as following:
117117

118118
```csharp
119-
using (ResourcesTracker t = new ResourcesTracker())
119+
using (var t = new ResourcesTracker())
120120
{
121-
Mat mat1 = t.NewMat(new Size(100, 100), MatType.CV_8UC3,new Scalar(0));
121+
Mat mat1 = t.NewMat(new Size(100, 100), MatType.CV_8UC3, new Scalar(0));
122122
Mat mat3 = t.T(255-t.T(mat1*0.8));
123123
Mat[] mats1 = t.T(mat3.Split());
124124
Mat mat4 = t.NewMat();
125125
Cv2.Merge(new Mat[] { mats1[0], mats1[1], mats1[2] }, mat4);
126126
}
127127

128-
using (ResourcesTracker t = new ResourcesTracker())
128+
using (var t = new ResourcesTracker())
129129
{
130130
var src = t.T(new Mat(@"lenna.png", ImreadModes.Grayscale));
131131
var dst = t.NewMat();

0 commit comments

Comments
 (0)