|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Facemorph.psychomorph.videomorph.VideoMorph
public class VideoMorph
Video morphing class, just morphs between two delineated videos doing time resampling
Constructor Summary | |
---|---|
VideoMorph()
|
Method Summary | |
---|---|
java.awt.image.BufferedImage |
getFrame(int frame,
float weight)
Get an interpolated frame |
float[] |
getFrames(int outFrame,
float weight)
Gets the frame number to morph from the two sequences for output frame outFrame at morph weight |
java.awt.image.BufferedImage |
getImage1(int i)
Get the ith image from set 1 |
java.awt.image.BufferedImage |
getImage2(int i)
Get the ith image from set 2 |
float |
getLength(float weight)
Gets the length of the interpolated sequence |
int |
getLengthData1()
Get the length of image set 1 |
int |
getLengthData2()
Get the length of image set 2 |
java.util.ArrayList<java.awt.image.BufferedImage> |
getMorph(float weight)
Calculates and gets the morphed sequence |
java.util.ArrayList<Template> |
getMorphTemplates()
Get the templates, should only be called after getMorph |
Template |
getTemplate1(int i)
Get the ith template from set 1 |
Template |
getTemplate2(int i)
Get the ith template from set 2 |
static void |
main(java.lang.String[] args)
Test method |
void |
readData1(java.lang.String list1)
Read the first set of images (video data split into images) |
void |
readData2(java.lang.String list2)
Read the second set of images (video data split into images) |
static void |
readImagesAndTemplates(java.lang.String listFile,
java.util.ArrayList<java.awt.image.BufferedImage> images,
java.util.ArrayList<Template> templates)
Read images and templates from a file |
void |
readTimePoints(java.lang.String timepoints)
Read a file containing time points The time points should be arranged on two lines, one for each sequence the times should be integer frame numbers and should be in order probably best starting at 0 and ending at the length of the sequence |
void |
setProgressBar(javax.swing.JProgressBar pb)
Set the progress bar that needs to be notified of progress updates |
void |
writeImages(java.util.ArrayList<java.awt.image.BufferedImage> images,
java.lang.String outputRoot)
Write the sequence to file |
void |
writeTemplates(java.util.ArrayList<Template> templates,
java.lang.String outputRoot)
Write the sequence templates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VideoMorph()
Method Detail |
---|
public static void readImagesAndTemplates(java.lang.String listFile, java.util.ArrayList<java.awt.image.BufferedImage> images, java.util.ArrayList<Template> templates) throws java.io.FileNotFoundException, java.io.IOException
listFile
- the list of images and templatesimages
- the image array to put the images intotemplates
- the template array to put the templates into
java.io.FileNotFoundException
java.io.IOException
public void setProgressBar(javax.swing.JProgressBar pb)
pb
- the progress bar to updatepublic void readData1(java.lang.String list1) throws java.io.FileNotFoundException, java.io.IOException
list1
- the list file for the video frames
java.io.FileNotFoundException
java.io.IOException
public void readData2(java.lang.String list2) throws java.io.FileNotFoundException, java.io.IOException
list2
- the list file for the video frames
java.io.FileNotFoundException
java.io.IOException
public java.awt.image.BufferedImage getImage1(int i)
i
- the image index to retrieve
public java.awt.image.BufferedImage getImage2(int i)
i
- the image index to retrieve
public Template getTemplate1(int i)
i
- the template index to retrieve
public Template getTemplate2(int i)
i
- the template index to retrieve
public void readTimePoints(java.lang.String timepoints) throws java.io.FileNotFoundException, java.io.IOException
timepoints
- the file containing the timepoints
java.io.FileNotFoundException
java.io.IOException
public float getLength(float weight)
weight
- the fraction from sequence 1 to sequence 2
public float[] getFrames(int outFrame, float weight)
outFrame
- the output frame numberweight
- the fraction of sequence 2 to included in the blended video
public java.awt.image.BufferedImage getFrame(int frame, float weight)
frame
- the output frame numberweight
- the fraction of sequence 2 in th blended video
public java.util.ArrayList<Template> getMorphTemplates()
public java.util.ArrayList<java.awt.image.BufferedImage> getMorph(float weight)
weight
- teh fraction from sequence 1 to sequence 2
public void writeImages(java.util.ArrayList<java.awt.image.BufferedImage> images, java.lang.String outputRoot) throws java.io.IOException, java.io.FileNotFoundException
images
- the images to writeoutputRoot
- the output name (frame number and .jpg are appended)
java.io.IOException
java.io.FileNotFoundException
public void writeTemplates(java.util.ArrayList<Template> templates, java.lang.String outputRoot) throws java.io.IOException, java.io.FileNotFoundException
templates
- the templates to writeoutputRoot
- the output file name (frame number and .jpg are appended)
java.io.IOException
java.io.FileNotFoundException
public int getLengthData1()
public int getLengthData2()
public static void main(java.lang.String[] args) throws java.io.IOException, java.io.FileNotFoundException
args
- the command line arguments
java.io.IOException
java.io.FileNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |