Sunday, August 31, 2014

VD EFTP

Added second FTP through Email Rather than Drive in case some members do not wish to use Drive


Private Sub EFTP()
Try
          Dim Smtp_Server As New SmtpClient
          Dim e_mail As New MailMessage()
          Smtp_Server.UseDefaultCredentials = False
          Smtp_Server.Credentials = New Net.NetworkCredential(OBJ.Text, OPER.Text)
          Smtp_Server.Port = 587
          Smtp_Server.EnableSsl = True
          Smtp_Server.Host = "smtp.gmail.com"

          e_mail = New MailMessage()
          e_mail.From = New MailAddress(CMD.Text)
          e_mail.To.Add(txtTo.Text)
          e_mail.Subject = "Email Sending"
          e_mail.IsBodyHtml = False
          e_mail.Body = commander.Text
          Smtp_Server.Send(e_mail)
          MsgBox("Mail Sent")

      Catch error_t As Exception
          MsgBox(error_t.ToString)
      End Try

End Sub

Rotoscoping tools

Real quick set of programs to do rotoscoping for video effects. First a program to fragment the video in to pictures:

import processing.video.*;
Movie move;
int a=0;

void setup() {
  size(200, 200);
  background(0);
  move= new Movie(this, "example.mov");
  move.loop();
}

void draw() {
  image(move, 0, 0);
}

// Called every time a new frame is available to read
void movieEvent(Movie m) {
  m.read();
  save(a+".png");
  a=a+1;
}



And then a rotoscoping tool:

PImage imgC, imgBW;
int a =0;
// Size of transparency area around the mouse
int HALF_HOLE_SIZE = 7;
// Change to true to avoid restoring opacity (ie. paint with background image)
boolean bPersist = true;
int a=0;
void setup()
{
  size(300, 400);
  // Load a color image
  imgC = loadImage("book.jpg");
  // Load a black & white image (the same)
  imgBW = loadImage(a+".png");
  // Indicate we need transparency on this image
  imgBW.format = ARGB;
  noStroke();
  smooth();
  background(255);
}

void draw()
{ 
  // Draw the color image
  image(imgC, 0, 0);
  if (!bPersist)
  {
    // Restore opacity on previous position
    if (mousePressed==false) {
      ChangePixels(pmouseX, pmouseY, true);
    }
  }
  if (mousePressed==true) {
    // Make pixels transparent around the mouse position
    ChangePixels(mouseX, mouseY, false);
    // Draw the altered B&W image
    image(imgBW, 0, 0);
  }
} 

void ChangePixels(int x, int y, boolean bMakeOpaque)
{
  
  if (x <= HALF_HOLE_SIZE || x &rt;= imgBW.width - HALF_HOLE_SIZE) return;
  if (y <= HALF_HOLE_SIZE || y &rt;= imgBW.height - HALF_HOLE_SIZE) return;
  // Get the pixel data
  imgBW.loadPixels();

  for (int i = x - HALF_HOLE_SIZE; i <= x + HALF_HOLE_SIZE; i++)
  {
    for (int j = y - HALF_HOLE_SIZE; j <= y + HALF_HOLE_SIZE; j++)
    {
      if (bMakeOpaque)
      {
        imgBW.pixels[i + j * imgBW.width] |= 0xFF000000;
      }
      else // Make transparent
      {
        imgBW.pixels[i + j * imgBW.width] &= 0x00FFFFFF;
      }
    }
  }
  // Update the modified pixels
  imgBW.updatePixels();
}
void keyPressed() {

  if (key=='s');
  save(a+".png");
  a=a+1;
}



Saturday, August 30, 2014

VD New Features

Also added some new features to VD and Open Bio. Vd now has an FTP through Google Drive
as well as a redesigned GUI:
and a Neumman System(Code which edits itself) and a Fluid Type system which are coming out in the next update. Also the OCTR(Open Cosmic Ray Telescope) will have it's own blog post soon, unforturnately some of the supplies are taking  a while. When that is released there will be full schematics and open software which I shall place in the XOS Industries Software Repo.

Book and Paper


and CMI Paper:
Arxiv