Image Processing in Metro Application - c#

I need to do some image processing in a Windows 8 metro application. I have written some functions in MATLAB for that. Is there a way I can integrate them in my application? I am kinda lost here. Can anyone suggest something about this? I would be grateful.
P.S: In my MATLAB program I am detecting face shape and skin tone.

Sure, why not? Just re-implement your Matlab code in C# or C++. Do you have a specific question?
You can use computer vision libraries like OpenCV (or the EmguCV C# wrapper) or AForge.NET.

Here is lightweight image processing sample. I think it's better to check this sample, it might be helpful to you. Please note the article is bit older so it must be updated by author.

Related

QR-Code reader windows library

I would like to know if there's any library (like zbar for android) for reading QR-Codes in windows store apps? I already know ZXing.Net, but that only decodes from an image, I would like to decode it directly from the camera.
Thanks for your help :)
Edit: Is there a source code for a demo application? That would be even better since I'm a beginner with windows store apps.
Check out Optical Reader Library of Nokia: http://developer.nokia.com/community/wiki/Optical_Reader_Library_for_Windows_Phone_8
And if it doesn't solve your problem, or you simply don't like it, it is relatively easy to make your own one using ZXing.NET and camera reader task.

How to trim a mp4 video in a Windows Phone 8 App

I want to trim a MP4 video in a Windows Phone 8 Application.
Say when saving a video, I only want to save the last two minutes.
I have tried converting the video stream into a byte array and altering it. Since the mp4 format has headers and lot of other metadata it is not easy to achieve this fiddling with the byte array of the stream.
If it is a Windows Store app I can use MediaTranscode class in the Windows.Media.Transcoding API to achieve this like in the article below.
Trim Video Windows Store App Example
I pretty much want to do something similar in windows phone.
Is there a similar API I can use in WP?
I also have been looking into Microsoft Media Foundation to achieve this? I am no C++ expert and wanting achieve this in C#.
Any help or direction would be much appreciated.
Thanks
C# in general is not setup to do movie editing. It's older sibling c++ is where this done. I know that's not the answer you want to hear but sometimes that's the only reality there is. I was going to offer a hack to make it happen but after digging through the MSDN libraries I don't even see a worthy hack for this.
Find a C++ example and work from there. It will be a little headache but you are much better off than attempting to make C# bend beyond its elasticity point.
Here is a similar thread expressing your concerns.
http://forums.wpcentral.com/windows-phone-apps/204490-video-editing-apps.html
They have made the point that there isn't a single video editing tool on the entire market.
With how long the market has been around I would assume this is because it's not a capability in C#. Which happens to be 99% of the developers working on windows phone right now.

Metro MediaCapture MFT Effect Explaination

I'm trying to apply an effect on a mediacapture stream for a WPF app I'm porting over to Metro. In the WPF app I used Pixel shaders to modify a bitmap whose source was set to the stream of a webcam, but since effects have been dropped for Metro I'm looking for an alternative solution.
The best, and most Metro standards compliant, way of doing this that I've found is building my own MFTs and adding them to my MediaCapture element via the addEffectAsync() method. I've downloaded the MFTGrayscale and MediaExtension examples which show how to apply these effects to a MediaCapture element, but I'm having an issue understanding the actual C++ MFT code. Can someone point me to or give a decent walkthrough/explanation of how I'd go about building my own MFT effect from the ground up? I don't know too much C/C++, just enough to understand some of the example code. I'm really having trouble with the conceptual and architectural aspects of MFT, and hence am very confused by the source code.
Your help is very much appreciated.
EDIT:
Another option I'd consider is using SharpDX. However I'm having issues getting a stream of the MediaCapture object to display on a xaml image element. Any help would be appreciated. Thanks.
You should absolutely have a look at the following git repo: https://github.com/mmaitre314/VideoEffect
It shows how to apply image effects from the Lumia Imaging SDK, Win2D, and DirectX HLSL pixel shaders to videos in Universal Store Apps for Windows Phone 8.1 and Windows 8.1.
Effects can be applied via MediaTranscoder, MediaComposition, MediaCapture, or MediaElement. And the binaries are available via NuGet.
I ended up getting answer on the MSDN forums. It's not an ideal answer, but it's what I'd been fearing all along.
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/f3a6934e-df7a-44da-bfd8-7b95d494ff43/#90690f89-e57d-4043-9881-60fcc587f736
This is totally doable... I've just rewritten one of the MF transforms from the samples to use the Nokia Imaging SDK and apply filters in real-time to webcam video. You can see how I did it at the link below (plus download some source code). It's not exactly what you need to do, but in the wiki page I explain what you need to change from the boilerplate sample that MS provided.
http://developer.nokia.com/community/wiki/Template_universal_app_for_video_recording_with_MediaCapture_using_Imaging_SDK_Filters

C# tutorial for "listening" to the line in device

I know the obvious answer is "try google..." but i have and I either end up with graphics or cmd-line tutorials, so...
Can anyone point I in the direction of a c# tutorial for "listening" to the audio line-in? Or is it straight forward with the right namespace included? Is it even possible without using directx or some such.
I want to detect external audio activity and report it on screen.
Cheers,
This code sample looks like it has everything that you need: VolumeMeter
Presumably you just need to change the code so that instead of rendering the current volume levels you could return a flag indicating whether "something" is going on.
It's using the Managed DirectX library, which is a managed code wrapper for the native DirectX APIs.
You need an external library to do that. These have .NET bindings:
FMOD is widely used in games, and has an opensource license (and a paid one).
BASS Audio Library is another choice. It's a bit more lightweight.
IrrKlang I haven't use this one, but I was told it is worth the money
NAudio I found just now, because I forgot the IrrKlang's name, and had to google for it. This one looks promising.
OR MDX can do this I think.
check out the VoiceRecorder sample application on Codeplex which shows how to do this using NAudio. This Coding4Fun article explains it in more detail.

How to implement face recognition in an image in .net 3.5?

I need to implement face recognition like in orkut album.
In my website when a user uploads a photo and checks the photo in album I need to implement the feature and place rectangles over the faces in photo like in orkut album like in this link.
Please help me to implement this.
Thanks in advance.
You need to use OpenCV, or more specifically, a C# wrapper library for OpenCV.
I think you can implement some (very) basic face detection using OpenCVDotNet, although you should be aware that I don't think it's actively being developed. I just noticed I'm still on the list as a project committer, but I haven't done any work on it for a long time (if ever, can't remember why I got added in the first place).
You should probably go with Emgu CV, which is a much better C# wrapper for OpenCV. It is actively developed, and is compatible with OpenCV 2.0, and has a wider community surrounding it, and the documentation is good enough that you can easily get face detection working pretty quickly.

Categories