Click here to Skip to main content

C#

   
Home > Forums > C#

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
QuestionRegarding AttributeUsageAttribute.AllowMultiple PinmemberPIEBALDconsult8:11 22 Feb '12  
QuestionHow to check that dsn which is created used for Sql Server or Access using C# PinmemberAwadhendra12342:16 22 Feb '12  
AnswerRe: How to check that dsn which is created used for Sql Server or Access using C# PinmemberPIEBALDconsult2:56 22 Feb '12  
GeneralRe: How to check that dsn which is created used for Sql Server or Access using C# PinmemberAwadhendra12343:24 22 Feb '12  
GeneralRe: How to check that dsn which is created used for Sql Server or Access using C# PinmemberPIEBALDconsult4:00 22 Feb '12  
QuestionDetect Marked Checkbox using OCR Pinmemberzead2:12 22 Feb '12  
AnswerRe: Detect Marked Checkbox using OCR PinPopularmemberenhzflep4:44 22 Feb '12  
Certainly willing to try Smile | :)
 
If the images will be obtained from a scanner, I'd suggest that you first implement code that will detect the skew angle and correct it. I seem to remember adapting some code with a name of gmeDeskew or something like that.
 
Next, you'll want to define the areas of interest. That is, the areas that will contain check-boxes that should be examined. Since different skew angles will result in images of slightly different sizes when deskewed, I'd suggest that these areas are defined using percentage of document width/height, as opposed to being defined in terms of number of pixels.
 
Once you have correctly deskewed the image and identified the areas of interest, you'll want to scan the image line-by-line, row by row to determine areas likely to contain check-boxes within your area of interest. Once done, examine the heck-boxes by simply counting the number of percentage of pixels that are below a certain brightness (you'll have to determine this threshold)
 

 
I coded an app once that would take scanned images of (college) attendance sheets, identifying the class name/week from a barcode, the student IDs from barcodes, then finally - the student attendance from manually colored 'radio buttons'
 
With this method, I was able to take an example image (at 1/4 scale as it happened) then deskew it and draw rectangles around each of the 18 barcodes for student ID, the 18 attendance scores for the students, the class name barcode and the class date barcode.
Then when I used full size images all of my areas of interest remained aligned correctly. (Using percentages of image size GREATLY improved the accuracy of the placement of the areas of interest onto each successive image. Prior to that idea, it was very difficult to be sure that I was going to examine the pixels that made up the parts of the image I was interested in)
 

Something else to consider is "pattern matching", or put simply - the comparing of pre-existing images with portions of the scanned document. You could simply use two images - one of an empty square and another of a check-box with a cross/dot/dash inside it. This should be effective because regardless of the style of marking, an empty box is always going to more closely resemble the saved image you have of an empty box (rather than the checked-box).
 
It's an interesting topic, OMR. (optical mark recognition) Enjoy! Smile | :)
GeneralRe: Detect Marked Checkbox using OCR Pinmemberzead20:29 22 Feb '12  
GeneralRe: Detect Marked Checkbox using OCR Pinmemberenhzflep20:43 22 Feb '12  
Questionsmtp unknown sender PinmemberCS3423:23 21 Feb '12  
AnswerRe: smtp unknown sender PinmvpRichard MacCutchan3:14 22 Feb '12  
Questionadd application to \\root\SecurityCenter2\antispywareproduct as antispyware Pinmemberabhinish23:12 21 Feb '12  
Questionhow can i scann image from scanner in C# PinmemberA7mad_22:55 21 Feb '12  
AnswerRe: how can i scann image from scanner in C# Pinmemberlukeer2:17 22 Feb '12  
Questiontrouble in connecting from C# to Postgre SQL. Pinmemberhellono120:46 21 Feb '12  
AnswerRe: trouble in connecting from C# to Postgre SQL. PinmemberBobJanova21:42 21 Feb '12  
QuestionIntegration of .NET with retail billing machine Pinmembertahernd19:14 21 Feb '12  
AnswerRe: Integration of .NET with retail billing machine PinmvpRichard MacCutchan21:24 21 Feb '12  
AnswerRe: Integration of .NET with retail billing machine PinmemberMycroft Holmes21:39 21 Feb '12  
GeneralRe: Integration of .NET with retail billing machine Pinmembertahernd0:26 22 Feb '12  
QuestionAny difference between Console App and Windows Service for HttpWebRequest..? [Solved] PinmemberTimothy CIAN6:38 21 Feb '12  
AnswerRe: Any difference between Console App and Windows Service for HttpWebRequest..? Pinmemberjschell9:41 21 Feb '12  
GeneralRe: Any difference between Console App and Windows Service for HttpWebRequest..? PinmemberTimothy CIAN10:10 21 Feb '12  
AnswerRe: Any difference between Console App and Windows Service for HttpWebRequest..? PinmvpDave Kreskowiak15:08 21 Feb '12  
GeneralRe: Any difference between Console App and Windows Service for HttpWebRequest..? PinmemberTimothy CIAN3:34 22 Feb '12  

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

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


Advertise | Privacy | Mobile
Beta | 2.5.120517.1 | Last Updated 22 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid