Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Access Violation in imaqFindCircularEdge2

Hi,

 

we are getting AccessViolationExceptions in ationalInstruments.Vision.Analysis.Internal.VisionDll.imaqFindCircularEdge2 method using C# .NET 2.0 and also 4.0.

 

Reproducing steps:

1) open vision assistant 2011 SP1

2) start a new project and add a Find Circular Edge step

3) execute algorithm --> works

4) tools --> generate c# .net project

5) build project

6) run project .--> exception in:

// Calculate the edge locations
circleReport = Algorithms.FindCircularEdge(image, roi, circleOptions, fitOptions);

 

All other steps are perfectly fine working!

 

Does anyone have ideas?

 

regards,

Roland

 

stack trace:

at NationalInstruments.Vision.Analysis.Internal.VisionDll.imaqFindCircularEdge2(IntPtr _image, IntPtr _roi, CVI_CoordinateSystem& _baseSystem, CVI_CoordinateSystem& _newSystem, CVI_FindCircularEdgeOptions& _findEdgeOptions, CVI_CircularEdgeFitOptions& _circularEdgeOptions)
at NationalInstruments.Vision.Analysis.Algorithms.FindCircularEdge(VisionImage image, Roi roi, FindCircularEdgeOptions findCircularEdgeOptions, CircularEdgeFitOptions circularEdgeFitOptions, CoordinateTransform transform)
at NationalInstruments.Vision.Analysis.Algorithms.FindCircularEdge(VisionImage image, Roi roi, FindCircularEdgeOptions findCircularEdgeOptions, CircularEdgeFitOptions circularEdgeFitOptions)
at Vision_Assistant.Image_Processing.IVA_FindCircularEdge(VisionImage image, Roi roi, SpokeDirection direction, EdgeOptions options, CircularEdgeFitOptions fitOptions, IVA_Data ivaData, Int32 stepIndex) in D:\Documents and Settings\roland\Desktop\New Folder\ImageProcessing.cs:line 104
at Vision_Assistant.Image_Processing.ProcessImage(VisionImage image) in D:\Documents and Settings\roland\Desktop\New Folder\ImageProcessing.cs:line 317
at Vision_Assistant.Form1.RunButton_Click(Object sender, EventArgs e) in D:\Documents and Settings\roland\Desktop\New Folder\Form1.cs:line 34
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Vision_Assistant.Program.Main() in D:\Documents and Settings\roland\Desktop\New Folder\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

0 Kudos
Message 1 of 5
(3,389 Views)

Can you attach a simple built app that exhibits the problem?

 

Eric

0 Kudos
Message 2 of 5
(3,378 Views)

I am experiencing the same issue, i.e. a memory corruption when NationalInstruments.Vision.Analysis.Algorithm.FindCircularEdge is executed. I am also using Vision 2011 and 4.0 .NET framework. Is this a bug? If so, was it fixed in Vision 2012?

Thanks,

Massimo

0 Kudos
Message 3 of 5
(3,181 Views)

If you attach a sample code and image reproducing the issue, there is a chance this can be fixed in VDM 2013 SP1.

0 Kudos
Message 4 of 5
(3,169 Views)

I found the answer in the release notes for VDM 2012. In the updates and improvements table it is reported:

 

349815

imaqFindCircularEdge2 has a run-time error: 0x6C965AB7.

 

I then installed VDM 2012 and I no longer get the access violation.

 

0 Kudos
Message 5 of 5
(3,166 Views)