Sunday, May 31, 2009
Presentation Practice
We are hopeful about giving a good presentation on Wednesday.
Preparation for Presentation
We decided that we all should talk. And we would focus on the following points.
*Goal
*Problem Space
*Solution
*Open Problems
Wednesday, May 27, 2009
Final Turn-in
Note: In the tech doc we also added open problems and future scopes for future developers.
We are happy what we turned in. Hope this would help to analyze a video for research work.
Thanks
Final Doc Revision
Revised the ReadMe file.
It was little cumbersome and take time.
GUI / Docs revision and Test Build
Later Me and Fan also did the Docs revision.
I did some test build and tested with Mac and Windows. Works in both OS.
Tuesday, May 26, 2009
Cnetroids for frames with no fingers
But still (0,0) is inside the image grid. Perhaps (-1,-1) something for sure outside the grid.
And we finally ended up putting (-1,-1) for centroids that were not found in the frame.
Frame Rate and Need to be in XML file ?
Well I think we do not need 30fps or even 20 fps rather 10 fps should be enough as finger does not moves as fast as eyes. Even eyes should be OK with 10 fps to track changes. I think higher fps would slow down the tracking. Using 30 fps is something like we have unnecessary points to draw a straight line which can be actually drawn with 2 points. Don’t prove our program is a slower one. :)
Actually I think we do not need more than 10 fps and can make it as our suggested standard.
If someone want to use our program then they can convert video to whatever fps they use.
Again the problem comes like we are making our program fixed with 30fps. In case some one try testing a video of 60fps or 15 fps still our xml file should have time = 1/30 * frameNo not 1/15 or 1/60 .
So is there any way picking up fps from video that someone feed to our program ?
If no then … use a standard small fps which is sufficient to analyze data without loosing data and do not take much time to track with our program.
......
Fan was wondering whether we need to put frame rates in XML file ?
My Ans is:
We do not need to store frame rate. If we can pick it up from whatever video we open to process then
Calculate time t = (1/frame_rate) * frameNo and put
By this way XML file should have accurate time for a video with whatever fps it has.
Frame Rate and XML file Test
Test: 1finger.avi
Video Time : 14 sec video
No of Frames : 99
Now if it is true that the video is having 30 fps (frames per sec) when converted to uncompressed AVI then:
No of frames should be = 30 fps * 14 sec = 420 frames but actually it is 99 frames stacked into the program stack.
I think the frames per second is not 30 or may be I am missing something.
Correct me if I am wrong in calculation. We need to figure it out before we give the XML file to signal team and this would help Fan "what to put in time attribute in each event element". Right now she is printing frame no.
We need to come up with some calculations so that number of frames stacked into the program and fps make sense to produce some values to put in time attribute in each event element of any xml file.
I wont worry about picking up time from video. That is a long term goal and Fan is putting the the time when video is processed and some what make sense. But if we can not relate No of frames produced with video length then the signal team wont be able to analyze our XML file to produce anything meaningful and findings would be meaning less.
Lets work on it. Looking forward to the "video sub team(Peter/Fan)"-------->
The tested frame was actually 7fps and so 7 X 14 =98 was OK.
General GUI look change
How about opening the Finger Map Window in main window (Finger Tracking) rather than in a separate window.
And making the Finger map window smaller (may be by resizing the Finger ID image).
I have an idea like
When the main window opens up –
One the left side put the Finger ID image in one panel and Some Quick start Messages on the right panel(may be console panel is ok with initial quick start messages on it)
When the user clicks on View menu they can make either of these two panels in visible.
Message Panel (or the console) might start with —
1. Choose Video to track Finger from "File" —> Open
2. Select Finger From Combo
3. Click on the particular Finger tip to track from Image
4. If you are advanced user "Set Threshold" otherwise keep the default settings for threshold
5. Hit "Go" for start finger tracking
6. Click "Play" to view tracked finger centroids of your video.
New GUI
I liked the check mark before the menu items under "View" menu and those indicates whether the option is checked or not. Looks professional :)
Sunday, May 17, 2009
Test with new Multi Finger Tracking
However we figured out that this video is not a regular type video. In this video the user did not put their fingers immediately rather delayed couple of seconds before starting exploring the map.
This led us the question :
1)What if the user make delay to explore the map?
Ans: This was a problem because we were loading the first frame to track to give the user an opportunity to select finger tip. Now we decided we can put a slider and load all frames. User would slide to a frame where the finger is visible and click to the finger tip. However we might not need all frames to load at the beginning , I think couple of frames should be enough. This can save time.
Again sometimes users were removing hands from maps so frames with no finger at all are possible.
This led us the question :
2)What if finger moves out of the window, and then comes in at a completely different area?
Ans: We can just put the center as a negative value say , (-1,-1) in our xml file indicating no finger were visible to track in this frame.
We were tracking finger tips in a particular rectangle thinking finger movement won't be that fast and saving search time. But there might be situations user moved out hands to a completely different area or out side the map or moved very fast exceeding the considered search space.
This lead to question:
3) If center is not found the next search space in the frame, then how to search?
Ans: Simple way is to search every pixels in the frame considering the whole pixel grid rather a the previously considered small space. This should work if finger is moved out fast or to a different area. But if finger is outside the frame then put some -ve values as centroid say (-1,-1)
Peer Programing - Test of Multi Finger Tracking with new Algorithm
It worked after we spent around 3 hours. We could trase a finger with my proposed way. Algorithm was simple enough, we just needed to use some thresholding. It worked because we were tracking the exact color of the finger color rather than assuming "red", "blue", "green" combination of the finger.
Monday, May 4, 2009
Multi Finger Tracking with advanced UI
Something to figure out :
1. What if the first frame does not come with fingers on it?
Probable Solution: Let the user slide until there is a frame with finger colored. How many frames would come up then before actual tracking begin? We can load all frames before actual tracking if needed. Best thing would be input a video which start color fingers on it to avoid necessary delay.
2. Let the user choose one finger at a time because finger ID need to match with the finger tip a user selects.
3. Threshold checking to match color pixels to see how pixel's color fluctuates due to shade or anything else. We can also make this feature as an advanced settings for advanced user rather users should use default threshold that our program sets.
There should be play, pause, stop, sliding bar and a progress bar in the second window that comes up when a user feeds a video into the program.
I have an idea of having the UI design done soon.
Features for the Next Version
Needs:
- Multi - Finger Tracking
- Good UI -> Settings | Help
- Finalized XML
- Good Templated Docs
- Stress Test/ Nagative Value Test
- Coordinate Conversion/Scaling
Easy:
- Progress Bar
- Help Menu
- Settings
- Batch Processing
Hard:
- Video conversion
- Image Registration
Friday, May 1, 2009
My proposed Revised algorithm/steps for multi-finger Tracking (Need Modifications)
1. Load the First Frame from the video
2. Select the checkBox of the corresponding finger ID to track
3. Click on the finger tip (of that ID) in the frame to get (X,Y) of that pixel
4. Put that (X,Y) value in InputBox //just to track that you got nothing weird
Repeat step 2-4 for as many as fingers to track.
If done click on the "start tracking"
//Get the color of
Color R = GetR (X,Y)
Color G = GetG (X,Y)
Color B = GetB (X,Y)
Track Centers (int X, int Y, Color R, Color G,Color B, int frameNo):
//Use threshold with added noise
//We can adjust the range of the considering area instead of 10
Look inside the rectangle (x-10,y-10) , (x+10,y+10)
for (i : x-10 to x+10)
for (j: y-10 to y+10)
if (R-20>getR(i,j)
add (i,j) to
if (pixels not found in candidate_pixels )
track the whole frame from (0,0) to (dimention(x),dimention(y))
Find_center (
center_x = avg(x)
center_y = avg(y)
return (center_x,center_y)
//or get the R,G,B of (X,Y) pixels for the center and call Track_Center for next Frame
Wednesday, April 29, 2009
Can we run batch processing of videos?
Good though for rest of the term.
FingerTracker_v0.1 - First Release from Visual Team
I was looking at the codes , docs , builds and bugging my teammates to change stuffs after each catch to make a clean release. I won't like someone bugging me. Neither my teammates.
I wrote some unit tests as well and I got one Test failed. Later we fixed that method. Felt unit tests helps but it is much frustrating to find out which test cases to write. It takes quite a big time as well.
Our release was 93MB and after zipped it was 29MB.
Eclipse is nice to make a Runnable jar and I could make it with in a minutes as there is a quick tool to do it with eclipse.
Here is the first release from our visual team.
At the end I must say "we have a really good team"
Tuesday, April 28, 2009
Tech Doc and Read Me
Monday, April 27, 2009
What I am doing?
Thoughts for flexible UI control Panel
This one is not flexible and user need to think about what color to track with what finger.
I am thinking of making something like dynamic UI. Say when user open the video, we can have the first frame printed and let the users click on which finger s/he wants to track and Done.
How to do it?
Use mouseDown event and get the coordinate of the pixel of the finger tip, get the colors of that pixel and that is the finger tip we are interested with. Now trace all the other frames in stack.
This should be cool to do it. I am going to work on it later this term.
Video Session with HD cemera and proper settings
We set up the camera from above and covering the whole map with the full screen of the camera.
We marked the points of tripod legs and took some measurements. Note downed the resolutions of the Camera videos, file formats, etc.
Video File Uploading
I found www.esnips.com This site gives 5GB free space.
Solved our problem ?
Code and Test Documentation
I found this document for "Software Documentation" which gives a general idea what to put for "code and test" documentation.
Code Documentation (CD)
You are expected to fully document your code. Every class and class method should have a name, a brief one-line description, and a detailed description of the algorithm. All methods also require descriptions of all inputs and outputs. If applicable, you should also note any caveats – things that could go wrong or things that the code doesn’t address. Put assumptions in the caveats section. If you are coding in Java, you should use the documentation tags that work with the javadoc utility. This utility automatically generates web pages for your documentation. To make things consistent, simply cut and paste the textual descriptions of your classes, objects, and methods from your OOD directly into the code. Then let javadoc do the dirty work. If you are not coding in Java, you can still use the same tags and see if javadoc operates on your source files. Otherwise, you could write such a utility yourself!
Testing Documentation (TD)
The TD describes how you tested your program to prove that it works sucessfully. You should include testbeds for both the user interface and application aspects of your program. You should also provide test data sets where applicable. For example, if you program does some form of text processing, you should provide example file inputs that test specific features of the program requirements. You should pay special attention to borderline values and bogus user input. The TD should also include evaluation criteria, so you know what you are actually testing for.
http://www.assembla.com/spaces/atmr/documents/aZ9_Eul38r3PpneJe5afGb/download/software_documentation.pdf
My role in the team right now
I did setup jUnit4 integrated with our project. Wrote some unit Test cases and those test cases passed.
Thanks Michal for lending his co-authored book "Software Testing and Analysis". I wanted to apply some professionalism as a Tester. I could just make a look into the chapters' contents and liked the "Problems and Methods" portion the book especially "Testing Object Oriented Software" and "Test Execution" chapters.
Here are wikis I wrote on Assembla
https://www.assembla.com/wiki/show/atmr/JUnit
https://www.assembla.com/wiki/show/atmr/jUnit_with_Eclipse
I was looking some videos for Unit Testings. Found some videos on YouTube might be helpful to start with if someone is interested.
http://www.youtube.com/watch?v=pWGf-tly_JY
http://www.youtube.com/watch?v=Chb8IWZeqp4&feature=related
Right at this point I am focusing much on "General Testing" as the 1st deliverable project demo is due on April 29, 2009.
Some catches:
Our code was working separately with 1 finger and 2 finger and need to be working with whatever finger we want to track. So we are going to add some settings in our UI.
I was also testing videos to find out whether different frame rate or different resolutions has impact on finger tracking and finding centroid. Seems like No.
I tested 7FPS,24FPS and tested resolution 300*400 (my camera) and 840*648 (camera from library). Getting the same effect and could track the centroid.
Will be doing more tests.
Automatic Analysis of finger movements during tactile reading (Braille and Tactile pictures).
The system look like below.

Please find the paper here.
https://www.assembla.com/spaces/atmr/documents/afEZtykF8r3PXJeJe5afGb/download/finger_speech.pdf
Amy's Presentation - Q&A
https://www.assembla.com/wiki/show/atmr/Minutes_15-Apr-2009
I was wondering if she ever tried doing video of the experiment she runs. The answer is no. She might want to do that right now if we impress her :)
Coordinates and Resolutions
During our one meeting Peter, Fan and Me were talking about the effect of camera setup on the coordinate system video. Do we need to crop or rectification. This might be the point where we might need some research, right now we are thinking the video setup in a way so that we get the map fits to the whole screen. So it makes life easier. If we can't do consider those map rotation things this term then this might be a good think for future developers for the next term. :)
Algorithm Research
jDom in Use
Idea implementation using ImageJ
Friday, April 10, 2009
Possible simpliest way to extract information from video
----------------------------------------------------------------
Capture Video -> Capture Frame -> Extract Finger ->Point Stream
----------------------------------------------------------------
Assuming point stream would contain - point(x,y) for the centroid of fingers, timestamp
Procedure :
1. Using Processing Api it is possible to load pixels of the frame.
2. After we get the pixels we look for the RGB component of the pixel color. If we know the finger has a blue patch on it, we compare the blue(B) component of the pixels with a threshold say 200 (0 is min , 255 is max) and get those pixels' coordinates those have blue component above the threshold 200, indicating the blue points of the finger that we are interested in.
3. To get the centroid of these points we can simply get the average of the points
4. To get the time stamp if the frames are stored sequentially and we know the frame rate , we can know(or put) the time gap between each two frames and therewith set a time stamp on each frame.
Note : As we would go forward we might need to consider some other factors and adjust the plan of retrieving information from video.
Demo on Processing 1.0
1. I showed it was possible to capture real time videos from the "Logitech Web Cam"
2. And then saving frames from videos.
3. I then showed(mostly described my idea) how a "finger with blue patch on it" can be extracted from a frame.
My explanation why processing can be a good choice
https://www.assembla.com/flows/show/bvDxR8itur3OtTeJe5afGb
For Video Processing:
I looked for whether Processing 1.0 can be used for Video processing. Using this API we would be able to capture videos in real time (offline capturing can be done as well with the loadvideo() method of this library) and I could wrote sample codes for capturing videos in real time using this API. I could also extract frames from the captured videos using this API. Images of .gif , .jpg , .png , .tga formats can be processed with this API. After extracting the frames I could also load pixels of the images in pixels[] array. I could even crop frames using this API. Some other features like Frame difference (to know changes between two frames) and background removal can also be done using Processing API which we might use to retrieve the finger positions and other information. I showed the demo to our teammates and now we all are looking to the features of this API. This can be presented on next Monday’s class as a proof of concept
One more thing is that this api support video capturing using webcam which would be of very little cost. I used one Logitech WebCam of cost 25$
Benefits of using this API
1. Java based
2. Can be used in Eclipse
3. Well documented
4. Less Codes
5. Rich Library for Video Processing
Demerits:
1. Might not be able to run in Linux as this API need Apple’s Quick Time installed which is not yet released for Linux.
Alternatives of Processing 1.0
Peter is now looking into Processing 1.0 to compare the ImageJ API with it. We would soon figure out but as from our meeting on last Friday we are impressed with Processing 1.0
For Signal Processing :
I did not look much for signal processing but while looking for video processing , I found some guys wrote signal processing applications using Processing 1.0 API as well and those are well documented too (links are given in the first post of this message). I believe if we can be consistent for choosing tools for both Visual and Signal Processing Team using Processing 1.0 rather using MatLab or some other signal processing tools then it would be helpful when we would collaborate. I think Signal Processing Team can try writing some sample codes and look whether this API can be used for signal processing or not.
Note: It would be worth looking into the features of this API to get a glimpse of it to feel whether it would be useful or not. I might be wrong. All of our Visual Team members are looking at it. Anyone else interested can look into the wikis with some external links that I wrote here :
https://www.assembla.com/wiki/show/atmr/All_About_Processing_1-0
Processing 1.0 can be used for Signal Processing as well?
I found some links , which would be worth checking and I emailed Signal Processing Team.
http://cnx.org/content/m13045/latest/
http://cnx.org/content/m13046/latest/
http://cnx.org/content/m10087/latest/
http://cnx.org/content/m13047/latest/
I believe using same tools for both video and signal processing would help when both signal and video team collaborate.
Talked to Peter about the decision of using API
Right now we do not know for sure how complex analysis we might need and do not know the effects of resolution. And we think both processing 1.0 and imageJ can be added to project and we can use whichever fits our requirement as we go with the project.
Processing 1.0 VS ImageJ
For real time video capturing and image processing (if complex analysis not required) processing 1.0 can be a quicker and simple solution to extract very basic information from video and frames.
For complex analysis ImageJ seems ultimate solution. ImageJ is not capable of real time video capturing but strong tool for offline use.
Rectification - What does Michal meant ? Got Answer
Peter emailed Michal, Michal and Daniel replied and the summery is , if I understood..
"Remove as many things required to retrieve all the information we need to extract from the Frames, say finger tips (points, centroid, time-stamp)"
And would be better not to emphasize on the word "Rectification" rather retrieve required information correctly.
Here is the Message on Rectification and reply from "Michal"
Our First Visual Team meeting
1. Did video on the Tactile map using blind folded person
Videos on YouTube
2. Made a plan on weekly basis
3. Distributed tasks
4. Talked about basic ideas of doing the image processing as thresholding, rectification, use of k-mean algorithm, etc.
Friday, April 3, 2009
Point Stream ??
Well again there is built in loadpixels() function in Video library in processing 1.0 which can load(save) pixels into video_frame.pixels[] array and its one dimensional. Seems like video library of processing 1.0 automatically rectifies before loading pixels as pixels[] is an one dimensional array.
So what we should have in our point stream ? 1D pixels ? or 2D points?
Rectification confusion again
Why Rectification?
To change a 2-D search problem in general into a 1-D search problem
How Rectification?
Basic idea: The rectified images can be thought of as acquired by a new stereo rig, obtained by rotating the original cameras around their optical centers.
Exactly what Micheal means with Image Rectification?
Thursday, April 2, 2009
I could install and write the sample codes using processing 1.0
Wednesday, April 1, 2009
My confusion regarding rectifying Map Frames
Braille Reading paper from Michael
My Plan on our first Visual Team Meeting
Our lead Peter thinks we can try this. Lets see what we can get.
I got one tactile map from Xiangkui
My task for Monday 04/06/2009
I found some people talking that they could able to use processing for face detection and I hope I would find some way to use it for finger tracing.
Processing 1.0
Link :
http://processing.org/