Click here to Skip to main content
15,914,390 members
Home / Discussions / C#
   

C#

 
GeneralRe: Avoid space at the Start of the textbox Pin
Pete O'Hanlon7-Sep-13 22:30
mvePete O'Hanlon7-Sep-13 22:30 
GeneralRe: Avoid space at the Start of the textbox Pin
BillWoodruff8-Sep-13 4:08
professionalBillWoodruff8-Sep-13 4:08 
GeneralRe: Avoid space at the Start of the textbox Pin
Pete O'Hanlon8-Sep-13 4:46
mvePete O'Hanlon8-Sep-13 4:46 
GeneralRe: Avoid space at the Start of the textbox Pin
BillWoodruff8-Sep-13 20:09
professionalBillWoodruff8-Sep-13 20:09 
GeneralRe: Avoid space at the Start of the textbox Pin
Pete O'Hanlon8-Sep-13 23:11
mvePete O'Hanlon8-Sep-13 23:11 
GeneralRe: Avoid space at the Start of the textbox Pin
Dave Kreskowiak8-Sep-13 3:34
mveDave Kreskowiak8-Sep-13 3:34 
GeneralRe: Avoid space at the Start of the textbox Pin
BillWoodruff8-Sep-13 4:15
professionalBillWoodruff8-Sep-13 4:15 
AnswerRe: Avoid space at the Start of the textbox Pin
blitzkrieged7-Sep-13 20:57
blitzkrieged7-Sep-13 20:57 
GeneralRe: Avoid space at the Start of the textbox Pin
Dave Kreskowiak8-Sep-13 3:37
mveDave Kreskowiak8-Sep-13 3:37 
AnswerRe: Avoid space at the Start of the textbox Pin
sep_exambo8-Sep-13 15:07
professionalsep_exambo8-Sep-13 15:07 
AnswerRe: Avoid space at the Start of the textbox Pin
Eddy Vluggen9-Sep-13 8:15
professionalEddy Vluggen9-Sep-13 8:15 
QuestionHow to check the activated Soundoutput device? Pin
Member 101332676-Sep-13 22:28
Member 101332676-Sep-13 22:28 
AnswerRe: How to check the activated Soundoutput device? Pin
Richard MacCutchan6-Sep-13 23:10
mveRichard MacCutchan6-Sep-13 23:10 
Questionneed online hotel managment project in .net Pin
teena chundavat6-Sep-13 8:34
teena chundavat6-Sep-13 8:34 
AnswerRe: need online hotel managment project in .net Pin
Eddy Vluggen6-Sep-13 8:39
professionalEddy Vluggen6-Sep-13 8:39 
AnswerRe: need online hotel managment project in .net Pin
jschell6-Sep-13 8:40
jschell6-Sep-13 8:40 
AnswerRe: need online hotel managment project in .net Pin
Jason Gleim6-Sep-13 9:06
professionalJason Gleim6-Sep-13 9:06 
GeneralRe: need online hotel managment project in .net Pin
Eddy Vluggen6-Sep-13 13:41
professionalEddy Vluggen6-Sep-13 13:41 
GeneralRe: need online hotel managment project in .net Pin
Mycroft Holmes6-Sep-13 13:56
professionalMycroft Holmes6-Sep-13 13:56 
AnswerRe: need online hotel managment project in .net Pin
Abhinav S6-Sep-13 17:06
Abhinav S6-Sep-13 17:06 
AnswerRe: need online hotel managment project in .net Pin
BillWoodruff6-Sep-13 18:18
professionalBillWoodruff6-Sep-13 18:18 
GeneralRe: need online hotel managment project in .net Pin
Mycroft Holmes6-Sep-13 22:13
professionalMycroft Holmes6-Sep-13 22:13 
GeneralRe: need online hotel managment project in .net Pin
BillWoodruff7-Sep-13 19:31
professionalBillWoodruff7-Sep-13 19:31 
QuestionAt last i got this Tessnet2 ocr to work. Now how do i extract specific text/numbers from an image ? Pin
chocolade6-Sep-13 7:19
chocolade6-Sep-13 7:19 
This is the code that is working for me:

C#
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"); // If digit only
            ocr.Init(@"C:\TEMP\tessdata\tessdata", "eng", false); // To use correct tessdata
            List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
            foreach (tessnet2.Word word in result)
                //Console.WriteLine("{0} : {1}", word.Confidence, word.Text);
            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.
AnswerRe: At last i got this Tessnet2 ocr to work. Now how do i extract specific text/numbers from an image ? Pin
Eddy Vluggen6-Sep-13 8:42
professionalEddy Vluggen6-Sep-13 8:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.