Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Perimeter Particle Analysis

Hi, this is my first post, I didn't´t need help until now.

 

I´m having troubles understanding something that should be very simple. So I´m a little embarrassing.

I just need to get the perimeter of particles on an image, I m using VB.net 2005  and MS 8.6 for VB 2005.

 

I put here what I already accomplish and is working fine using the example provided.

'VB.NET CODE

Dim report As New NationalInstruments.CWIMAQControls.CWIMAQParticleReport

 

Private Sub DisplayReport(ByVal reportIndex As Short)

If reportIndex < 1 Or reportIndex > CInt(NumParticles.Text) Then

Area.Text = "0"

NumHoles.Text = "0"

COMX.Text = "0"

COMY.Text = "0"

Orientation.Text = "0"

BoundLeft.Text = "0"

BoundTop.Text = "0"

BoundRight.Text = "0"

BoundBottom.Text = "0"

BoundWidth.Text = "0"

BoundHeight.Text = "0"

Exit Sub

End If

Area.Text = CStr(report.Item(reportIndex).Area)

NumHoles.Text = CStr(report.Item(reportIndex).NumberOfHoles)

COMX.Text = CStr(report.Item(reportIndex).CenterOfMass.X)

COMY.Text = CStr(report.Item(reportIndex).CenterOfMass.Y)

Orientation.Text = CStr(report.Item(reportIndex).Orientation)

BoundLeft.Text = CStr(report.Item(reportIndex).BoundingRect.Left)

BoundTop.Text = CStr(report.Item(reportIndex).BoundingRect.Top)

BoundRight.Text = CStr(report.Item(reportIndex).BoundingRect.Width + CDbl(BoundLeft.Text))

BoundBottom.Text = CStr(report.Item(reportIndex).BoundingRect.Height + CDbl(BoundTop.Text))

BoundWidth.Text = CStr(report.Item(reportIndex).BoundingRect.Width)

BoundHeight.Text = CStr(report.Item(reportIndex).BoundingRect.Height)

End Sub

Private Sub ContParticulas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ContParticulas.Click

' Get the particle reports

CWIMAQVision1.ParticleReport(CWIMAQViewer2.Image, report, , ) 

' display results

NumParticles.Text = CStr(report.Count)

ReportNum.Value = 1

ReportNum.Enabled = (report.Count > 0)

ReportNum.Maximum = report.Count

ReportNum.Minimum = 1

DisplayReport(1)

End Sub

Private Sub ReportNum_ValueChanged(ByVal eventSender As System.Object, ByVal e As System.EventArgs) Handles ReportNum.ValueChanged

DisplayReport(ReportNum.Value)

End Sub

 

The thing is that CWIMAQParticleReport not provide perimeter. I find at Ni Vision for Visual Basic reference help that  

CWIMAQFullParticleReport does, this one refers to CWIMAQVision.Particle method, but this one is obsolete an refers to CWIMAQVision.ParticleReport and this one expects an CWIMAQParticleReport as return object parameter and not a CWIMAQFullParticleReport object, so I´m not understanding or missing something.

  

Please I just need an example like provided before that includes the perimeter of a particle.

 

Thanks in advance.

 

MCAR.

0 Kudos
Message 1 of 2
(3,350 Views)

Somebody please?

0 Kudos
Message 2 of 2
(3,306 Views)