iSight scanning work

Announcements, upcoming features,... (READ ME!)
Post Reply
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

iSight scanning work

Post by Nora »

Hello everyone,

We're working on updating our iSight feature once again and while we have already received some help from users, we'd now like to ask everyone who's having trouble scanning to please give us a hand in fixing this feature for good.

Since we only have access to a limited range of Macs for testing, we're asking for barcode scan images from those users who are having trouble with the feature so that we can use the scans for testing and improvements here.

We've stripped the code out of the Pedia programs to make it easier for testing: this application is just a barcode scanning program which will help you save images of the barcodes to your Desktop.

If you could be so kind and:

• run the BarcodeScannerZoom program
• hold a book/DVD/CD/game barcode up to your iSight and try to scan it
• when this doesn't work, press the Space bar, Enter or click on the window to save the image
• a window comes up where you have to enter the 13 digit UPC (it's important that you enter the
correct barcode for the entry because not only will this become the title of the image but we will also
use it to confirm a match during testing here)
• try scanning the next entry

• (If an entry scans easily, you'll hear the beep and the window closes. We are not interested in images of these scans since they're being handled by the current code. If you only get the scan with difficulty, do include an image of those barcodes.)

The saved images will automatically go into a folder on your Desktop called 'Barcode'. Inside that folder you'll find another one that gives us the type of computer you have, i.e. MacBookPro 5.1, and the type of iSight, i.e. 34005.

Ideally we'd like to get around 20-30 scans. Use whatever media you usually scan in your Pedia program but if you're scanning DVDs, for example, try throwing in a couple of books, CDs or game scans as well just to give us a comparison.

Do try scans at varying distances: close up where it will probably get too blurry to read for most iSights, further away where it becomes focused but some iSights cannot distinguish the lines anymore, right in the middle of the red square. Try to get us the best images you feel should scan.

Once you're done scanning, select the 'Barcodes' folder on your Desktop, choose 'Compress' from the File menu and email us that 'Barcode.zip' file. (You'll find our email here.)

Thank you very much for your help!

Download BarcodeScannerZoom program.
starwarsmags
Junior Member
Junior Member
Posts: 2
Joined: Sat Feb 05, 2011 10:07 am

Re: iSight scanning work

Post by starwarsmags »

Well, I don´t know about you guys, but my UPS / barcode numbers are just 12 digits long NOT 13 !!!!! :-(
I would love to help solving this problem, but this ´barcodescanner´ program seems to be of no help ....
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Re: iSight scanning work

Post by Nora »

12 digit UPCs can be padded with a leading zero to turn into 13 digits.
dvreid
Inductee
Inductee
Posts: 0
Joined: Mon Feb 07, 2011 9:58 am

Re: iSight scanning work

Post by dvreid »

The application does not work if you have two iSight cameras available (Display and MacBook). If you disconnect the USB from the display, then the MacBook iSight can be used. I have not had time to dig into the code to see if there is anyway to specify of choose a camera.

Doug
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Re: iSight scanning work

Post by Nora »

If the program detects more than one camera connected or available for scanning, it should automatically bring up a dialogue asking you to choose a camera. You can also force this dialogue to appear by holding down Ctrl and clicking on the 'iSight' button.
dvreid
Inductee
Inductee
Posts: 0
Joined: Mon Feb 07, 2011 9:58 am

Re: iSight scanning work

Post by dvreid »

Nora,

I had downloaded the source for the program the other day. There is some sort of issue in the selectAndOpenVideoDevice method for MyBarcodeScanner Object. In the selectAndOpenVideoDevice there is a NSRunAlertPanel for choosing one of three potential devices that used a NSLocalizedStringWithDefaultValue. The Code dies here on my 10.6.6 MacBook Pro. I removed the call and just used the string alone and it started to work. I can now choose between my built-in iSight and my Display iSight. Alas, the display iSight will not capture a barcode but the builtin one will. The product ID for my 24" LED Cinema Display is 34056 which is not singled out in the code.

Code Snippet I changed:

Original Code (Line 529 - 534 of MyBarCodeScanner.m)

// isConnected isInUseByAnotherApplication
NSInteger buttonPressed = NSRunAlertPanel(NSLocalizedStringWithDefaultValue(@"Action Required", nil, FRAMEWORK_BUNDLE, nil, nil),
NSLocalizedStringWithDefaultValue(@"Several video sources", nil, FRAMEWORK_BUNDLE, @"Several video sources have been found. Which one would you like to use?", nil),
firstDevice,
secondDevice,
thirdDevice);



New Code:
// isConnected isInUseByAnotherApplication
NSInteger buttonPressed = NSRunAlertPanel(@"Action Required",
@"Several video sources have been found. Which one would you like to use?",
firstDevice,
secondDevice,
thirdDevice);
User avatar
Conor
Top Dog
Posts: 5337
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: iSight scanning work

Post by Conor »

Thank you for that bug report on the barcode scanner project. The localization code from The Pedias forces it to stop early as it can't find the relevant files for localization. Changing the define to the value below would be the official fix, when I have time I will go through and add conditional build statements so that I can more easily share the code:

Code: Select all

#define FRAMEWORK_BUNDLE [NSBundle mainBundle]
Thank you as well for letting us know about the new model of camera. Try adding your model to the first part of the if branching for different cameras that does the following close up:

Code: Select all

displaySize = CGSizeMake(1280.0, 1024.0);
cropArea = CGRectMake(320.0, 544.0, 640.0, 480.0);
If the display camera is capable of high resolution capture of 1280.0 x 1024.0 then this will allow enough detail to capture the barcode at the longer focal length. Do let us know if your able to scan with the high resolution settings.
dvreid
Inductee
Inductee
Posts: 0
Joined: Mon Feb 07, 2011 9:58 am

Re: iSight scanning work

Post by dvreid »

Conor

Those 2 edits worked. I am not sure if the settings for the 24" Cinema Display are quite right because the video looked distorted when it came up.

Doug
User avatar
Conor
Top Dog
Posts: 5337
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: iSight scanning work

Post by Conor »

Try changing the display and crop to adjust for the camera settings. What it should be doing is capturing at twice the resolution (640 x 480 is the Apple default).

Code: Select all

displaySize = CGSizeMake(1280.0, 1024.0);
It should then displaying and process only the top middle 640x480 of that captured frame; 320 pixels in from the left and 544 pixel up from the bottom:

Code: Select all

cropArea = CGRectMake(320.0, 544.0, 640.0, 480.0);
Right under those two lines look at uncommenting and changing the following line that will tell it to actually force capture in 1280 x 1024.

Code: Select all

setSizeOfBuffer = YES;
The other high resolution cameras seem to squish the image horizontally when told to capture at exactly double the resolution, but capture at 1280 x 1024 when not explicitly told a size.

If it looks grainy then it means the camera is not capable of high resolution capture.
Post Reply