implementation zernike moments in OCR at android base
i have this final project and my topis is build an android OCR(optical
character recognition) application using zernike moments and neural
network for the classifier. i just confuse with how to implement this
zernike moments, need help in coding and algorithm at java android.
Monday, 2 September 2013
set 4-bit nibble in an int type
set 4-bit nibble in an int type
we need to come up a method that set a 4-bit nibbles in an int output
should like this:
setNibble(0xAAA5, 0x1, 0); // => 0xAAA1
setNibble(0x56B2, 0xF, 3); // => 0xF6B2
This is what i wrote...
public static int setNibble(int num, int n, int which)
{
int output;
if(which ==0)
{
output = (num & 65280) |nibble;
}
else
{
int shift = nibble << 8 ;
output = (num & 255) | shift;
}
return output;
}
but there have something wrong that I cannot figure out
setNibble(FFFF, 0, 0): Expected: FFF0 Result: FF00
setNibble(FFFF, 6, 1): Expected: FF6F Result: 6FF
setNibble(1312, E, 1): Expected: 13E2 Result: E12
Anyone can help me ? Thanks in advance!
we need to come up a method that set a 4-bit nibbles in an int output
should like this:
setNibble(0xAAA5, 0x1, 0); // => 0xAAA1
setNibble(0x56B2, 0xF, 3); // => 0xF6B2
This is what i wrote...
public static int setNibble(int num, int n, int which)
{
int output;
if(which ==0)
{
output = (num & 65280) |nibble;
}
else
{
int shift = nibble << 8 ;
output = (num & 255) | shift;
}
return output;
}
but there have something wrong that I cannot figure out
setNibble(FFFF, 0, 0): Expected: FFF0 Result: FF00
setNibble(FFFF, 6, 1): Expected: FF6F Result: 6FF
setNibble(1312, E, 1): Expected: 13E2 Result: E12
Anyone can help me ? Thanks in advance!
How do you get the title of an html page in Javascript
How do you get the title of an html page in Javascript
I've currently got a website in which a div is updated to the contents of
the same div on another page via Javascript, allowing a seamless
transition between webpages, but how do I make the title of the webpage
update to the title of the new webpage?
I've currently got a website in which a div is updated to the contents of
the same div on another page via Javascript, allowing a seamless
transition between webpages, but how do I make the title of the webpage
update to the title of the new webpage?
CanJS models with Knockout
CanJS models with Knockout
I have a medium size single page application using Knockout that I would
like to port incrementally to CanJS. The reason being that support of
complex models seems to be easier there. Anyway, at this stage I would
like to use CanJS models with Knockout observables.
Is this possible at all? Any issues to take care of?
I have a medium size single page application using Knockout that I would
like to port incrementally to CanJS. The reason being that support of
complex models seems to be easier there. Anyway, at this stage I would
like to use CanJS models with Knockout observables.
Is this possible at all? Any issues to take care of?
oncontextmenu doesn't prevent the browser's context menu from appearing when i right click
oncontextmenu doesn't prevent the browser's context menu from appearing
when i right click
i have the following short code
<body oncontextmenu="return false">
<p class="info">
Books are the world of information. As said the books are the best
friends. A wise
man always has a library of several books</p>
<ul id="contextmenu">
........
js file
$('.info').mousedown(function(event){
if(event.button==2){
$('#contextmenu').show();
}
}
I want the browser's context menu not to appear as default along with our
context menu when i right click on .info.
oncontextmenu="return false"
doesn't work
when i right click
i have the following short code
<body oncontextmenu="return false">
<p class="info">
Books are the world of information. As said the books are the best
friends. A wise
man always has a library of several books</p>
<ul id="contextmenu">
........
js file
$('.info').mousedown(function(event){
if(event.button==2){
$('#contextmenu').show();
}
}
I want the browser's context menu not to appear as default along with our
context menu when i right click on .info.
oncontextmenu="return false"
doesn't work
Sunday, 1 September 2013
special characters in html content
special characters in html content
I have an web page which is suppossed to display html content,but
inbetween html content it is displaying some special characters such as
?,% and all pyramid kind of figures.How do i add the character support and
fix this issue.TYhanks
I have an web page which is suppossed to display html content,but
inbetween html content it is displaying some special characters such as
?,% and all pyramid kind of figures.How do i add the character support and
fix this issue.TYhanks
adcontrol hiding text in the android app
adcontrol hiding text in the android app
I am creating a small android app When I am adding a adcontrol at the
bottom of the screen, it hides a small part of the content that is shown
in the scroll view
Here is the xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
tools:context=".MainActivity"
android:id="@+id/mainActivityParentRelativeLayout">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:id="@+id/scrollView">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:id="@+id/idTableLayout"
android:stretchColumns="*"
android:shrinkColumns="*">
</TableLayout>
</ScrollView>
</RelativeLayout>
In the table layout I am adding multiple textviews dynamically
Also I am adding adcontrol dynamically Here is the code for that
{
RelativeLayout linearLayout =
(RelativeLayout)findViewById(R.id.mainActivityParentRelativeLayout);
AdView adview = Utilities.AddAdMobControl(this);
RelativeLayout.LayoutParams params= new
RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, adview.getId());
adview.setLayoutParams(params);
linearLayout.addView(adview);
}
I am creating a small android app When I am adding a adcontrol at the
bottom of the screen, it hides a small part of the content that is shown
in the scroll view
Here is the xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
tools:context=".MainActivity"
android:id="@+id/mainActivityParentRelativeLayout">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:id="@+id/scrollView">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:id="@+id/idTableLayout"
android:stretchColumns="*"
android:shrinkColumns="*">
</TableLayout>
</ScrollView>
</RelativeLayout>
In the table layout I am adding multiple textviews dynamically
Also I am adding adcontrol dynamically Here is the code for that
{
RelativeLayout linearLayout =
(RelativeLayout)findViewById(R.id.mainActivityParentRelativeLayout);
AdView adview = Utilities.AddAdMobControl(this);
RelativeLayout.LayoutParams params= new
RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, adview.getId());
adview.setLayoutParams(params);
linearLayout.addView(adview);
}
Subscribe to:
Posts (Atom)