Error using haarcascade_profileface.xml - c#

I am writing a program in C# using Visual Studio Express 2013 for Windows Desktop. I want to detect faces that are in profile, so just one eye is visible. I am using haarcascade_profileface.xml for the detection. Every time I try to debug my code I receive this error message:
Error of type "Emgu.CV.Util.CvException" has occurred in Emgu.CV.dll. Additional Information: OpenCV: The node does not represent a user
object (unknown type?)
I use the same code that I use with haarcascade_frontalface_default.xml and with this xml it works.
I really need help. Please help me.
Thanks, B

emgu, using opencv's deprecated c-api, can only read cascade files in the old format (build with opencv_haartraining). you cannot use that cascade file with emgu. blame their devs for living under a rock.

Use the haarcascade files from here instead: https://github.com/Itseez/opencv/tree/master/data/haarcascades_cuda
As berak said, yours are in the wrong format

Emgu using libs from OpenCV, so you need add this libs into your project. The visual studio can´t add as reference the native OpneCV libs, so you can include the libs on root project and set to build always copy to folder 'bin'.
Set project to buld for 64bit processor

Related

C# - Microsoft Expression Encoder missing reference, how to add them to project?

I have an application that has an Image Capture feature.
When I try to build it in Visual Studio 2012, I get missing references to Expression Encoder. The image capture facility has been achieved using Microsoft Expression Encoder, and it uses code from it's API. In order to build this application successfully, the PC where I'm trying to build needs some sort of Expression Encoder codec where it will get the references from.
I have tried installing the full application (Microsoft Expression Encoder 4) which is about 25MB, which fixes all the references. We do not want that, due to the application being offered to clients, which means they will have to install another application, the Expression Encoder 4 on top of our application. I'm thinking that there must be a codec of some sort that contains these missing references which is of course smaller than 25MB.
The missing references are the following:
Microsoft.Expression.Encoder.Devices;
Microsoft.Expression.Encoder.Live;
LiveJob
LiveDeviceSource
EncoderDevices
EncoderDeviceType
EncoderDevice
Source Properties
Preview Window
Does anyone have more experience with this and knows how to fix the missing references?
Thank you very much.
Here's an article that shows workarounds for missing Microsoft.Expression.Encoder.resources.dll file, I was able to get through all exceptions using it, but got stuck on 'Appliation not licensed. To fix, install and run application.'
Link to article:
http://uprightbassics.blogspot.com/2014/01/how-to-deploy-expression-encoder-4-sdk.html
This is not possible to deploy an application that uses EE4 SDK without installing the entire application on the target machine. Things had to change from EE3 to EE4 but it does not. Even if you try to "copy local" DLLs in your application location, it requires to install the 25MB EE4 application.
Hope this helps.
Add reference to
microsoft.expression.encoder.dll
Check in C:\Program Files (x86)\Microsoft SDKs\Expression\Encorder 4
If possible copy the dll into your project and change the property Copy To Output to Copy Always.

.NET Micro framework Compile and Deploy without VisualStudio

Firstly, thank you for bothering to look at my question as 5 days of Googling has left me dreary to say the least.
I would like to know of a way that I can compile and then deploy without the use of Visual Studio. I am able to compile and then use MetaDataProcessor.exe to generate my PE (Portable Executable) files with the -minimize option. However, this seems to be where I get a little stuck. I believe that I am supposed to generate a database file including all of the PE files referenced in my application, and from there I am supposed to convert this into a Motorola SRecord file, however when I take these steps I am getting this result:
1) My .hex file is somewhere around 3.5x larger than the .hex file I pull off of my board after using Visual Studio to deploy (65kb from VS and 305kb with my steps)
2) When attempting to deploy and run my .NETMF application, I receive an error from the board itself saying that at least one of my assemblies has a null checksum (it aborts after the first null checksum received)
What is the secret step that I am missing, or what step am I using incorrectly here? Any help here would be greatly appreciated.
Thank you,
James.

EmguCV 64-bit build runtime error

