Professional Documents
Culture Documents
INTRODUCTION
1.1 ABOUT THE PROJECT
The main aim of this project is to effectively manage the video blogs
(vlogs) and make them more conveniently accessible for users.
A video blog (vlog) is a blog which uses video as the primary content, often
accompanied by supporting text, image, and additional metadata to provide
context.Compared with general videos, vlogs have several unique
characteristics. A vlog often provides textual content as description of the
video. As a medium for communication, a vlog usually has some comment
entries conveying vlog viewer’s opinions. Some unique but useful
information of a vlog, such as submitting time, viewed times, comment entry
number, and popularity rating, can be easily obtained.
1
1.2 LITERATURE SURVEY
Blogging has been a textual activity, but text is only one aspects of the
diverse skills which are needed in order to understand and manage different
aspects of modern communication. Broadband connections are likely to
stimulate a rapid increase in audio-visual services on the web, presumably
changing the future conditions for blogging. Videoblogs can facilitate
practices which promote media literacy and collaborative learning through
the making of collective documentaries. Videoblogs with wiki-like functions
promise to turn users into producing collectives rather than individual
consumers of audiovisual content.
2
1.2.1 VIDEOBLOGS
Blogs began as a textual genre of personal publishing, but the genre has
developed visual expressions, like phototblogs, and more recently adapting
sound and video. Most bloggers publish short posts, they write quite often
with an extensive use of hypertext-linking. Linking and commenting makes
blogging a kind of collaboration, where individual bloggers are writing in
context created through collective, but often unorganised effort.
Textual blogs have at least three characteristics, apart from usable and easy
accessible software, which have made them easy to use whether as a
"producer" (writer), a "consumer" (reader) or both: Textblogs are based on
non-temporal media which is easily controllable, they are easy to cite and
they are part of long textual tradition, "re-mediating" many of the features
known from diaries and journals. Even though there are several substantial
differences the easiest way to explain blogging often is to begin with
reffering to "an online diary".
3
hardly be compared to radio or recorded sound and videoblogs are not like
television or private filmmaking: In contrast to broadcasting blogs are
personal and at the same time they are shared by people outside the private
sphere.Production, presentation and distribution: In all these areas blogging
promise to be close to the opposite of broadcasting. Looking for the sources
of a videoblogging language we therefore have to explore other aspects of
audiovisual culture.
4
software on the producers computer and posted to individual websites. The
other major tradition has emerged along with the introduction of mobile
input-devices with internet connection (smartphones, PDAs, camera
cellphones).
5
Even though there are no major technical barriers some skills are required,
preventing most users from becoming "voggers". Moblogs on the other hand
are easy to use, in most cases it is just a matter of simply uploading video-
files to a dedicated webserver. However, this is not only a question of ease
of use, possibly even more important is the time which the producer has to
invest in order to get his material on the web. When posting is not time-
consuming bloggers are encouraged to post often, an aspect which has made
a lot of text-bloggers and blog-readers become avid users. The same criteria
for success apply to videoblogs.
Playlists are perhaps not videoblogs, but an interesting genre because they
use technologies which may bridge the gap between “vogs” and “moblogs”.
Playlists adress individual files on different servers and may even provide a
level of interactivity without manipulating the content in these files. One
way to achive this is by using SMIL (Synchronized Multimedia Integration
Language) an established XML-dialect defined by The World Wide Web
Consortium in order to control different media distributed through the
internet. SMIL seems to be an ideal platform for distributing various content
as "movies" without moving or manipulating the original source-files
(videoclips, pictures and text). Since SMIL-files are based on an open format
(XML) stored as ASCII-text it is quite easy to make alternative versions of
playlists, taking advantage of server-side applications and the internets
transparent nature.
6
1.2.2 COLLECTIVE DOCUMENTARIES
Looking for existing genres which videoblogs re-mediates the closest we get
are some traditions known from documentary filmmaking. One of these is
diary-films, which are personal first-person narratives. Another tradition is
found-footage films, which often are based on old private material filmed by
others than the filmmaker himself. Found-footage films are part of a larger
tradition known as compilation film, using material from a variety of
sources, including archived material. Any kind of film and video have the
possibility of ending up as found footage: Your grandfathers Super-8
movies, old commercials, parts of feature films, recorded televion etc. Quite
a few excellent filmmakers have made their first movies with material
found as leftovers in a studio or in a film school. William Wees discusses
three general ways in which found footage is most often used
2. Collage : Film which use found footage to create metaphors, provoke self-
consciousness and encourage critical viewing. The viewer is able to read
images critically with attention to the metaphors.
7
meanings. Wees relates this to postmodernism and to the loss of the film-
material´s historical meaning.
Videoblogs are related to both diary-films and found footage: The material is
a combination of personal recordings and material provided by others.
With the introduction of mobile cameras and fast, easy and reliable ways of
sharing video-clips the concept of found footage is going to change. In the
future video recorded by individuals promise to be a kind of found footage
more closely related to recent or ongoing events. This material is hardly
going to be used in the same way as traditional found footage, because the
time between recording and use will be much shorter. Instead new patterns
of use will emerge: Different aspects of voyeurism are quite obvious, but
hopefully also ways of using online video in order to make individual
statements about issues not covered by today’s mass-media. The most
successful online environments seems to be those which are designed in
order to make it possible to post information at different levels, socializing
new users into the systems publishing-culture. Blogs provide some of these
socializing effects providing an individual base for entering a community,
blurring the boundaries between production, distribution and consumption.
8
parts of the production process while others remain almost the same as if the
process was done with an offline computer. After the video-material is
recorded the videoblogging process can be divided into five stages :
1. "Posting", 2. "Selecting", 3. "Editing", 4. "Storing" and 5. "Re-editing".
1. Posting
The success of blogging is partly a result of cheaper net connections and the
increasing number of computer literate people using the web. Videologs may
become a genre where "href tracks", "sprites" and "interactive" elements
enhance the users personal experience in ways that are unique to computer
mediated communication. The considerable downside is that advanced
interactive features have consequences for the amount of work which each
user have to put into his posts. When posting becomes a task the most
important advantage of blogging disappears and the “media literacy-
potential” will decrease. Following the moblog tradition, emphasizing
simplicity, posting should be as easy as possible. The users should be
encouraged to post short clips of unedited video-material which is
transformed into a unified video-format on the server, becoming a common
resource for future editing and citation. Comments is a way of posting
which is important when building an online community for at least two
major reasons: First comments is the easiest way to become a part of a
community without having to be among those who provide the content in the
first place. Secondly comments help maintaining a community by making
different members aware of each other. Frequent comments give those who
post an explicit confirmation of their publics presence in addition to some
9
substantial feedback. This is particularly important in photo- and video-
blogs because these are personal expressions, often even more vivid than
most textual blogs which in many cases might be considered as varieties of
content management.
2.selecting
A flexible system must allow a media-object to be assigned to multiple
categories, allowing hierarchy but without enforcing it. This will in most
cases be an excellent system usable for a large videoblogging environment,
perhaps even with features combining personal and global categories.
Combined with personal information, time and date of posting and possibly
geograpgical information, this provides metadata for searching or automatic
generation of play-lists which may be re-edited manually. The problem with
searching and search results is that the information is shown out of context.
In order to get an idea of the quality of a specific clip it might be helpful to
know how many who have used it in a sequence. If a lot of people have used
it you have an indication that it might be worth looking at. Sequences are in
fact the best way to view a clip as long as it provides both context and an
example of how the clip might be trimmed (where to begin and where to
end).
3. Editing
Both the edit and the link provides context to separated segments, but both
theory and practice addressing editing / linking tend to concentrate on the
segments. Editing techniques which have a duration, like dissolves and
wipes, are easier to identify, but they are almost never used unless the
director wants to call for the viewers attention. In an analogous manner
10
theory and practice in hypertext design emphasize the nodes in hypertext
should be designed in order to make navigation as intuitive as possible,
emphasizing the importance of a unified design in order not to confuse the
user. The editing interface has to display all the clips which the user have
selected during a session.The editing process result in a text-document
(SMIL), small enough to allow storage of an almost infinite number of
sequences, which can be made by combining a limited number of video-
clips.
4. Storing
11
5. Re-editing
Re-editing in a videoblogging environment means that any user can take a
sequence or a number of individual video-clips into the editor, make a re-
edit and store the result as a new sequence in his own blog. The idea of
making “collective documentaries” or fiction in this way is intriguing: Those
who are unhappy with a version, may comment on the original sequence or
just make their own version, possibly adding their own content.
12
• interesting clips can’t be viewed on their own; instead the video must
be played back in its entirety; and as with most multimedia on the
Web, sufficiently high bandwidth for reasonable quality video isn’t
widely available.
13
limited numbers of users. In such environments, users are simply able to
“point-andshoot” to reply to commentary posted by others.
14
semantics of the language is defined in terms of a set S of relations between
word senses. The semantic relations into which a word enters determine the
definition of that word.
15
• Meronymy (part-name) and its inverse, holonymy (whole-name), are
complex semantic relations. WordNet distinguishes component parts,
substantive parts, and member parts.
• Troponymy (manner-name) is for verbs what hyponymy is for nouns,
although the resulting hierarchies are much shallower.
• Entailment relations between verbs are also coded in WordNet.
An XWindows interface to WordNet allows a user to enter a word form and
to choose a pull-down menu for the appropriate syntactic category. The
menus provide access to the semantic relations that have been coded into
WordNet for that word.
16
1.2.4 WORD ASSOCIATION NORMS, MUTUAL
INFORMATION, AND LEXICOGRAPHY
1.2.4.1 MEANING AND ASSOCIATION
It is common practice in linguistics to classify words not only on the basis of
their meanings but also on the basis of their co-occurrence with other words.
Running through the whole Firthian tradition, for example, is the theme that
"You shall know a word by the company it keeps" .On the one hand, bank
co-occurs with words and expression such as money, notes, loan, account,
investment, clerk, official, manager, robbery, vaults, working in a, its
actions, First National, of England, and so forth. On the other hand, we find
bank co-occurring with river, swim, boat, east (and of course West and
South, which have acquired special meanings of their own), on top of the,
and of the Rhine.
The search for increasingly delicate word classes is not new. In
lexicography, for example, it goes back at least to the "verb patterns"
described in Hornby's Advanced Learner's Dictionary (first edition 1948).
What is new is that facilities for the computational storage and analysis of
large bodies of natural language have developed significantly in recent
years, so that it is now becoming possible to test and apply informal
assertions of this kind in a more rigorous way, and to see what company our
words do keep.
17
implications are summarized from reaction-time experiments in which
subjects either (a) classified successive strings of letters as words and
nonwords, or (b) pronounced the strings.
18
1.2.5 AUTOMATIC SEMANTIC ANNOTATION FOR VIDEO
BLOGS
Vlog annotation is essentially a multi-labeling process , as a vlog can usually
be annotated with multiple words. There exist many effective approaches for
multi-label image/video annotation, and it has become a trend that the
annotation should be extracted not only from the target image/video itself,
but also from other images/videos which are relevant to it.
19
description not all the words are relevant to the semantics of the central
video, Wdescription can be rather noisy. Considering the fact that in an
article, keywords are usually used to reveal the main subject, or the title, we
assume that if an annotation word is a good one, it should be highly
correlated with at least one word in Wtitle. Therefore, we delete from
Wdescription the words which have low correlation with all the words in
Wtitle.
20
video r and the vlog video v as the maximum image similarity between the
representative frame fr of r and the keyframe fv of v:
After the above two search stages, we have obtained a batch of videos which
are relevant to the vlog both semantically and visually with regard to the
intrinsic annotation word w. We then gather the tags of all the reserved
videos into a tag set T(w), which is adopted as the external annotation
candidates for the vlog. This process is applied for each intrinsic annotation
word w in Wintrinsic. Finally, we obtain the word set Wexternal for external
annotation candidates:
Context-based annotation refinement
Although the videos used for annotation expansion are all semantically and
visually relevant to the target vlog, it dose not follow that all the tags of the
videos are also relevant to the vlog. In the process of annotation expansion,
we have to deal with the serious problem of semantic drift. Therefore, we
should refine the expanded annotation candidates and delete the irrelevant
words. We calculate the relevance between an annotation candidate c and
the vlog by comparing c with the words in Wintrinsic. As we know, when
comparing two words, we should consider not only the semantics in them
but also the specific contexts they are in. In this paper, we propose a novel
context histogram to depict the semantics of a word in a specific context. For
a word w, its context is substantially a set of words which confines its
specific semantics. We first calculate the one-to-one correlation between w
and each of the words in its context Wcontext. Then, we organize all the
correlation values into a histogram and get the context histogram for w with
respect to Wcontext . The problem of context comparison is now reduced to
histogram comparison. Here we simply use histogram intersection as a
metric of the context histogram similarity.We perform the context-based
21
external annotation refinement as follows: For an intrinsic annotation word
w of Wintrinsic, we create its context histogram with respect to Wcontext =
Wintrinsic − {w}; while for an annotation candidate c in Wexternal, we also
build its context histogram with respect to the same Wcontext = Wintrinsic −
{w}. In order to compare c with w, we calculate both their one-to-one word
correlation Simword and their contextual similarity Simcontext. The total
correlation between c and w is defined as:
Sim ( , ) Sim ( , total c w =α word c w) +β Simcontext (c,w) ,
where α and β are adjustable parameters. Only those annotation candidates
with high relevance to Wintrinsic are kept in Wexternal. After the
refinement, we merge Wintrinsic and Wexternal to get the final annotation
for the target vlog.
22
2) given one keyword, find complementary annotations to describe the
details of this image.
The requirement in the first step is not as lacking in subtlety as it may first
seem. For example, in a desktop photo search, users usually provide a
location or event name in the folder name. Or, in a Web image search, we
can choose one of a Web image’s surrounding keywords as the query
keyword.
23
CHAPTER 2
SYSTEM ANALYSIS
24
CHAPTER 3
REQUIREMENT SPECIFICATIONS
25
3.3.1.1 INTRODUCTION TO JAVA
Java has been around since 1991, developed by a small team of Sun
Microsystems developers in a project originally called the Green project.
The intent of the project was to develop a platform-independent software
technology that would be used in the consumer electronics industry. The
language that the team created was originally called Oak.
The first implementation of Oak was in a PDA-type device called Star Seven
(*7) that consisted of the Oak language, an operating system called
GreenOS, a user interface, and hardware. The name *7 was derived from the
telephone sequence that was used in the team's office and that was dialed in
order to answer any ringing telephone from any other phone in the office.
Around the time the First Person project was floundering in consumer
electronics, a new craze was gaining momentum in America; the craze was
called "Web surfing." The World Wide Web, a name applied to the Internet's
millions of linked HTML documents was suddenly becoming popular for
use by the masses. The reason for this was the introduction of a graphical
Web browser called Mosaic, developed by ncSA. The browser simplified
Web browsing by combining text and graphics into a single interface to
eliminate the need for users to learn many confusing UNIX and DOS
commands. Navigating around the Web was much easier using Mosaic.
It has only been since 1994 that Oak technology has been applied to the
Web. In 1994, two Sun developers created the first version of Hot Java, and
then called Web Runner, which is a graphical browser for the Web that
exists today. The browser was coded entirely in the Oak language, by this
26
time called Java. Soon after, the Java compiler was rewritten in the Java
language from its original C code, thus proving that Java could be used
effectively as an application language. Sun introduced Java in May 1995 at
the Sun World 95 convention.
When the interpreter executes a class, it looks for a particular method by the
name of main, which will sound familiar to C programmers. The main
method is passed as a parameter an array of strings (similar to the argv[] of
C), and is declared as a static method.
27
3.3.2. JAVA MEDIA FRAMEWORK
The Java Media Framework (JMF) is an application programming interface
(API) for incorporating time-based media into java application and applets.
This guide is intended for java programmers who want to incorporate time-
based into their application and for technology providers who are interested
in extending JMF and providing JMF plug-ins to support additional media
types and perform custom processing and rendering.
The JMF 1.0 API enables programmers to develop java program that
presented time-based media .The JMF2.0 API extends the framework to
provide support for capturing and storing media data, controlling the type of
processing that is performed during addition ,JMF2.0 defines a plug-in API
that enables advanced developers and technology providers to more easily
customize and extend JMF functionality.
By exploiting the advantage of the java platform, JMF delivers the promise
of “write once,Run Anywhere”, to developers who want to use media such
as audio and video in their java programs. JMF provides a common cross
platform java API for accessing underlying media frame works. JMF
implementation can leverage the capabilities of the underlying OS, while
developers can easily create portable java programs that features time-based
media by writing to the JMF API.
28
With JMF , creating applets and applications that present, capture,
manipulate and store time-based media .The frame work enables advanced
developers and technology provides to perform custom processing of raw
media data and seamless extend JMF to support additional content types and
formats, optimize handling of supported formats and create new presentation
mechanism.
HIGH-LEVEL ARCHITECTURE
Devices such as tape decks and VCRs provide a familiar model for
recording, processing and presenting time based media. When playing a
movie using a VCR, it provides the media stream to the VCR by inserting a
video tape. The VCR reads and interprets the data on tape and sends
appropriate signals to television and speakers.
JMF uses this same basic model .A data source encapsulates the media
stream much like a video tape and a player provides processing and control
mechanism similar to VCR. Playing and capturing audio and video
microphones, cameras, speakers and monitors.
29
Data source and players are integral parts of JMF’s high-level API for
managing the capture, presentation and processing of time-based media.
JMF also provides a lower-level API that supports the seamless integration
of custom processing components and extensions. This layering provides
java developers with an easy-to-use API for incorporating time-based media
into java programs while maintaining the flexibility and extensibility
required to support advanced media application future media technology.
To present time-based media such as audio or video with JMF, player can be
used. Playback can be controlled programmatically, or it can be able to
display a control-panel comp that enables the user to control play-back
interactively. If several media streams want to be play, a separate player is to
be used for each one, to play them in sync, Player object can be used to
control the operation of others.
PLAYER
30
A player does not provide any control over the processing that it performs
that it performs or how it renders the media data.
PROCESSORS
EXTENSIBLITY:
31
Implementing the code interface enables to perform the processing
required to decode compressed media data, convert media data
from one format to another and encode raw media data into a
compressed for materials.
Apache Tomcat version 6.0 implements the Servlet 2.5 and Java Server
Pages 2.1 specifications from the Java Community Process, and includes
many additional features that make it a useful platform for developing and
deploying web applications and web services.
32
on a commandline and to add additional
catalina.sh
parameters to change Tomcat when starting.
33
Administration applications section, it is
used with the default UserDatabase Realm as
referenced in server.xml.
webapps Web app files this is were the Web application files reside,
including your own Web applications. This
is were you place your Web Application
aRchive (WAR) file, Tomcat will then
34
deploy the file. We will get into deploying
Web applications in another topic.
35
JSPs are converted to a Java servlet and
accessed through this directory.
36
The server is Tomcat, its an instance of the Web application
server, it owns a port that is used to shutdown the server (port
Server 8005). You can setup multiple servers on one node providing
they use different ports. The server is an implementation of the
Server interface, it implements the StandardServer object.
All connectors work on the same principle, they have an Apache module
end(mod_jk or mod_proxy) that loads just like any other Apache module.
On the Tomcat end, each Web application instance has a connector module
component written in Java. In Tomcat 6 this is with the
org.apache.catalina.Connector class. The constructor takes one of two
connector types, HTTP/1.1 or AJP/1.3. You call the constructor indirectly
via the server.xml file using the connector and protocol tags. Depending on
what setup you have, different classes will be used.
Apache
• HTTP/1.1:
Portable
org.apache.coyote.http11.Http11AprProcotol
Runtime
• AJP/1.3: org.apache.coyote.ajp.AjpAprProtocol
(APR) is
supported
The Web server handles all the static content, but when it comes across
content intended for a servlet container, it passes it to the module in question
(mod_jk, mod_proxy), the web server knows what content to pass to the
Connector module because the directives in the Web servers configuration
specify this.
38
FIG 3.5 INTERACTION BETWEEN TOMCAT SERVER AND WEB
SERVER
The Apache JServ Protocol (AJP) uses a binary format for transmitting data
between the Web server and Tomcat, a network socket is used for all
communication. The AJP packet consist of a packet header and a payload,
below is the structure of the packet.
39
As you can see, the binary packet starts with the sequence 0X1234, this is
followed by the packet size (2 bytes) and then the actual payload. On the
return path the packets are prefixed by AB (the ASCII codes for A and B),
the size of the packet and then the payload.
The HTTP protocol is exactly as the name implies it uses the HTTP protocol
to exchange messages. You can use HTTPS but you require a SSL certificate
and make a few changes to Tomcat's configuration.
3.3.3.5 LIFECYCLE
Tomcat starts and stops the components in the order that were started, thus
when starting the parent gets started first then the children get started,
stopping is the reserve order. This is done through the Lifecycle interface:
LifecycleEvent and LifecycleListener.
The Lifecycle interface has two key methods start() and stop(), all major
components usually contain a LifecycleSupport object that manages all of
the LifecycleListener objects for that component, it is this object that
40
propagates and fires general events. The top-level component calls all of its
child's start() methods, the reverse is true when stopping. This method
allows to to stop/start Host components without affecting any other Hosts.
Configuration
The most important file in Tomcat is the server.xml file, when Tomcat starts
it uses a version of the Apache Commons Digester to read the file, the
digester is a utility that reads XML file and creates Java objects from a set of
rules. With what you have learned above you can see that the rules in the file
follows Tomcat architecture exactly.
These days many web hosting companies are providing Tomcat support on
their server. So, if you develop the application in Java technology you can
41
get any host and then deploy it on the internet. Earlier it was a difficult task
to get a good host for hosting.
Step3: Create web.xml file and classes folder under the WEB_INF folder.
3. Copy the Servlet class(Hello) into classes folder, which is under WEB-
INF folder.
42
<servlet>
<servlet-
name>Hello</servlet-name>
<servlet-class>Hello</servlet-
class>
</servlet>
<servlet-mapping>
<servlet-
name>Hello</servlet-name>
<url-pattern>/Hello</url-
pattern>
</servlet-mapping>
5. Run Tomcat Server and execute your servlet- To run the server Go
to C:\apache tomcat\bin\startup.bat and double click on it , the server will
start up. After assuring that the server is running successfully, you can run
your servlet. To execute your servlet, open your web browser and type the
url which you have mentioned in your web.xml. The url will be like this:
http://localhost:8080/servlets-examples/Hello
3.3.4. GLASSFISH
43
Sun GlassFish Enterprise Server enables customers to leverage the benefits
of open source with a subscription that provides support, training credits,
limited indemnification and more.
44
CHAPTER 4
SYSTEM DESIGN
4.1 ARCHITECTURE
when a user uploads a vlog to the database, semantic annotation will run
automatically using vlog text and relevant external resources, and sentiment
evaluation is obtained from vlog comments. After that, the vlog will be
stored in the database with the corresponding annotation and evaluation.
When a user submits a query to the search engine, the vlog search module
will access the vlog database to obtain relevant vlogs by saliency-based
matching; then, using user specified ranking strategy and clustering, the
results will be returned to the user in a well-organized manner.
45
4.2 SEQUENCE DIAGRAM
46
4.3 USE CASE DIAGRAM
The use case diagram shows the relationship between the actors and the use
cases within the system. The clients are the actors who uploads and search
for the videos in the server. And the results are received by user from the
database.
47
4.4 ACTIVITY DIAGRAM
48
CHAPTER 5
MODULES
5.1 MODULES
Semantic annotation
Content Analysis
Sentiment evaluation
Saliency-based matching and Ranking
Semantic annotation
Annotation is the process of extracting informative keywords from text of
the vlog.This is necessary because the words used in the vlog texts are
arbitrary and non-standard.When a user uploads a video automatic semantic
vlog annotation is run. The textual content in a vlog mainly comprises of
title, description, and comments, among which the title and description are
closely related to the semantics of the vlog video. So we use the title and
description for annotation process. The title indicates the main topic of the
whole vlog. It is of the greatest importance for understanding the semantics
of the vlog. Therefore, we first extract annotation words from the title and
then we extract annotation words from the body of the textual content, i.e.,
the vlog’s description. It is then stored in the database.
49
Content Analysis
In the content analysis the video is split into a number frames and stored in
the database in blob form. Each frame consists of objects. Different object
from the each frame is detected and stored in the database. Thus no two
frame will have same object and this makes the searching process efficient.
The process of frame splitting is done with the help of Framesplitter class.
Sentiment evaluation
The main purpose of the sentiment evaluation process is to extract
annotation words from the user’s comments. The users can decide whether a
vlog is worth viewing based on the existing comments. Traditional
annotation models focus solely on the semantic aspect while the sentiment
aspect is totally neglected. For opinioned texts such as comments in vlog
,extra informations can be obtained through sentiment analysis. The users
comments will be predominantly text based. Sentiment evaluation is used to
obtain overall evaluation of the vlog.
50
5.3 DATA FLOW DIAGRAMS:
Level 0:
User
Login Server
Data
Base
This is the Level 0 DFD for the system.When the user visits the login page
,the server checks with the database. If he is a registered user then he can
access the home page if not he has to register to access the videos.
51
Level 1:
Annotation
process
Content
Analysis
Stored in
Data base
DataBase
This is the Level 1 DFD for the system. When a user uploads a video
automatic semantic vlog annotation is run. Content analysis is performed
where the video is split into a number frames and stored in the database in
blob form.
52
Level 2:
Sends Request to
Data
Base
Results
This is the Level 2 DFD for the system. When the user sends a request for
searching the video,The server checks in the database. Finally the results are
given to the user in a ranking manner.
53
CHAPTER 6
TABLES
6.1 USERLOGIN
6.2 VIDEOUPLOAD
54
CHAPTER 7
TESTING
This examines the logic of the system. If we are getting the output that is
required by the user, then we can say that the logic is perfect.
In this the error will be found in each individual module, it encourages the
programmer to find and rectify the error without affecting other modules.
55
7.5 FUNCTIONAL TEST
Functional test cases involved exercising the code with nominal input values
for which the expected results are known, as well as boundary values and
special values, such as logically related inputs, files of identical elements,
and empty files.
Performance Test
Stress Test
Structure Test
It determines the amount of execution time spent in various parts of the unit,
program throughput, and response time and device utilization by the
program unit.
Stress Test is those test designed to intentionally break the unit. A Great
deal can be learned about the strength and limitations of a program by
examining the manner in which a programmer in which a program unit
breaks.
Structure Tests are concerned with exercising the internal logic of a program
and traversing particular execution paths. The way in which White-Box test
strategy was employed to ensure that the test cases could Guarantee that all
56
independent paths within a module have been have been exercised at least
once.
This testing is also called as Glass box testing. In this testing, by knowing
the specific functions that a product has been design to perform test can be
conducted that demonstrate each function is fully operational at the same
time searching for errors in each function. It is a test case design method that
uses the control structure of the procedural design to derive test cases. Basis
path testing is a white box testing.
57
7.8 USER ACCEPTANCE TESTING
User acceptance of the system is key factor for the success of any system.
The system under consideration is tested for user acceptance by constantly
keeping in touch with prospective system and user at the time of developing
and making changes whenever required. This is done in regarding to the
following points.
58
CHAPTER 8
C
ONCLUSION AND FUTURE ENHANCEMENT
8.1 CONCLUSION:
The proposed system results in a video given a frame of the video as input.It
can further be enhanced by giving any object in the frame as input resulting
in the exact video.
59
APPENDIX 1
SCREEN SHOTS
This is the home page for video blog where the user must signup to access
the videos.
60
This is the members login page.
61
This is the video upload page where the user uploads the video by giving
title, description and comment. While uploading the video frames will be
splitted and stored in database after automatic semantic annotation.
62
This is the page for searching the video. The user browses the image and
search for the video.
63
This the page for changing the password. If the user wishes to change his
password he can do so by providing a new password.
64
APPENDIX 2
SAMPLE CODING
MONTY TAG:
import java.util.*;
import montytagger.JMontyTagger;
for(int i=0;i<v.size();i++)
{
String s=(String)v.get(i);
if(s.contains("JJ")||s.contains("NNP")||
s.contains("NN")||s.contains("CD")||s.contains("VBD"))
{
StringTokenizer stt=new
StringTokenizer(s,"/");
String t1=stt.nextToken();
65
String t2=stt.nextToken();
vv.add(t1);
}
}
System.out.println("Final vecu"+vv);
}catch (Exception e)
{
e.printStackTrace();
}
return vv;
}
VIDEO UPLOAD:
import java.io.*;
import java.sql.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
* servlet implementation class upload
*/
public class upload extends HttpServlet {
private static final long serialVersionUID = 1L;
public Connection conn;
public montytag mm=new montytag();
Video_FrameSplitter vfs;
//System.out.println(request.getRealPath("/"));
FileInputStream fis=new FileInputStream("C:/Program
Files/Apache Software Foundation/Tomcat 6.0/webapps/
VideoBlogfull/src/Database.properties");
p.load(fis);
66
String system=p.getProperty("system");
String username=p.getProperty("username");
String password=p.getProperty("password");
String video=request.getParameter("Browse");
System.out.println("video path "+video);
vfs.Video_SplitterMethod("d:/f.avi");
/*String title=request.getParameter("Title");
Vector vt = mm.method(title);
String stit=vt.get(0).toString();
String desc=request.getParameter("Description");
Vector vd = mm.method(title);
String sdes=vd.get(0).toString();
String comm=request.getParameter("Comment");
Vector vc = mm.method(title);
String scomm=vc.get(0).toString();
DriverManager.registerDriver( new
oracle.jdbc.driver.OracleDriver());
conn =
DriverManager.getConnection("jdbc:oracle:thin:@"+system+"",username,passwo
rd);
//System.out.println("in database");*/
} catch (Exception e) {
e.printStackTrace();
}
}
}
DBSTORE
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.util.Vector;
67
public DBstore( String video,Vector vec,String tit,String des,String
comm)
{
try
{
DriverManager.registerDriver( new
oracle.jdbc.driver.OracleDriver() );
Connection conn =
DriverManager.getConnection( "jdbc:oracle:thin:@ramarathinam","system","redh
at");
System.out.println(video+vec+tit+des+comm);
System.exit(0);
Statement stmt = conn .createStatement();
objStatement.setBinaryStream(1,fis,(int)newfile.length());
objStatement.setBytes(2, bArray);
68
objStatement.execute();
System.out.println("stored");}
catch(Exception e){e.printStackTrace();}}}
SEARCH IMAGE:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import java.util.*;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpSession;
public class Searchimg extends HttpServlet
{
public Connection conn;
HttpSession hs;
TreeMap tm1 ;
TreeMap tm2 ;
TreeMap tm3 ;
TreeMap tm4 ;
TreeMap tm5 ;
TreeMap tm6;
Vector v2 ;
Vector v3 ;
Vector fp ;
Vector trueval;
Vector resv;
69
fp=new Vector();
trueval=new Vector();
resv=new Vector();
hs=request.getSession(true);
String filepath=request.getParameter("Browse");
conncre();
String ip=filepath;
System.out.println("ip "+ip);
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from
videoupload");
while(rs.next())
{
byte vdata[]=rs.getBytes(1);
String vpa=rs.getString(2);
int cnt=rs.getInt(3);
String tt=rs.getString(4);
String dd=rs.getString(5);
String cc=rs.getString(6);
String fname=rs.getString(7);
tm1.put(vpa,new Integer(cnt));
tm2.put(vpa,vdata);
tm4.put(vpa,fname);
tm5.put(fname,vdata);
fp.add(vpa+"*"+cnt);
}
System.out.println("tm1"+tm1);
System.out.println("tm2"+tm2);
System.out.println("tm4"+tm4);
System.out.println("tm5"+tm5);
System.out.println(fp);
for(int u=0;u<fp.size();u++)
{
String val=fp.get(u).toString();
StringTokenizer sto=new
StringTokenizer(val,"*");
String t1=sto.nextToken();
String t2=sto.nextToken();
File f=new File(ip);
CannyEdgeDetector detector = new
CannyEdgeDetector();
BufferedImage frame = ImageIO.read(f);
detector.setLowThreshold(0.5f);
detector.setHighThreshold(1f);
//apply it to an image
detector.setSourceImage(frame);
70
detector.process();
BufferedImage edges =
detector.getEdgesImage();
int c[]=cp.canpix(edges);
int cnn=Integer.parseInt(t2);
for(int i=1;i<=cnn;i++)
{
String ps=t1+"/"+"pic"+i+".jpg";
//String ps=t1;
File f1=new File(ps);
CannyEdgeDetector detector1= new
CannyEdgeDetector();
BufferedImage
frame1=ImageIO.read(f1);
detector1.setLowThreshold(0.5f);
detector1.setHighThreshold(1f);
//apply it to an image
detector1.setSourceImage(frame1);
detector1.process();
BufferedImage edges1 =
detector1.getEdgesImage();
int c1[]=cp.canpix(edges1);
boolean bb=comp(c,c1);
System.out.println(i+" "+bb);
if(bb)
{
System.out.println("*******
OH its matched *******");
trueval.add(t1);
i=cnn;
}
}
}
System.out.println("dddddddddd"+trueval);
// getvi(trueval,request,response);
dis(trueval,request,response);
}catch(Exception e)
{e.printStackTrace();}
}
public void conncre()throws Exception
{
DriverManager.registerDriver( new
oracle.jdbc.driver.OracleDriver());
71
conn =
DriverManager.getConnection("jdbc:oracle:thin:@"+"ramarathinam"+"","system
","redhat");
}
public boolean comp(int[] a,int[] b)
{
int t=0;
int f=0;
for(int k=0;k<a.length;k++)
{
if(a[k]==b[k])
{
t++;
}
else
{
f++;
}
}
int sum=t+f;
float per;
per=(t*100)/sum;
if(per>98.0)
return(true);
else
return(false);
}
public void dis(Vector dd,HttpServletRequest
request,HttpServletResponse response)throws Exception
{
Vector v1=new Vector();
v1.addAll(dd);
System.out.println("v11111111"+v1);
for(int b=0;b<v1.size();b++)
{
String cval=v1.get(b).toString();
v3.add(tm4.get(cval));
}
System.out.println(v3);
for(int r=0;r<v3.size();r++)
{
String co=v3.get(r).toString();
72
byte bb[]=(byte[]) tm5.get(co);
String filename=co;
String fpath="d:/Temp/"+filename;
//FileOutputStream fos=new
FileOutputStream("d:/Temp/"+filename);
//fos.write(bb);
tm6.put(co,fpath);
}
System.out.println(tm6);
RequestDispatcher view =
request.getRequestDispatcher("Results.jsp");
hs.setAttribute("result",tm6);
view.forward(request, response);
}
/* public void getvi(Vector v,HttpServletRequest
request,HttpServletResponse response)throws Exception
{
Vector v1=new Vector();
v1.addAll(v);
System.out.println(v1);
for(int rr=0;rr<v1.size();rr++)
{
String val=v1.get(rr).toString();
v2.add(tm2.get(val));
}
System.out.println(v2);
for(int r=0;r<v2.size();r++)
{
byte b[]=(byte[]) v2.get(0);
String filename="f"+r+".avi";
String fpath="d:/Temp/"+filename;
FileOutputStream fos=new
FileOutputStream("d:/Temp/"+filename);
fos.write(b);
tm3.put(filename,fpath);
resv.add(filename);
}
System.out.println("tm3"+tm3);
System.out.println("resv "+resv);
RequestDispatcher view =
request.getRequestDispatcher("Results.jsp");
hs.setAttribute("result",resv);
view.forward(request, response);}*/}
73
PLAY VIDEO:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* servlet implementation class playvideos
*/
public class playvideos extends HttpServlet {
TypicalPlayerApplet tp;
String path=request.getParameter("vpath");
System.out.println("path "+path);
tp=new TypicalPlayerApplet(path);
}
}
LOGIN CHECK:
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* servlet implementation class upload
*/
public class Logincheck extends HttpServlet
{
Connection conn;
74
public void doPost(HttpServletRequest request,HttpServletResponse
response) throws ServletException, IOException
{
try {
DriverManager.registerDriver( new
oracle.jdbc.driver.OracleDriver());
conn =
DriverManager.getConnection("jdbc:oracle:thin:@"+"ramarathinam"+"","system
","redhat");
String uname=request.getParameter("username");
String upass=request.getParameter("pass");
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from USERLOGIN
where username='"+uname+"' and password='"+upass+"'");
if(rs.next())
{
RequestDispatcher view =
request.getRequestDispatcher("Uploadvideos.jsp");
view.forward(request, response);
}else
{
System.out.println("invalid ");
RequestDispatcher
rq=request.getRequestDispatcher("HomePage.jsp");
request.setAttribute("msg","User name and
password in invalid");
rq.forward(request,response);
}
} catch (Exception e) {
e.printStackTrace();
}
}
75
APPENDIX 3
ALGORITHM USED: CANNY EDGE DETECTION ALGORITHM
INTRODUCTION
The aim of JFC was to develop an algorithm that is optimal with regards to
the following
criteria:
3. Number of responses: One real edge should not result in more than one
detected edge
76
(one can argue that this is implicitly included in the first requirement).With
JFC’s mathematical formulation of these criteria, Canny’s Edge Detector is
optimal for a certain class of edges (known as step edges). The images used
are generated using this implementation.
TEST IMAGE
77
large magnitudes.
3. Non-maximum suppression: Only local maxima should be marked as
edges.
4. Double thresholding: Potential edges are determined by thresholding.
5. Edge tracking by hysteresis: Final edges are determined by suppressing all
edges that
are not connected to a very certain (strong) edge.
2. Finding gradients
The Canny algorithm basically finds edges where the grayscale intensity of
the image changes the most. These areas are found by determining gradients
of the image.Gradients at each pixel in the smoothed image are determined
by applying what is known as the Sobel-operator. First step is to
approximate the gradient in the x- and y-direction respectively by applying
the kernels .
The gradient magnitudes (also known as the edge strengths) can then be
determined as an
78
Euclidean distance measure by applying the law of Pythagoras .It is
sometimes simplified by applying Manhattan distance measure to reduce the
computational complexity. The Euclidean distance measure has been applied
to the test image. The computed edge strengths are compared to the
smoothed image .
|G| = √|Gx| + |Gy|
|G| = |Gx| + |Gy| ()
where: Gx and Gy are the gradients in the x- and y-directions respectively.
It is obvious from Figure , that an image of the gradient magnitudes often
indicate the edges quite clearly. However, the edges are typically broad and
thus do not indicate exactly where the edges are. To make it possible , the
direction of the edges must be determined and stored .
θ = arctan|Gy|/|Gx|
3.Non-maximum suppression
The purpose of this step is to convert the “blurred” edges in the image of the
gradient magnitudes to “sharp” edges. Basically this is done by preserving
all local maxima in the gradient image, and deleting everything else. The
algorithm is for each pixel in the gradient image:
1. Round the gradient direction θ to nearest 45◦, corresponding to the use of
an 8-connected neighbourhood.
2. Compare the edge strength of the current pixel with the edge strength of
the pixel in the positive and negative gradient direction. I.e. if the gradient
direction is north (theta =
90◦), compare with the pixels to the north and south.
3. If the edge strength of the current pixel is largest; preserve the value of the
edge strength. If not, suppress (i.e. remove) the value.
79
A simple example of non-maximum suppression . Almost all pixels have
gradient directions pointing north. They are therefore compared with the
pixels above and below. The pixels that turn out to be maximal in this
comparison are marked with white borders. All other pixels will be
suppressed.
4.Double thresholding
80
variations are unlikely to result in a strong edge (with proper adjustment of
the threshold levels). Thus strong edges will (almost) only be due to true
edges in the original image. The weak edges can either be due to true edges
or noise/color variations. The latter type will probably be distributed
independently of edges on the entire image, and thus only a small amount
will be located adjacent to strong edges. Weak edges due to true edges are
much more likely to be connected directly to strong edges. Edge tracking
can be implemented by BLOB-analysis (Binary Large OBject). The edge
pixels are divided into connected BLOB’s using 8-connected
neighbourhood. BLOB’s containing at least one strong edge pixel are then
preserved, while other BLOB’s are suppressed.
(a) Double thresholding (b) Edge tracking by hysteresis (c) Final output
81
into groups. At the same time it is marked which groups are adjacent. Then
all of these markings are examined to determine which groups of weak
edges are connected to strong edges (directly or indirectly). All weak edges
that are connected to strong edges are marked as strong edges themselves.
The rest of the weak edges are suppressed. This can be interpreted as BLOB
analysis where only BLOB’s containing strong edges are preserved (and
considered as one BLOB).
The figures show the complete edge detection process on the test image
including all intermediate results.
(a) Original (b) Smoothed (c) Gradient magnitudes (d) Edges after
nonmaximum
suppression
(e) Double thresholding (f) Edge tracking by hysteresis (g) Final output
82
REFERENCES
83