02-01-2010 09:55 AM
I just installed the Vision 2009 Development module and are converting an old program to the new Vision .NET syntax. I noticed VisionImage.ArrayToImage now seems to work in a (height / Y, width / X) format when viewed in the ImageViewer. Is this a change in the ArrayToImage method or the Viewer method? Is there a way to change it back?
The new .NET version is a great improvement. It is now a true .NET implementation with integrated Visual Studio help. The downside is a lot of the method / property names have changed, so each line of code must be edited. The legacy code is still available if installed.
02-02-2010 04:14 PM
Hey John,
I am a little unsure what you are referring to by how you described the format of the ArrayToImage method. Are you saying that if you pass a 2D array to the method, the first dimension of the array represents the height of the image and the second dimension of the array represents the width of the image? If you have an array [0 0; 255 255; 0 0] your image will be three rows and two columns. So in the since an array being described in a (rows, columns) format, you are correct. In this way, if you were to manually dray out the array of pixel values, it would give you a properly oriented image. This shouldn't be different than any previous versions of NI Vision. If you are looking for the opposite orientation, perhaps transposing the array is in order.
02-03-2010 07:46 AM
02-04-2010 11:41 AM
Hey John,
You are correct in saying that the 'The first index corresponds to the vertical axis and the second index corresponds to the horizontal axis.' I am having a little trouble digging up some of the documentations from previous versions of Vision so I can not verify that this was different in previous versions of Vision. It seems odd that this would have changed suddenly in the most recent version of Vision. However, if is is documented and has been working for you in the opposite fashion for all previous versions, then I would have to agree that this was a change. I do apologize for any inconvenience this causes with upgrading your application.
02-05-2010 03:05 PM
This is switch from the CWIMAQ-versions of the library. I called NI tech support, and the applications engineer I was working with filed a corrective action report with the R&D group.
I tried the following code:
Private Sub btnButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnButton1.Click
Dim data(100, 100) As Short
Dim Image1
Dim i As Short
Dim j As Short
Dim Image2
Image1 = New NationalInstruments.Vision.VisionImage
Image2 = New NationalInstruments.CWIMAQControls.CWIMAQImage
For i = 0 To 100
For j = 0 To 100
data(i, j) = (i \ 10) * 10
Next j
Next i
Dim PixelArray As New NationalInstruments.Vision.PixelValue2D(data)
Dim PixelArray2 As Object = CType(data, Object)
imageViewer1.Image.Type = NationalInstruments.Vision.ImageType.I16
imageViewer1.Image.ArrayToImage(PixelArray)
axCWIMAQViewer1.Image.Type = CWIMAQImageTypes.cwimaqImageTypeI16
axCWIMAQViewer1.Image.ArrayToImage(data)
End Sub
It creates an image that is rotated in the Vision 2009 viewer relative to the CWIMAQ viewer.
02-05-2010 03:39 PM
Yes,
This is what I am seeing also. I have a ticket in with NI also. They are working on confirming. With both of us seeing the same thing something has charged. I was told I should have a reply within a week.
02-07-2010 11:42 PM
02-08-2010 08:34 AM
CAR# 205929
09-14-2010 03:51 PM
Has this problem been fixed in Vision 2010?
09-15-2010 09:57 AM
Hi John,
Unfortunately this CAR 205929 still open and R&D still working on it as of today.
Thanks and have a great day.