Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Augmented reality project

Augmented reality project

Scheduled Pinned Locked Moved C#
2 Posts 2 Posters 138 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    taif1984
    wrote last edited by
    #1

    Hi I want code in c# insert virtual object in video frames with consideration light and shadow consistency how to make that help me please

    • list item
    1 Reply Last reply
    0
    • S Offline
      S Offline
      sneha2004sahani2004
      Banned
      wrote last edited by
      #2

      If you want to drop a virtual object into video frames in C#, you’ll need two parts:
      Frame handling - use EmguCV (OpenCV wrapper for C#) to read/write video.
      Rendering - either fake it with Graphics (draw shapes + shadows) or go full 3D with Unity/HelixToolkit, where you can match light and cast shadows.

      Here’s a tiny fake example with EmguCV to show the idea (draws a ball + shadow on each frame):
      var cap = new VideoCapture("input.mp4");
      var writer = new VideoWriter("output.mp4", FourCC.H264, 30, cap.Width, cap.Height, true);
      Mat frame = new Mat();

      while (cap.Read(frame))
      {
      var img = frame.ToImage<Bgr, byte>().ToBitmap();
      using (var g = Graphics.FromImage(img))
      {
      g.FillEllipse(Brushes.Gray, 260, 260, 100, 100); // shadow
      g.FillEllipse(Brushes.Blue, 250, 250, 100, 100); // object
      }
      writer.Write(new Image<Bgr, byte>(img).Mat);
      }

      That’s the basic overlay idea. For real lighting/shadows, you’ll need a 3D engine (Unity + C#) where you can match scene light and render the object properly.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups