Skip to content

Commit

Permalink
header file access in native code
Browse files Browse the repository at this point in the history
  • Loading branch information
olir committed Mar 21, 2018
1 parent e760583 commit 2497ee2
Show file tree
Hide file tree
Showing 182 changed files with 76,587 additions and 55 deletions.
46 changes: 16 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ It's a small, open-source platform for OpenCV-based video filtering, where custo

<img src="doc/pipeline.png" width="100%">

When you work on custom filters, you can concentrate on manipulating images with the OpenCV library.
For a list of available filters and HOWTO see [SegmentFilters.md](https://github.com/olir/Frankenstein/blob/master/doc/SegmentFilters.md).
For developers: When you work on custom filters, you can concentrate on manipulating images with the OpenCV library. A list of available filters see: [SegmentFilters](https://github.com/olir/Frankenstein/blob/master/doc/SegmentFilters.md).

The pipeline allows input as video file, camera, network stream or pictures stored as left/right 3D slides (e.g. from nikon camera).

So Frankenstein VR can e.g. be used to convert anaglyph or side-by-side 3D videos for VR display,
Frankenstein VR can e.g. be used to convert anaglyph or side-by-side 3D videos for VR display,
and the output video can be perfectly viewed in 3D with VR Hardware and a video players like [LittlStar](http://littlstar.info).
VR videos appear like displayed on a virtual 160-inch curved 3D display in front of you.

Expand All @@ -22,49 +21,36 @@ VR videos appear like displayed on a virtual 160-inch curved 3D display in front
## Samples
I have uploaded some samples to vimeo: <a href="https://vimeo.com/user68089135"><img src="doc/vimeo.png"/></a>

## Features
Frankenstein VR is an experimental video converter with some video filters/features:
- Virtual Reality side-by-side converter (projection, padding, shrinking)
- Anaglyph (e.g. red/blue) to grayscale side-by-side converter
- 3D Slideshow (SBS Video from 3D image pairs; see [samples](doc/slides) )
- Over/Under to Left/Right (side-by-side) converter
- Left/Right side swapper
- Test Image (good for calibrating configurations on a VR display)
Some filters can be chained together.

## Status

[![Build Status](https://travis-ci.org/olir/Frankenstein.png)](https://travis-ci.org/olir/Frankenstein/builds) [![Dependency Status](https://www.versioneye.com/user/projects/594a6802368b0800421af505/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/594a6802368b0800421af505)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.screenflow/frankenstein/badge.png)](https://maven-badges.herokuapp.com/maven-central/de.screenflow/frankenstein)

Latest Release: 0.1 - Windows only (Developed/Tested on a Windows 10 64bit)

Master branch (0.2): Cam and network stream support.

For current or full status see [Release Notes](https://github.com/olir/Frankenstein/blob/master/doc/RELEASE-NOTES.md).

# HOWTO run it
Install Pre-Requisites first (see below), then you have 3 options to start it:
* _Jar execution:_ Download and execute the jar file from the release (see section below)
* _Java Webstart:_ You can execute releases with Java Webstart (see section below)
* _From Maven:_ For the current version, use maven and run it in app folder with "mvn clean package exec:exec"
* _From Maven:_ For the current version, use maven and run it in app folder with **mvn -pl .,app clean package exec:exec**

# Pre-Requisites
## Pre-Requisites
- [FFmpeg 3.1.1+](https://ffmpeg.org) installed. Select path at first startup (is stored in frankenstein.ini at user-home)
- [Java JRE 1.8+](https://java.com) installed.
- [VLC 2.2.8](https://mirror.de.leaseweb.net/videolan/vlc/2.2.8/) installed for network stream recording support.
# Provided (do not install)
*** Provided (do not install) ***
- [OpenCV 3.2.0+](http://www.opencv.org/releases.html)


## Summary for Users
Frankenstein VR is an experimental video converter with some video filters/features:
- Virtual Reality side-by-side converter (projection, padding, shrinking)
- Anaglyph (e.g. red/blue) to grayscale side-by-side converter
- 3D Slideshow (SBS Video from 3D image pairs; see [samples](doc/slides) )
- Over/Under to Left/Right (side-by-side) converter
- Left/Right side swapper
- Test Image (good for calibrating configurations on a VR display)
Some filters can be chained together.

## Summary for Programmers
If you like to experiment with video filters based on OpenCV just fork it.
It is a very small and easy to extend Java Tool with JavaFX frontend.
Uncompressed temporary video makes it a little bit slow, but the rest of it is pretty fast because it is mostly build on existing libraries: OpenCV for graphic processing and ffmpeg for video/audio processing. The Graphical Interface (Java FX) is optional. It was a little bit tricky to get the toolchain working with acceptable quality.


But now... It's alive!


### FFMPEG OpenH264 support ###
FFMPEG build contains H264 encoder based on the OpenH264 library, that should be installed separatelly.
OpenH264 Video Codec provided by Cisco Systems, Inc.
Expand Down
6 changes: 3 additions & 3 deletions doc/SegmentFilters.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ select you filter from drop down, optionally configure it and press __ok__. Now

**Provide a gcc compiler (choose one):**
* windows 64-bit
1. Download [mingw](https://sourceforge.net/projects/mingw-w64/).
1. Download [mingw](https://sourceforge.net/projects/mingw-w64/) or [archive](https://sourceforge.net/p/mingw-w64/mailman/message/32967954/).
2. Install with 'Architecture' option 'x86_64' when prompted at settings.
3. Add ~YourMinGWPath/bin to PATH
* windows 32-bit
1. [Instructions & Download](http://www.mingw.org/wiki/Getting_Started)
1. [Instructions & Download](http://www.mingw.org/wiki/Getting_Started) or [archive](https://sourceforge.net/p/mingw-w64/mailman/message/32967954/)
2. install gcc package with: mingw-get install gcc
3. Add ~YourMinGWPath/bin to PATH

Expand All @@ -153,6 +153,6 @@ mvn clean package

Test JNI loading with:
```
java -Djava.library.path=target -cp target/frankenstein-jniplugin-java-0.1.1-SNAPSHOT.jar cc0.NativeCode
java -Djava.library.path=target -cp target/jniplugin-java-0.1.1-SNAPSHOT.jar cc0.NativeCode
```
Some message shoud appear: **Hello from C!**
29 changes: 19 additions & 10 deletions jniplugin/java/src/main/java/cc0/NativeCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ public class NativeCode

public static void main(String[] args)
{
if(System.getProperty("os.arch").contains("64")) {
// load 64-bit lib
System.loadLibrary("frankenstein-jniplugin-64");
}
else {
// load 32-bit lib
System.loadLibrary("frankenstein-jniplugin-32");
}
new NativeCode().helloNative();
}
try {
if(System.getProperty("os.arch").contains("64") && System.getProperty("sun.arch.data.model").contains("64")) {
// load 64-bit lib
System.loadLibrary("jniplugin-64");
}
else {
// load 32-bit lib
System.loadLibrary("jniplugin-32");
}
}
catch (Throwable t) {
System.out.println("sun.arch.data.model="+System.getProperty("sun.arch.data.model"));
System.out.println("os.arch="+System.getProperty("os.arch"));

t.printStackTrace();
}

new NativeCode().helloNative();
}
}
73 changes: 73 additions & 0 deletions jniplugin/native/include/opencv/cv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/

#ifndef OPENCV_OLD_CV_H
#define OPENCV_OLD_CV_H

#if defined(_MSC_VER)
#define CV_DO_PRAGMA(x) __pragma(x)
#define __CVSTR2__(x) #x
#define __CVSTR1__(x) __CVSTR2__(x)
#define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : "
#define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg))
#elif defined(__GNUC__)
#define CV_DO_PRAGMA(x) _Pragma (#x)
#define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg))
#else
#define CV_DO_PRAGMA(x)
#define CV_MSG_PRAGMA(_msg)
#endif
#define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x)

//CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module")

#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/photo_c.h"
#include "opencv2/video/tracking_c.h"
#include "opencv2/objdetect/objdetect_c.h"

#if !defined(CV_IMPL)
#define CV_IMPL extern "C"
#endif //CV_IMPL

#endif // __OPENCV_OLD_CV_H_
60 changes: 60 additions & 0 deletions jniplugin/native/include/opencv/cv.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/

#ifndef OPENCV_OLD_CV_HPP
#define OPENCV_OLD_CV_HPP

//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif

#include "cv.h"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/video.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/objdetect.hpp"

#endif
57 changes: 57 additions & 0 deletions jniplugin/native/include/opencv/cvaux.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/

#ifndef OPENCV_OLD_AUX_H
#define OPENCV_OLD_AUX_H

//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif

#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/photo_c.h"
#include "opencv2/video/tracking_c.h"
#include "opencv2/objdetect/objdetect_c.h"

#endif

/* End of file. */
52 changes: 52 additions & 0 deletions jniplugin/native/include/opencv/cvaux.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/

#ifndef OPENCV_OLD_AUX_HPP
#define OPENCV_OLD_AUX_HPP

//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif

#include "cvaux.h"
#include "opencv2/core/utility.hpp"

#endif

0 comments on commit 2497ee2

Please sign in to comment.