Error ‘LoadImage Type’ is not declared. It may be inaccessible due to its protection level


I got above error after copying and pasting some code from here, github.
Will you guys help me to fix it? my code:

Imports Emgu.CV                 'usual Emgu Cv imports
Imports Emgu.CV.CvEnum          '
Imports Emgu.CV.Structure       '
Imports Emgu.CV.UI
Public Class frmMain
    Private Sub btnOpenFile_Click(sender As Object, e As EventArgs) Handles btnOpenFile.Click

The LoadImageType gives me some suggestions, I tried but didn’t get helpful.

            imgOriginal = New Mat(ofdOpenFile.FileName, LoadImageType.Color)
        Catch ex As Exception                                                       
        CvInvoke.GaussianBlur(imgGrayscale, imgBlurred, New Size(5, 5), 1.5)
        CvInvoke.Canny(imgBlurred, imgCanny, 100, 200)
        ibOriginal.Image = imgOriginal              'update image boxes
        ibCanny.Image = imgCanny                    '
    End Sub
End Class

this is the error:
enter image description here

These are my project files

Leave a Reply

Your email address will not be published. Required fields are marked *