Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Calibration bug in the .NET generated code from vision assistant

Hello,

I'm currently running VDM 2011. When I used it to generate the calibrated solution for VS 2008. The following bug has been found

Public Shared Function ProcessImage(ByRef image As VisionImage) As PaletteType
            'Initialize the IVA_Data structure to pass results and coordinate systems.
            Dim ivaData As New IVA_Data(2, 0)
           
            'Calibrate Image: Calibration from image
            Dim vaFileName As string = "E:\\Master\\Samples\\Calibration Grid\\New2011.png"
            Using calibratedImage As New VisionImage(ImageType.U8, 7)
           
                calibratedImage.ReadVisionFile(vaFileName)
                Algorithms.CopyCalibrationInformation(image,calibratedImage )
            End Using
           
            'Image Correction
            Dim vaFillValue As PixelValue = Functions.IVA_SetPixelValue(image.Type, 0, 0, 0, 0)
            Algorithms.CorrectCalibratedImage(image, image, vaFillValue, InterpolationMethod.Bilinear)
           
            'Dispose the IVA_Data structure.
            ivaData.Dispose()
           
            'Return the palette type of the final image.
            return PaletteType.Gray
        End Function 
  • The first bolded line of code has a file path with double forward slashes where in VB, single slash is only needed. It is considered cosmetic.
  • The second bolded line of code has swapped parameters, since the image should be the destimation instead of being the source. I guess it is considered critical.

 

 

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 1 of 4
(3,266 Views)

Hello Waleed,

 

Could you please attach your Vision Assistant script in a reply? I will be looking into whether this issue is a known problem that has already been targeted to be fixed by R&D or if it is something that we will need to investigate, but I would also like to have a look at your Vision Assistant script and make sure that the problem can be replicated.

 

Thanks!

Matt
NI Community Team
National Instruments
0 Kudos
Message 2 of 4
(3,255 Views)

Hi Waleed,

 

Those are both very good points. Regarding the second one, I created CAR 316646, which will be fixed in 2011 SP1.

I can provide you with a way to fix it. Just modify the file

C:\Program Files (x86)\National Instruments\Vision Assistant\CG\templates\IVAImageCalib.ascx

On line 14, just swap the 2 parameters, and the problem will be fixed the next time you generate code.

 

Thanks for reporting that issue.

 

-Christophe

0 Kudos
Message 3 of 4
(3,247 Views)

Thanks for your kind response,

I've already swapped the parameters since my posting. I've enclosed the used script for revision. One final notice, regarding overelays, the vision assistant uses obsolete way to draw them while there is new methods in the algorithm namespace (one line of code) to draw them !. It is very clear when drawing rotating rectangle.

 

Thanks again for your kind response and concern.

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 4 of 4
(3,235 Views)