You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OpenCvSharp4 Libraries at version 4.6.0.20220608 are working for us when running a .NET 6 Web Api we have, when upgrading our Web Api to .NET 8, the same version of OpenCvSharp4 starts throwing the following error.
Exit code is -1073741819 (Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
We have also tried the latest OpenCvSharp version as well, but get the same error.
Environment
Windows 10 x64 Build Environment running a .NET 8 Web Api
What did you do when you faced the problem?
The exception occurs consistently when calling the following static methods on Cv2:
CopyMakeBorder
HConcat
Write here
Example code:
int edgeWidth = 1;
Mat image = new Mat(....); // Instantiate a new Mat;
Mat borderedImage = new Mat(image.Rows + edgeWidth * 2, image.Cols + edgeWidth * 2, image.Depth(), image.Channels());
Cv2.CopyMakeBorder(image.Clone(), borderedImage, edgeWidth, edgeWidth, edgeWidth, edgeWidth, BorderTypes.Constant, new Scalar(255,255,255));
List<Mat> images = new List<Mat>(); // Add a number of Mats to the List.
Mat combinedImage = null;
List<int> expectedVerticalPositions = new List<int> {0};
Mat imageSoFar = images.ElementAt(0);
for (int count = 1; count < images.Count; count++)
{
Mat imageToAdd = images.ElementAt(count);
expectedVerticalPositions.Add(expectedVerticalPositions.Last() + imageToAdd.Cols);
Mat newlyCombined = new Mat(imageSoFar.Rows, imageSoFar.Cols + imageToAdd.Cols, imageSoFar.Depth(), imageSoFar.Channels());
Cv2.HConcat(imageSoFar, imageToAdd, newlyCombined);
imageSoFar = newlyCombined;
}
Output:
Exit code is -1073741819 (Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
What did you intend to be?
The text was updated successfully, but these errors were encountered:
Summary of your issue
The OpenCvSharp4 Libraries at version 4.6.0.20220608 are working for us when running a .NET 6 Web Api we have, when upgrading our Web Api to .NET 8, the same version of OpenCvSharp4 starts throwing the following error.
Exit code is -1073741819 (Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
We have also tried the latest OpenCvSharp version as well, but get the same error.
Environment
Windows 10 x64 Build Environment running a .NET 8 Web Api
What did you do when you faced the problem?
The exception occurs consistently when calling the following static methods on Cv2:
Write here
Example code:
Output:
What did you intend to be?
The text was updated successfully, but these errors were encountered: