Added some paramter to set exposure, adaptable packet size
This commit is contained in:
parent
2d0b20df9e
commit
2dcad1eb81
@ -185,7 +185,7 @@ bool CvCaptureCAM_PvAPI::open( int index )
|
|||||||
PvAttrUint32Get(Camera.Handle, "Height", &frameHeight);
|
PvAttrUint32Get(Camera.Handle, "Height", &frameHeight);
|
||||||
PvAttrEnumGet(Camera.Handle, "PixelFormat", pixelFormat,256,NULL);
|
PvAttrEnumGet(Camera.Handle, "PixelFormat", pixelFormat,256,NULL);
|
||||||
maxSize = 8228;
|
maxSize = 8228;
|
||||||
PvAttrUint32Get(Camera.Handle,"PacketSize",&maxSize);
|
//PvAttrUint32Get(Camera.Handle,"PacketSize",&maxSize);
|
||||||
if (PvCaptureAdjustPacketSize(Camera.Handle,maxSize)!=ePvErrSuccess)
|
if (PvCaptureAdjustPacketSize(Camera.Handle,maxSize)!=ePvErrSuccess)
|
||||||
return false;
|
return false;
|
||||||
//printf ("Pixel Format %s %d %d\n ", pixelFormat,frameWidth,frameHeight);
|
//printf ("Pixel Format %s %d %d\n ", pixelFormat,frameWidth,frameHeight);
|
||||||
@ -272,6 +272,9 @@ double CvCaptureCAM_PvAPI::getProperty( int property_id )
|
|||||||
case CV_CAP_PROP_FRAME_HEIGHT:
|
case CV_CAP_PROP_FRAME_HEIGHT:
|
||||||
PvAttrUint32Get(Camera.Handle, "Height", &nTemp);
|
PvAttrUint32Get(Camera.Handle, "Height", &nTemp);
|
||||||
return (double)nTemp;
|
return (double)nTemp;
|
||||||
|
case CV_CAP_PROP_EXPOSURE:
|
||||||
|
PvAttrUint32Get(Camera.Handle,"ExposureValue",&nTemp);
|
||||||
|
return (double)nTemp;
|
||||||
}
|
}
|
||||||
return -1.0;
|
return -1.0;
|
||||||
}
|
}
|
||||||
@ -289,14 +292,23 @@ bool CvCaptureCAM_PvAPI::setProperty( int property_id, double value )
|
|||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
case CV_CAP_PROP_MONOCROME:
|
case CV_CAP_PROP_MONOCROME:
|
||||||
|
if (value==1) {
|
||||||
char pixelFormat[256];
|
char pixelFormat[256];
|
||||||
PvAttrEnumGet(Camera.Handle, "PixelFormat", pixelFormat,256,NULL);
|
PvAttrEnumGet(Camera.Handle, "PixelFormat", pixelFormat,256,NULL);
|
||||||
if ((strncmp(pixelFormat, "Mono8",NULL)==0) || strncmp(pixelFormat, "Mono16",NULL)==0) {
|
if ((strncmp(pixelFormat, "Mono8",NULL)==0) || strncmp(pixelFormat, "Mono16",NULL)==0) {
|
||||||
monocrome=true;
|
monocrome=true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
monocrome=false;
|
||||||
|
break;
|
||||||
|
case CV_CAP_PROP_EXPOSURE:
|
||||||
|
if (PvAttrUint32Set(Camera.Handle,"ExposureValue",(tPvUint32)value)==ePvErrSuccess)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user