mjyazdani
mjyazdani

Reputation: 2035

how to configure EmguCV and Visual Studio Express 2010 in Win8.1x64

I am developing an application via EmguCV and Visual Studio Express 2010 in Win8.1x64. when I create a new project (C# windows application), it automatically choose x86 as target platform and there is no other choice. When I try to read an image with below code I get the error. I know that it makes this error when target platform is not choosen or when it's not like the operation system, but I don't know how to change target platform to x64 in this case!

Image<Gray, byte> OrginalImage = new Image<Gray, byte>(Openfile.FileName);

[System.BadImageFormatException] = {"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"}

Upvotes: 6

Views: 586

Answers (4)

Ryugeist
Ryugeist

Reputation: 123

Try using the EmguCV NuGet packages instead of the installation stuff - looks like it automatically picks the right one corresponding to your build target. By using NuGet you get all necessary references automatically set and on build it copies stuff like \Emgu.CV.UI.dll and \x64\opencv_ffmpeg310_64.dll in your output directory.

Upvotes: 0

Ian Auty
Ian Auty

Reputation: 857

EmguCV has native binaries for both x86 and x64 so it's up to you to decide what architecture your application should target. You should be able to add the binaries to your build directory and EmguCV should be able to find them. Failing that, add the directory containing the binaries to your PATH.

Upvotes: 1

Raj Kumar Mishra
Raj Kumar Mishra

Reputation: 514

first you need to make sure that you are using 64-bit emgucv with 64-bit laptop.

In order to set platform target, right click on Current project in Solution explorer and click on Properties Option.

Then navigate to Build Option and there you can see PLATFORM TARGET option with a Dropdown Option. Click on 64-bit Option(x64).

Upvotes: 2

Dharmil Asawla
Dharmil Asawla

Reputation: 40

A simple google search to set target platform in visual studio 2010 How to: Configure Projects to Target Platforms

Make sure you are using the x64-bit version of EmguCV on a x64-bit CPU architecture computer.

Upvotes: 2

Related Questions