|
-
Mar 25th, 2011, 06:10 PM
#1
Thread Starter
Banned
higashi no eden
i was wondering if someone has access to higashi no eden kind of program
which is a hand written text recognition and images recognition system ?
-
Mar 25th, 2011, 06:39 PM
#2
Re: higashi no eden
This is not a VB.NET question. I have alerted the mods and asked them to move this to General Discussion/Chit-Chat.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Mar 25th, 2011, 06:48 PM
#3
Thread Starter
Banned
Re: higashi no eden
i was talking about vb.net don't be a douche
-
Mar 25th, 2011, 06:55 PM
#4
Re: higashi no eden
 Originally Posted by moti barski
i was talking about vb.net don't be a douche
Whoa. Calm down, guy. There was nothing malicious about my post.
Your question isn't about how to accomplish a task in VB.NET. This section, aptly named "Visual Basic .NET" is for questions regarding the language.
You question asked if anyone had access to a 3rd party application. This, in itself, has nothing to do with VB and should not be here.
But, if you're asking how to re-create a specific function of that app, then you should ask that. Don't just ask us if we have access to the program, wait for us to reply with "yes" and then proceed with your question.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Mar 25th, 2011, 07:07 PM
#5
Thread Starter
Banned
Re: higashi no eden
fine i'll refreiz :
i am looking for vb.net source code that will take an image (bitmap) and analyze :
1 image of text then convert it to text (text recognition) i know the uk post office solved it so it is possible
or
2 image to some sort of category key (but not byte) i know various companese has it so it is possible
-
Mar 26th, 2011, 02:58 PM
#6
Re: higashi no eden
That is clearly a great improvement on what you posted before, as now far higher amount of people have the ability to help you - instead of just people who have a very specific piece of software (that most people here will have never heard of, as it isn't even an English name), anyone with any programming experience in that area can help.
However... your earlier insulting of another member is a very bad idea, partly because it is against our rules (thus could lead to some kind of punishment), but it is also likely to stop people from wanting to help you - because they can see that he was being helpful, even if you did not understand/appreciate it.
-
Mar 26th, 2011, 03:02 PM
#7
Thread Starter
Banned
Re: higashi no eden
i don't see any codes or answers in your post
-
Mar 26th, 2011, 03:12 PM
#8
Re: higashi no eden
That would be because there aren't any - what I posted was advice to help you to post in a way that makes people more likely to be able/willing to spend their time helping you.
An important part of growing up is understanding that we don't always get what we want from life, and reacting to situations like those in a rude manner (which includes your last post) just makes things worse for you.
-
Mar 26th, 2011, 05:23 PM
#9
Re: higashi no eden
 Originally Posted by moti barski
fine i'll refreiz :
i am looking for vb.net source code that will take an image (bitmap) and analyze :
1 image of text then convert it to text (text recognition) i know the uk post office solved it so it is possible
or
2 image to some sort of category key (but not byte) i know various companese has it so it is possible
Hi moti, I don't think you will find much about these subjects in VB.Net but I have seen an article that may interest you in the Code Project: Image Processing with Neural Networks. It's not an area I have studied but the article looks well written so I think it will be worth studying. The code is in Csharp, but you can find websites where you can translate Csharp almost perfectly into VB.Net. If you don't already have a Csharp compiler I suggest you install Microsoft Csharp Express so you can run the code of the article, and convert parts of it into VB.Net so you can understand them better.
The Code Project also has an interesting looking article about the subject of your question 1, OCR or optical character recognition. It is a slightly older article but it looks a bit simpler than the one I mentioned above, so maybe you will prefer to start with that. The same comments about Csharp apply.
Another good source to learn more about OCR and Image Recognition is the English-language WikiPedia, for example here and here.
BB
-
Mar 26th, 2011, 05:48 PM
#10
Re: higashi no eden
There was a good book on OCR that I had, but it was about fifteen years back. To put it mildly, OCR, especially for handwriting, is a VERY difficult subject. I think the neural net approach is probably the best. Every system that handles handwriting requires extensive training to get most samples even reasonably correct, so you will need a learning system to have any hope of accuracy. Just take a look at the terrible history that Apple and others had trying to get handwriting recognition to work on early PDAs. Those attempts were the stuff of legend...and ridicule. The later efforts were better, but they were never perfect.
I can guess why you are interested in this, and I would suggest that you go after a different target. Handwriting recognition has only been solved imperfectly, at best, so there would be lower hanging fruit.
My usual boring signature: Nothing
 
-
Mar 27th, 2011, 12:01 PM
#11
Thread Starter
Banned
Re: higashi no eden
i actually want to make an enthomology search engine
wierdmon i apologize if i insulted
-
May 4th, 2011, 02:54 PM
#12
Thread Starter
Banned
Re: higashi no eden
Code:
'Imports System.Math
Imports System.IO
' for i or j to smaller of h or w
Public Class Form1
Sub RGB_breakerBuster(ByVal color As String, ByRef red As String, ByRef green As String, ByRef blue As String)
red = color.Substring(color.IndexOf("R=") + 2)
color = red
red = red.Substring(0, red.IndexOf(","))
green = color.Substring(color.IndexOf("G=") + 2)
color = green
green = green.Substring(0, green.IndexOf(","))
blue = color.Substring(color.IndexOf("B=") + 2)
blue = blue.Substring(0, blue.IndexOf("]"))
End Sub
Public Function getPixelColor(ByVal red As String, ByVal green As String, ByVal blue As String) As Char
Dim r, g, b As Integer
Dim colorchar As Char
r = red
g = green
b = blue
If r > 245 And g > 245 And b > 245 Then
colorchar = "w" ' white
ElseIf r < 20 And g < 20 And b < 20 Then
colorchar = "k" ' black (kuro in japanese)
ElseIf r > g And g > b And g < 100 Then
colorchar = "r" ' red
ElseIf r > g And g > b And g > 200 Then
colorchar = "y" ' yellow
ElseIf r > g And g > b And 100 < g < 200 Then
colorchar = "o" 'orange
ElseIf (g > r And r > b) Or (g > b And b > r) Then
colorchar = "g" 'green
ElseIf b > g And g > r Then
colorchar = "b" 'blue
ElseIf (b > r And r > g) Or (r > b And g < 20) Then
colorchar = "v" ' violet
Else
colorchar = "u" ' yet undefined
End If
Return colorchar
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox3.Text = ""
Dim r1, g1, b1 As String
r1 = "x"
g1 = "x"
b1 = "x"
PictureBox1.ImageLocation = TextBox2.Text ' image path string
Dim bm As Bitmap
bm = PictureBox1.Image
Dim h, w As Integer
h = bm.Height()
w = bm.Width()
Dim jump As Integer
jump = 35 ' jump ~= sqrt(h*w \ 250), jump < h, jump < w, jump > 1
Try
Dim jump2 As Integer
jump2 = TextBox1.Text
If jump2 > 1 And jump2 < h And jump2 < w Then
jump = jump2
End If
Catch ex As Exception
End Try
Dim recoString As String = "" ' string of image
Dim prevColor, curColor As Char
If h > w Then
h = w
End If
Dim xi As Integer
xi = h \ jump
For index As Integer = 1 To xi
recoString &= "_"
prevColor = "-"
For j As Integer = 1 To xi
RGB_breakerBuster(bm.GetPixel(index * jump, j * jump).ToString(), r1, g1, b1)
curColor = getPixelColor(r1, g1, b1)
If curColor <> prevColor Then
recoString &= curColor
prevColor = curColor
End If
Next
Next
If recoString.Length > 238 Then
recoString = recoString.Substring(0, 238)
End If
TextBox4.Text = recoString
If File.Exists("C:\higashiDB\" & recoString & ".txt") Then
TextBox3.Text = File.ReadAllText("C:\higashiDB\" & recoString & ".txt")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox4.Text <> "" Then
If File.Exists("C:\higashiDB\" & TextBox4.Text & ".txt") Then
File.Delete("C:\higashiDB\" & TextBox4.Text & ".txt")
'File.Delete("path string")
End If
File.WriteAllText("C:\higashiDB\" & TextBox4.Text & ".txt", TextBox3.Text)
End If
End Sub
End Class
walkthrough for using the program :
add a higashiDB named folder in c:\
while running the program :
type image path (+ image name + image ending (like : C:\Documents and Settings\rain\Desktop\pics for higashi vid\1.jpg
)), click the button 2 or 4 times, type description, click save button to save new description for the image.
HERE IS THE QUESTION :
this works on my amd computer but not on my laptop the glitch is for this code line :
PictureBox1.ImageLocation = TextBox2.Text ' image path string
the image doesn't show (in the laptop i commet this out and input the image via the picturebox little arrow import) how to fix (so the code will work on the laptop) ?
-
May 4th, 2011, 03:49 PM
#13
Re: higashi no eden
What is different between the laptop and the other computer?
By the way, your RGB_breakerBuster method is going to be terribly inefficient. GetPixel returns a color. Turning that color into a string and decomposing the string to get the RGB values is about the slowest possible way to go about it. To make it faster, use the ToARGB method, which will turn the color into a four byte integer, then use a little bit shifting to get out the R, the G, and the B. This will be FAR faster than working with strings.
My usual boring signature: Nothing
 
-
May 4th, 2011, 04:16 PM
#14
Thread Starter
Banned
Re: higashi no eden
1 i don't know what is different between the laptop and the other computer (amd dual core) but on the netbook(msi laptop) instead of the image i see a small x in a white square and I can't figure it out
it does work on the amd (but i gotta click the button atleast twice)
2 does it work for you ?
3 if you wanna amp up the code i would like that, currently i have no knowledge of using ToARGB
a walkthrough would be sweet
-
May 4th, 2011, 04:42 PM
#15
Re: higashi no eden
What you have is this:
Code:
Sub RGB_breakerBuster(ByVal color As String, ByRef red As String, ByRef green As String, ByRef blue As String)
red = color.Substring(color.IndexOf("R=") + 2)
color = red
red = red.Substring(0, red.IndexOf(","))
green = color.Substring(color.IndexOf("G=") + 2)
color = green
green = green.Substring(0, green.IndexOf(","))
blue = color.Substring(color.IndexOf("B=") + 2)
blue = blue.Substring(0, blue.IndexOf("]"))
End Sub
You will get better performance with this:
Code:
Sub RGB_breakerBuster(ByVal inColor as Color, ByRef red As Integer, ByRef green As Integer, ByRef blue As Integer)
Dim clr as Integer inColor.ToARGB
red = ((clr>>16) And &HFF)
green= ((clr >> 8) And &HFF)
blue = (clr And &HFF)
End Sub
ToARGB returns an integer where the high byte is transparency, the next byte is red, the next is green, and the low byte is blue. Therefore, I take that integer, shift it right by 16 and mask out all but the low byte (which is the red byte, after the shift). To get the green, I shift ir right by 8. To get the blue byte, since it is already the low byte, I don't have to shift it at all.
Note that I changed the arguments, too. GetPixel returns a Color structure already, so you don't want to call .ToString on it. I also changed the red, green, and blue arguments to type Integer. Converting back and forth from strings to integers is slow.
My usual boring signature: Nothing
 
-
May 4th, 2011, 07:25 PM
#16
Re: higashi no eden
 Originally Posted by Shaggy Hiker
What you have is this:
Code:
Sub RGB_breakerBuster(ByVal color As String, ByRef red As String, ByRef green As String, ByRef blue As String)
red = color.Substring(color.IndexOf("R=") + 2)
color = red
red = red.Substring(0, red.IndexOf(","))
green = color.Substring(color.IndexOf("G=") + 2)
color = green
green = green.Substring(0, green.IndexOf(","))
blue = color.Substring(color.IndexOf("B=") + 2)
blue = blue.Substring(0, blue.IndexOf("]"))
End Sub
You will get better performance with this:
Code:
Sub RGB_breakerBuster(ByVal inColor as Color, ByRef red As Integer, ByRef green As Integer, ByRef blue As Integer)
Dim clr as Integer inColor.ToARGB
red = ((clr>>16) And &HFF)
green= ((clr >> 8) And &HFF)
blue = (clr And &HFF)
End Sub
or this:
Code:
Sub RGB_breakerBuster(ByVal inColor as Color, ByRef red As Integer, ByRef green As Integer, ByRef blue As Integer)
red = inColor.R
green= inColor.G
blue = inColor.B
End Sub
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
May 4th, 2011, 07:29 PM
#17
Re: higashi no eden
I thought those existed, but when I looked at the methods for the color structure, I didn't see them.
My usual boring signature: Nothing
 
-
May 5th, 2011, 05:50 PM
#18
Thread Starter
Banned
Re: higashi no eden
a demonstration was uploaded to youtube :
http://www.youtube.com/watch?v=uQ-qE4_Cyps
vb.net image recognition aka higashi no eden
maybe now you could fix
Last edited by moti barski; May 5th, 2011 at 05:56 PM.
-
May 13th, 2011, 01:53 PM
#19
Thread Starter
Banned
Re: higashi no eden
the error also on the AMD now :
Object reference not set to an instance of an object.
in the line :
h = bm.Height()
of the new code :
Code:
Imports System.IO
Public Class Form1
Sub RGB_breakerBuster(ByVal inColor As Color, ByRef red As Integer, ByRef green As Integer, ByRef blue As Integer)
' returns value of red,green,blue in a pixel of a bitmap as integers
red = inColor.R
green = inColor.G
blue = inColor.B
End Sub
Public Function getPixelColor(ByVal r As Integer, ByVal g As Integer, ByVal b As Integer) As Char
' r= red, g = green, b = blue
Dim colorchar As Char
If r > 245 And g > 245 And b > 245 Then
colorchar = "w" ' white
ElseIf r < 20 And g < 20 And b < 20 Then
colorchar = "k" ' black (kuro in japanese)
ElseIf r > g And g > b And g < 100 Then
colorchar = "r" ' red
ElseIf r > g And g > b And g > 200 Then
colorchar = "y" ' yellow
ElseIf r > g And g > b And 100 < g < 200 Then
colorchar = "o" 'orange
ElseIf (g > r And r > b) Or (g > b And b > r) Then
colorchar = "g" 'green
ElseIf b > g And g > r Then
colorchar = "b" 'blue
ElseIf (b > r And r > g) Or (r > b And g < 20) Then
colorchar = "v" ' violet
End If
Return colorchar
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox3.Text = ""
Dim r1, g1, b1 As Integer
PictureBox1.ImageLocation = TextBox2.Text ' image path string
Dim bm As Bitmap
bm = PictureBox1.Image
Dim h, w As Integer
h = bm.Height()
w = bm.Width()
Dim jump As Integer
jump = 35 ' jump ~= sqrt(h*w \ 250), jump < h, jump < w, jump > 1
Try
Dim jump2 As Integer
jump2 = TextBox1.Text
If jump2 > 1 And jump2 < h And jump2 < w Then
jump = jump2
End If
Catch ex As Exception
End Try
Dim recoString As String = "" ' string of image
Dim prevColor, curColor As Char
If h > w Then
h = w
End If
Dim xi As Integer
xi = h \ jump
For index As Integer = 1 To xi
recoString &= "_"
prevColor = "-"
For j As Integer = 1 To xi
RGB_breakerBuster(bm.GetPixel(index * jump, j * jump), r1, g1, b1)
curColor = getPixelColor(r1, g1, b1)
If curColor <> prevColor Then
recoString &= curColor
prevColor = curColor
End If
Next
Next
If recoString.Length > 238 Then
recoString = recoString.Substring(0, 238)
End If
TextBox4.Text = recoString
If File.Exists("C:\higashiDB\" & recoString & ".txt") Then
TextBox3.Text = File.ReadAllText("C:\higashiDB\" & recoString & ".txt")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox4.Text <> "" Then
If File.Exists("C:\higashiDB\" & TextBox4.Text & ".txt") Then
File.Delete("C:\higashiDB\" & TextBox4.Text & ".txt")
'File.Delete("path string")
End If
File.WriteAllText("C:\higashiDB\" & TextBox4.Text & ".txt", TextBox3.Text)
End If
End Sub
End Class
the image path is correct
-
May 13th, 2011, 02:16 PM
#20
Thread Starter
Banned
Re: higashi no eden
Code:
PictureBox1.ImageLocation = TextBox2.Text ' image path string
Dim fs As IO.FileStream = New IO.FileStream(TextBox2.Text, IO.FileMode.Open)
Dim image1 As Image = Image.FromStream(fs)
fs.Close()
solved now I'll finish the code
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|