Giter Site home page Giter Site logo

movie-fleur's Introduction

movie-fleur ๐ŸŒป

emoji-log CircleCI

Convert 3D movies with splited Frames to Anaglyph 3D movies to watch with 3d Red (Blue/Cyan/Green) Glasses

Convert from video file with given framePosition

If a 3D video is available the frames can be extracted from the Video by applying the frame Position. 3D video Files can be found here: YTS

BufferedImage frame = FleurVideo.extract(new File("3dVideo.mp4"), 6000);

List<BufferedImage> splited = Fleur3dUtil.split(frame);
BufferedImage frameCombined = FleurFilter.additive(
        FleurFilter.color(splited.get(0), ColorMask.RED),
        FleurFilter.color(splited.get(1), ColorMask.CYAN));

ImageHelper.saveImage(frameCombined, "frame_combined.png");

1. Extract frames from video file

FleurVideo.extract(new File("3dVideo.mp4"), 6000);

2. Split and stretch frames

left right
List<BufferedImage> splited = Fleur3dUtil.split(frame);

3. Combine Frames to one image (No color filtering)

BufferedImage combined = FleurFilter.alphaCombine(frame1, frame2);

4. Apply color filter

left right
RGB(x, 0, 0) / 0xFFFF0000 RGB(0, x, x) / 0xFF00FFFF
BufferedImage redFilterImg = FleurFilter.color(splited.get(0), FilterColor.RED);
BufferedImage greenBlueFilterImg = FleurFilter.color(splited.get(1), FilterColor.CYAN);

5. Combined with filter

Additive Color filtering => For every Pixel on final Image RGB(LeftImage.red, RightImage.green, RightImage.blue)

BufferedImage additiveCombinedFrame = FleurFilter.additive(
        FleurFilter.color(splited.get(0), FilterColor.RED),
        FleurFilter.color(splited.get(1), FilterColor.CYAN)
);

6. Compile to Video

// Extract images from Video (specific from frames 6000 - 6200)
List<BufferedImage> images
        = FleurVideo.extract(new File("3dVideo.mp4"), 6000, 6010);

List<BufferedImage> videoImages = new ArrayList<>();
for (BufferedImage image : images) {
    List<BufferedImage> splits = Fleur3dUtil.split(image);

    videoImages.add(FleurFilter.additive(
            FleurFilter.color(splits.get(0), ColorMask.RED),
            FleurFilter.color(splits.get(1), ColorMask.CYAN)
    ));
}

FleurVideo.create(videoImages, "3dVideoOut.mp4");

7. Compile to polarized 3d Video (left/right)

List<BufferedImage> images = FleurVideo.extract(new File("3dVideo.mp4"), 6000, 6100);

List<BufferedImage> leftArray = new ArrayList<>();
List<BufferedImage> rightArray = new ArrayList<>();

for (BufferedImage image : images) {
    List<BufferedImage> splits = Fleur3dUtil.split(image);
    leftArray.add(splits.get(0));
    rightArray.add(splits.get(1));
}

FleurVideo.create(leftArray, "left.mp4");
FleurVideo.create(rightArray, "right.mp4");

To use: play both videos at the same frames but on two diffrent beamers.... I dont have two beamers... well. I havent tested this acctually

Or use active shutter 3d glasses requires 60hz monitor and switching on each frame to the other video... Active_shutter_3D_system

Further Filters

Default
Additive Blue Yellow
FleurFilter.additive(
        FleurFilter.color(splits.get(0), ColorMask.BLUE),
        FleurFilter.color(splits.get(1), ColorMask.YELLOW)
);               
Additive Green Magenta
FleurFilter.additive(
        FleurFilter.color(splits.get(0), ColorMask.GREEN),
        FleurFilter.color(splits.get(1), ColorMask.MAGENTA)
);               
Indexed
ImageHelper.convertToType(frame, BufferedImage.TYPE_BYTE_INDEXED)
               
Red
FleurFilter.color(frame, ColorMask.RED)
               
Green
FleurFilter.color(frame, ColorMask.GREEN)
               
Blue
FleurFilter.color(frame, ColorMask.BLUE)
               
Cyan
FleurFilter.color(frame, ColorMask.CYAN)
               
Gray
FleurFilter.gray(frame)
               
Binary
ImageHelper.convertToType(frame, BufferedImage.TYPE_BYTE_BINARY)
               
Transparent (0.5)
FleurFilter.transparent(frame, 0.5)
               
Invert
FleurFilter.invert(frame)
               

movie-fleur's People

Contributors

orbitertoad avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.