How to take high quality photo from integrated camera in WPF - c#

I'm implementing WPF app where I need to take high quality photos from integrated camera. So far I've been successful with capturing video and taking frames from it (described for example here: Wpf and C # capture webcam and network cameras).
But this is not what I want - because video frame quality is not so great. I have MS Surface 4 Pro which has 8Mpx camera with full HD video support and with the above method I'm able to just get full HD frame from it. But I would like to have full 8Mpx picture, like it is possible to take in the native Windows Camera app.
In UWP I would probably have been successful with CameraCaptureUI class, but I didn't find any clues for WPF.
Does anyone has an idea how this could be implemented?

I've found out that XAML Islands do work with .NET Framework 4.8. So I've been able to implement a WPF solution using UWP components MediaCapture and CaptureElement. With that I can take photos with full resolution which was my goal.
Simple sample project can be found here: https://github.com/ondrasvoboda/WPFCamera, consider it just as a proof of concept.

If your app will run on Windows 10 or above, you can now use most of the APIs from Windows 10 in a WPF application.
https://blogs.windows.com/windowsdeveloper/2019/04/30/calling-windows-10-apis-from-a-desktop-application-just-got-easier/

Related

How to identify signs(Logos) using windows phone 8 camera

HI friends...I am going to develop Windows phone 8 app (Xaml/C#) which can identify signs (Like famous Logos) using camera. It is like capturing QR code using windows phone. As an example through my application I can scan (like QR code) and identify the Logo which appears in somewhere in board or a picture etc... (Think I have database which is filled with logo information (logo pictures an info) and I connected it to windows phone app.)So my questions are What are the image processing SDKs and libraries I can use to develop this app ?Is there any Blog post which describes those things?Any sample codes?
Thank you very much in Advance 
This is a library which has proven to work on WP7 so i'm guessing it will work on WP8 aswell.
It main purpose was augmented reality but its a "vision" library which means you can probably do loads of other vision commands (labelblobs, invert colors etc..)
Link to the library: Here
Samples of its use: Here

Visualizing Audio while recording in Windows Phone 8

I`m trying to make an windows phone 8 app which simply allow you to click a button which result in start recording and showing any visualization that indicate that its recording something like a bar or a vu meter , I managed to make the recording part, now i dont know what type of projects i should use to support making such visualization.
does Windows phone 8 apps support using XNA to draw in a box inside a xaml file ?
what is the tag i can use to draw inside using XNA code ?
If you're targeting WP8 you can't use the hybrid SL/XNA model. That said, you can certainly use a Hybrid solution that draws using DirectX. You can find general information here and a sample here (note that it uses DrawingSurfaceBackgroundGrid, you probably want DrawingSurface).

Get Video from webcam / Ip-camera

I'm trying to implement camera security in my application. I got some SDK's from some security companys to implement there system but they all use ActiveX. My view right now is that ActiveX is kinda old?
But what is the newest way to get video from devices and display (stream) them on a screen?
What control to use in .net 4.5 WPF (and Windows 8)
I'm working on video WPF app for two years now and we had a fundamental problem with video and WPF which was never resolved, and that's variable fps-rate. This blog post goes into details.
There's also a nice library called Media Kit (by Jeremiah Morrill), it might be suitable for your problem.
In our solution we had no choice but to expose HWND's for our rendering DirectX engine. We accomplished this by using HwndHost class and extending it to our custom WPF control. Note this is the base class for windows forms host, so you get the same amount of problems as with WinForms-WPF inter op.
Also, ActiveX is the only way to display professional camera video streams in web interfaces, it's still a defacto industry standard, you'll get it from MOXA, Acti, Vivotek and various other camera equipment manufactureres.
One more thing, if you need to perform some advanced analysis of video, I'd suggest OpenCV.

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

Interfacing with a webcam

So I am trying to develop a WPF app that will allow me to turn off the auto zoom and auto focus abilities of my webcam. I'm using the Emgu c# wrapper for opencv and want to be able to do frame differencing without my camera auto focusing when an object comes into the screen.
I have tried looking for an sdk that would allow me to develop something like this but apparently logitech ditched theirs a couple of years ago. I am using an HD pro Webcam c920. I have heard that maybe you can use the dll's that shipped with it to tweak the options but I have no idea how to do this.
Any help would be awesome.
Logitech HD Pro Webcam C920's Zoom, Exposure, Focus can be controlled using DirectShow API. Chances are high that Emgu CV is using DirectShow to capture (always, or as an option), or at least you possibly can set the camera up using DirectShow and the settings would survive restart of streaming sessions.
C920's properties are available using IAMCameraControl interface. It is documented on MSDN for native development, and DirectShow.NET offers respective definitions for .NET.

Categories