I am running into issues building an existing 32-bit EmguCV (Version 2.3) into 64-bit using .net 4.0 and VS2010 on a W7/x64 OS. I have purchased a commercial license, if that matters and downloaded from the links provided in the receipt.
The error is
System.TypeInitializationException was unhandled
Message=The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
Source=Emgu.CV
TypeName=Emgu.CV.CvInvoke
I followed the instructions provided in this article. In fact I used the samples projects in the article and they build fine with V2.2, but when I replace with V2.3 binaries (both emgu and opencv), run into the error.
Has anyone successfully built an Emgu (Version 2.3.x) x64 project? Please provide some guidance.
The cause of this error (should anyone else run into the same problem) is that the program cannot access opencv_imgproc231.dll or opencv_core231.dll even though they are present in the output "bin" directory.
There are two solutions:
Add them to the project and set their properties to copy always as they are EMGU's two key files.
If step 1 doesn't work, replace the current key files in the bin folder with new copies.
If both methods fail then there may be a problem with the build, so download a new copy of EMGU from Sourceforge and try again. The error will later be incorporated within an technical article in order to provide a clearer explanation of how to solve it.
Cheers,
Chris
No need to add them to the project; VS will not let you. Simply open FaceRecognizer.cs
at public static partial class CvInvoke and change:
[DllImport(CvInvoke.EXTERN_LIBRARY, CallingConvention = CvInvoke.CvCallingConvention)]
to:
[DllImport(Emgu.CV.CvInvoke.EXTERN_LIBRARY, CallingConvention = Emgu.CV.CvInvoke.CvCallingConvention)]
Ensure you change all of them.
First test this way: open a sample project from emgu cv installaiton directory and run it. for example, open hello world example and try to run it. if sample projects run with out problem then the installation is correct.
For emgu cv sample projects, value of Output Path option in Build settings of the project is set to '..\..\
bin'. To fix your project problem, open the project in visual studio and set value of Output Path option to 'C:\Emgu\emgucv 2.9\bin'. Try to run the project. It must run with success.
Now, set back the value of Output Path option to bin\Debug\. Then, add all DLL files in the 'C:\Emgu\emgucv 2.9\bin' folder to your project using ADD -> Existing Item menu. similarly, add all DLL files in the 'C:\Emgu\emgucv 2.9\bin\x64' folder to your project using ADD -> Existing Item menu. Now, go to properties window and set Copy to Output Directory option of all dll files to Copy Always. Finally, in the Configuration Manager window, create a new configuration for x64 platform.
Good Luck

"The source file is different...." message in Visual Studio 2008 is result of debugging x32 apps on x64 Windows

I'm writing ADO.NET provider. For debugging I use class DbProviderFactories.GetFactory method. This method constructs my inherited DbProviderFactory class that i use for create DbConnection inheritor of my provider and etc.. When I try set breakpoint in my provider code I sow it isn't work - execution doesn't stopped. When I throw exception in my code VS2008 showed message box describing "The source file is different...".
Debugging works good before day before tomorrow, but it isn't now. Does somebody know "magic checkbox" for resolve my trouble? Any idea?
Update1: Provider assembly is adding to GAC on post build step. Compiler didn't find errors in solution.
Update2: Source code of static referenced assemblies is "different" too.
Update3 and last: I've found source of trouble. I use x64 version of Windows 7. My application use some COM servers (usual native x32 COM Servers) that can't be loaded in x64 context. So I decided run it as x32 app using WOW so I set platform target as x32. But debugger started show messages like "The source file is different....". I don't understand why it works as works. I will write to microsoft support team.
You can tell it to ignore the problem by going to Tools, Options, going to the Debugger section, and unchecking Require source files to exactly match the original version.
To solve the problem, check your assembly locations. Your program is probably referencing a different version of your provider DLL than the one in the debugger. Try removing the reference and adding a Project Reference.
EDIT: Try removing the provider from the GAC (manually or at the beginning of the post-build step)
“The source file is different…” message in Visual Studio 2008 is result of debugging x32 apps on x64 Windows. See new thread
If you are using Visual Studio Express, you probably don't have Build->Clean Solution.
Try to remove the pdb debug file located in C:\Users\yourusername\Documents\Visual Studio 2010\Projects\yourproject\yournamespace\bin\Debug.
If you are afraid to delete the file completely, i would move it to a temporary folder.
Then try Debug->Start Debugging(F5)
Happy coding!
Try doing a clean (Build-> Clean Solution), and then rebuilding All (Rebuild Solution).

Couldn't get Design Time license for 'SoftwareFX.ChartFX.Chart' error in C# solution

I'm trying to build a C# solution in Visual Studio 2008 written by other programmer. Visual Studio throws the following error:
Exception occurred creating type
'SoftwareFX.ChartFX.Chart, ChartFX,
Version=6.2.1342.0, Culture=neutral,
PublicKeyToken=a1878e2052c08dce'
System.ComponentModel.LicenseException:
Couldn't get Design Time license for
'SoftwareFX.ChartFX.Chart'
I've never used SoftwareFX or ChartFX. Actually I'm C/C++ developer, not C# developer but have to debug this project. How to resolve this issue?
Thanks in advance.
I've found a way: making licenses.licx file a 0 byte file. After this the solution builds.
You need to install a licensed version of ChartFX, then reopen Visual Studio, and this should go away.
The error message is saying that you're trying to build a project that uses ChartFX, but do not have a valid license.
Here is what you need to do. Simply open the form which contains the chart and just click on the chart once. This will create the license.licx file you need. Alternatively just create a new form and add the chart to this form. Compile the solution and delete the new form and you should be all sorted!
My problem was that ChartFX trial license had expired and I had bought a new license to use.
Clearing licenses.licx helped me solved my problem.

Categories

Resources