|
Adding restaurant, catering, health-club, etc., will bump up the ship-date to 4 hours.
In the interests of good taste, I will not describe here the other "operational costs" and revenue-streams the hotel may have if it were in Thailand.
bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
This is the code that is working for me:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using tessnet2;
namespace OCR
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
string path = @"D:\timessquaretif.tif";
Bitmap image = new Bitmap(path);
Tesseract ocr = new Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "0123456789");
ocr.Init(@"C:\TEMP\tessdata\tessdata", "eng", false);
List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
foreach (tessnet2.Word word in result)
listBox1.Items.Add(string.Format("{0} : {1}", word.Confidence, word.Text));
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
The problem is that in the listBox i see many numbers and near them words letters and chars.
In the image tiff one im using with my code there is on the bottom a Date and Time for example: September 5,13 | 6:06am
How can i extract only the date and time so in the listBox i will see on one line: September 5,13 6:06am or September 5 13 6:06am
Any ideas ?
Thanks.
|
|
|
|
|
chocolade wrote: Any ideas ? Yes, how about trying a "Tessnet2"-specific forum?
This is generic C#, there's probably not much people with experience in a specific OCR-package. FWIW, I'd assume that it lists a range of characters it "thinks" it detects, paired with a certainty. You'd need to consult their documentation to verify that though.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi, I am developing a C# based desktop application which has GUI developed using WPF.
My application has some SQLite database where I save users data.
1) Now I want to place this database in the Cloud so that if user lost it in local device, it can be fetched from cloud from anywhere.
2) Every time whenever local database changed it should be synchronized with data which is there in Cloud. i.e., there should be bidirectional synchronization.
Now I have two options. One is Windows Azure and other is Microsoft Sync Framework.
Please tell me which one I can go for now?
Though Windows Azure is not free, I can go for it. But is it useful?
Since my application is C#/WPF desktop application, can I go with Azure?
Any help please?
Thanks
|
|
|
|
|
|
Although this would be a better question in the cloud forum, I'll suggest you look at Azure Mobile Services. It provides a very simple and easy to use API to do this sort of thing.
|
|
|
|
|
how can i discover windows and UNIX server's model,manufacturer and serial number details using SNMP. Is there a way to discover all the devices in a network without SNMP or WMI.
|
|
|
|
|
The target servers either have a way to get this information or they don't.
If they do then it will vary in various ways.
You find each way and write code to get it using the discovered process.
|
|
|
|
|
Considering SNMP is NOT turned on in Windows Server by default, no nobody really turns it on, you're not going to get much information that way.
|
|
|
|
|
Im using the modi lib code and cant make it work.
This is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
using System.Drawing.Imaging;
namespace SearchLiveCameras
{
public partial class Form1 : Form
{
StreamWriter w;
public Form1()
{
InitializeComponent();
w = new StreamWriter(@"d:\ocrErrors.txt");
Bitmap BWImage = new Bitmap(@"d:\timessquare1.bmp");
System.Drawing.Imaging.BitmapData BWLockImage = BWImage.LockBits(new Rectangle(0, 0, BWImage.Width, BWImage.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, PixelFormat.Format1bppIndexed);
int imageSize = BWLockImage.Stride * BWLockImage.Height;
byte[] BWImageBuffer = new byte[imageSize];
Marshal.Copy(BWLockImage.Scan0, BWImageBuffer, 0, imageSize);
DoOCR(BWLockImage, BWImageBuffer, tmpPosRect, false);
}
public string DoOCR(System.Drawing.Imaging.BitmapData BWLockImage, byte[] BWImageBuffer, Rectangle iAusschnitt, bool isNumber)
{
MODI.Document _MODIDocument = new MODI.Document();
Bitmap tmpImage = Bildausschnitt1bpp(BWLockImage, BWImageBuffer, iAusschnitt);
string file = Path.GetTempFileName();
string tmpResult = "";
try
{
tmpImage.Save(file, ImageFormat.Tiff);
_MODIDocument.Create(file);
_MODIDocument.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, false, false);
MODI.IImage myImage = (MODI.IImage)_MODIDocument.Images[0];
MODI.ILayout myLayout = (MODI.ILayout)myImage.Layout;
tmpResult = myLayout.Text;
}
catch
{
if (_MODIDocument != null)
{
_MODIDocument.Close(false);
_MODIDocument = null;
}
tmpImage.Dispose();
tmpImage = null;
GC.Collect();
File.Delete(file);
}
return tmpResult;
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
First i dont know what are the variables:
tmpPosRect and Bildausschnitt1bpp
Second problem is that im getting an OCR error exception on any image from my over 600 images i have on the hard disk some with chars inside like numbers and text .
The exception is on the line:
_MODIDocument.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, false, false);
Can't figure out why im getting this error.
This is the first method i did yesterday when i first tried the ocr:
private void test()
{
MODI.Document md = new MODI.Document();
md.Create("D:\\trying1.tif");
md.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, false, false);
md.Close(false);
MODI.Image image = (MODI.Image)md.Images[0];
MODI.Layout layout = image.Layout;
f = layout.Text;
}
When trying to use this test() method im getting an error on the line:
md.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, false, false);
The exception im getting is: COMException
OCR running error
System.Runtime.InteropServices.COMException was unhandled
HResult=-959967087
Message=OCR running error
Source=""
ErrorCode=-959967087
StackTrace:
at MODI.IDocument.OCR(MiLANGUAGES LangId, Boolean OCROrientImage, Boolean OCRStraightenImage)
at SearchLiveCameras.Form1.test() in d:\C-Sharp\SearchliveCameras\SearchLiveCameras\SearchLiveCameras\Form1.cs:line 33
at SearchLiveCameras.Form1..ctor() in d:\C-Sharp\SearchliveCameras\SearchLiveCameras\SearchLiveCameras\Form1.cs:line 26
at SearchLiveCameras.Program.Main() in d:\C-Sharp\SearchliveCameras\SearchLiveCameras\SearchLiveCameras\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Please help me i can't figure out why im getting this exception on any of the images i have.
|
|
|
|
|
Look Here[^] for some more information.
Basically, the issue is the DPI of the Bitmap.
Why are you using MODI anyways? It is no longer a supported method due to a number of issues it has, such as creating invalid image files. I would recommend using Tessnet2[^], a .NET Wrapper around the Tesseract OCR library.
Keep Clam And Proofread
--
√(-1) 23 ∑ π...
And it was delicious.
|
|
|
|
|
Brisingr Thank you.
Im trying to use now the Tessnet2 code but it's not working.
I have cdownloaded the lib dll file of the 64bit added as referenced to my project changed my project platform target to x64.
Then i added this code to my program:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace SearchLiveCameras
{
public partial class Form1 : Form
{
StreamWriter w;
public Form1()
{
InitializeComponent();
w = new StreamWriter(@"d:\ocrErrors.txt");
Bitmap image = new Bitmap(@"d:\timessquaretif.tif");
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "0123456789");
ocr.Init(@"c:\temp", "fra", false);
List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
foreach (tessnet2.Word word in result)
Console.WriteLine("{0} : {1}", word.Confidence, word.Text);
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
But for some reason it never pass the line:
ocr.Init(@"c:\temp", "fra", false);
I use a breakpoint i see its getting to this line when i click continue the program just exit and does nothing.
It never get to the last three lines. It never get to the List.
Maybe there is an exception somewhere but i dont see it its just quit/exit the program when its doing the line:
ocr.Init(@"c:\temp", "fra", false);
What is wrong ?
|
|
|
|
|
chocolade wrote: Maybe there is an exception somewhere but i dont see
You might wrap it in a try catch, it may get the error where debugger is missing it (seems unlikely but worth a try)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If the library requires some interaction with the UI, doing things in the constructor of a form is often too early. Better add a button to you form, and do the things in the click event handler. Not sure if that will help here.
|
|
|
|
|
When the entity include a field which is DbGeometry or DbGeography , it will return a error message "The provider did not return a DbSpatialServices instance."
|
|
|
|
|
Hi guys!
I'm not sure this is the right place for this so forgive me if it's not but here goes.
I've made a USB board called PeekyPokey with an API so that you can use .NET languages such as C# for interfacing with electronics stuff like relays, RFID tag readers, tactile buttons, rotary encoders, keypads, sensors, servos and things like that. Project home page on CodePlex:
http://www.peekypokey.org/
The API also comes with an extensive toolkit containing classes for the PC side of things too - like a built in webserver, gamepad drivers, virtual keys, midi interface, general HID interface and so on - things you can use to control electronic devices.
In essence, PeekyPokey has 8 general input/outputs, a virtual COM port, 3.3V/5V power supplies and kind of brings Windows PCs and electronics together in pretty much the same way IOIO does for Android.
The PeekyPokey board targets programmers curious of embedded electronics programming and hardware interfacing. The whole idea is to play, explore, learn and have fun with electronics.
I'm wondering if you'd be interested in me writing an article about the board and how to use it?
NOTE: I'm not selling the boards, I'm just the creator.
Thanks!
|
|
|
|
|
hanzibal2 wrote: I'm not sure this is the right place for this so forgive me if it's not but here goes.
It looks like your tool is free, so post it in the Free Tools forum[^].
|
|
|
|
|
|
I'm working on a dynamic data website with linqtosql dbml file. Could anyone please help in giving some examples on how to update records displayed in a formview that allows paging? The formview exists in the "Edit.aspx" page with DefaultMode="Edit" and DataSourceID="DetailsDataSource" where "DetailsDataSource" is a LinqDataSource with EnableUpdate="true". The bottomrow of the formview contains a LinkButton with CommandName="Update" to perform the update operation. Once I change some info in the bounddatafieds and then click on the linkbutton, the formview loads with empty datafields and no updates are saved to the database.
Any help will be much appreciated.
Thank you.
|
|
|
|
|
how can i start a shell and execute a command and capture output using ganymed-ssh2 c# library
|
|
|
|
|
Considering that's a Java library, there is no direct way to use in .NET.
You'd have to use a "bridge" library to use that in C#. Something like JNI4NET[^] should do it.
As for exactly what you have to do with that SSH2 library, I have no idea. I've never used it nor will I as it's open source and there is no support for it at all.
|
|
|
|
|
|
Hi there !
I haved mapped a network resource to drive "S:". There is a need for username and password to access this path.
Now i'm tryin to write a Windows Service (by using a VS Windows Service Project), which does in a certain interval something with the files located on "S:"
I've tried to put the Account-Property of the corresponding serviceProcessInstaller-Instance to "User" and filled the Username- and Password-Properties with the values of the current User (who has the rights to access this path via windows explorer).
Before accessing some files, my code checks the directory
like:
if (Directory.Exists("S:\\SubDir"))
{
//do it !
}
If i copy my code to a default VS windows console project, it works! But by running my code in a Windows Service the Directory.Exists("S:\\SubDir")-Condition returns false.
Are there missing rights ?
can i include the credentials for accessing this path in my code ? maybe something like this:
SomeType DriveS = new SomeType("S:","username","password");
DriveS.TryToAccess();
Any Ideas ?
Jeff
|
|
|
|
|
Any Ideas:
Your service runs with an account which has no network access at all.
Run your service under an account which can access the the folder. You can change that in mmc.exe in the Properties page of the service.
|
|
|
|
|
Hi,
If you are using Shared folder in the network you may need to create networkconnection to connect using your network credentials.
Check this thread for your answers.[^]
Let us know if this is not working for you.
Thanks
-Amit Gajjar
|
|
|
|
|