views:

266

answers:

3

I am using Matlab to operate a camera. It is an IDT SharpVision camera, and I am using the Matlab interface provided by the company. When I try to acquire an image, I get a segmentation fault. I have tried preallocating memory by creating an empty array for the image, but this does not work.

This is the line of code that causes the seg fault:

[nResult, x] = sharpML('IdtSvAcquire',cameraId);

sharpML.dll includes a MEX file for controlling the camera.

Here is a selection from the error message stack trace:
[0] QCamChildDriver.dll:0x160fdde4(0x0f99ef08, 15, 0x00ced938, 0x00ced938)
[1] QCamDriver.dll:0x0f9c1dd8(4146, 0x00ced938, 0x00ced924, 0x11283430)
[2] sharpML.dll:0x0f991d8c(2, 0x00cedf88, 2, 0x00cedfe8)
[3] sharpML.dll:0x0f991448(2, 0x00cedf88, 2, 0x00cedfe8)
...
[35] MATLAB.exe:0x00403bd2(1109972, 0, 0x7ffd9000, 0x805512fa)
[36] kernel32.dll:0x7c817077(0x00403daf, 0, 0x78746341, 32)

Any suggestions? The company that makes the camera has since gone out of business.

~ Adam

+1  A: 

This sounds like a driver issue since the fault is occurring here:

QCamChildDriver.dll:0x160fdde4(0x0f99ef08, 15, 0x00ced938, 0x00ced938)

One possible issue - the driver might be in conflict with your OS, especially if you are running Vista or any 64 bit OS.

If it is a driver issue, you might be able to find updated drivers somewhere on line, even if the company is gone.

Other than that you might be up a creek, unless you can find the C-source for scratchML and/or the driver.

Pete
A: 

If your camera uses firewire, you could try to use this tool.

+1  A: 

Problem solved:

I reinstalled the camera software and relevant QCam drivers, along with cleaning up a few other bugs.

Adam