Easily build OpenCV-powered apps for Windows Store!

MS Open Tech is helping Windows Phone 8 and WinRT 8.1 Developers to easily include OpenCV functionality in their apps.

OpenCV experts will now be able to build the most commonly used OpenCV modules for Modern Windows Devices. Everyone else can take a shortcut, and save considerable time by accessing ready-to-use binaries directly from the MS Open Tech GitHub repository!

Use OpenCV functionality in Windows Store Apps built for WinRT 8.1

Developers can now mix Win8 code (Based on WinRT, Windows Runtime for Modern apps) with OpenCV code. They can also re-use existing OpenCV code (by adding it within the WinRT projects and solutions). Developers can also use XAML to define the screen layout (using the familiar XAML controls, binding, etc) and combine it with OpenCV code, or directly use the main screen as a drawing surface for OpenCV code.

clip_image002[6]

 

Use OpenCV functionality in Windows Phone 8 Apps​.

OpenCV can now also run within XAML Phone applications, so developers can use OpenCV in their apps and publish it to the Windows Phone store. As with WinRT, developers can use XAML, OpenCV or a combination of the two.

clip_image004[6]

 

Windows Store App Certification

Thanks to some targeted tweaks just contributed to the OpenCV Community, the supported modules API calls are now compatible with the WinRT and Windows Phone platform requirements. This means that not only your OpenCV-enabled application will build and run properly, but it will also pass the Windows Store Certification tests :-)

This is just the beginning!

We encourage you to get your hands on the code. In addition to any bug reports on GitHub, we welcome your feedback on new features and any suggestions on how we can make the development of OpenCV-powered Windows Store apps even easier. Do you use OpenCV in conjunction with some popular OSS framework? Do you have a special scenario in mind for your Windows Phone game or creative app? We’d love to help!

Adalberto Foresti

Principal Program Manager

Microsoft Open Technologies, Inc.

A Subsidiary of Microsoft Corporation


10 thoughts on “Easily build OpenCV-powered apps for Windows Store!

  1. Pingback: Easily build OpenCV-powered apps for Windows Store!

  2. Excellent.
    Just wonder you could make two samples at the folders,
    (1) samples\cpp\tutorial_code\objectDetection and
    (2) samples\cpp\tutorial_code\TrackingMotion as Windows Store apps
    as did for ImageManipulations.

  3. Should I be able to use C# to program against this? Any plans to publish as a nuget?

    Call me greedy, but something like OpenCVSharp for WinRT would be truly awesome. Then I can just grap the nuget and go … in c# …

  4. I tried to use this, but there are some glaring bugs in the opencv phonetutorial sample:
    (see https://github.com/MSOpenTech/opencv/blob/winrt/samples/winrt_universal/PhoneTutorial/MainPage.xaml.cpp )


    byte* pPixels = GetPointerToPixelData(m_bitmap->PixelBuffer);
    int height = m_bitmap->PixelHeight;
    int width = m_bitmap->PixelWidth;
    // create a matrix the size and type of the image
    cv::Mat mat(width, height, CV_8UC4);
    memcpy(mat.data, pPixels, 4 * height*width);

    while the constructor for cv::Mat looks like this:
    C++: Mat::Mat(int rows, int cols, int type, const Scalar& s)

    (note the [rows, cols] versus [width, height])

    Of course, swapping x and y like this totally garbages your data.

    Then another bug:


    // convert to grayscale
    cv::Mat intermediateMat;
    cv::cvtColor(mat, intermediateMat, CV_RGB2GRAY);

    while the actual format is 8UC4 containing BGRA formatted pixels. The correct conversion should be

    cv::cvtColor(mat, intermediateMat, CV_BGRA2GRAY);

    After fixing these, at least the conversion to and from usable matrices is correct.

  5. @mmusterd: thanks for trying out the code and catching these issues. Please feel free to submit a pull request with your fixes. We’ll make sure that it gets reviewed promptly. We’ll also double check all the test code as part of our (upcoming) refresh of the code on github. Cheers, Adalberto

  6. Thanks, I did just that. I am looking further into it though, since my algorithm still gives unexpected results. Once I am sure about any additional problems and their solution I will create another pull request.

Leave a Reply