尝试使用Nvidia Jetson TK1(#R21(发行版),版本:3.0)操作Ximea MQ013CG-ON USB 3.0型相机。
当我尝试在OpenCV installation information中运行示例opencv_test.cpp代码时:
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
// A Simple Camera Capture Framework
int main()
{
CvCapture* capture = cvCaptureFromCAM( CV_CAP_XIAPI );
if ( !capture ) {
fprintf( stderr, "ERROR: capture is NULL \n" );
getchar();
return -1;
}
// Create a window in which the captured images will be presented
cvNamedWindow( "mywindow", CV_WINDOW_AUTOSIZE );
// Show the image captured from the camera in the window and repeat
while ( 1 ) {
// Get one frame
IplImage* frame = cvQueryFrame( capture );
if ( !frame ) {
fprintf( stderr, "ERROR: frame is null...\n" );
getchar();
break;
}
cvShowImage( "mywindow", frame );
// Do not release the frame!
//If ESC key pressed, Key=0x10001B under OpenCV 0.9.7(linux version),
//remove higher bits using AND operator
if ( (cvWaitKey(10) & 255) == 27 ) break;
}
// Release the capture device housekeeping
cvReleaseCapture( &capture );
cvDestroyWindow( "mywindow" );
return 0;
}
(通过):
g++ -I/usr/local/include/opencv opencv_test.cpp -lopencv_highgui
LD_LIBRARY_PATH=/usr/local/lib ./a.out
我收到以下错误消息:
xiAPI: XIMEA Camera API V4.05.65
xiAPI: Adding camera context: dwID=14510651 ptr=B2AE4000 processID=00005A09
xiAPI: Create handles 1 Process 00005A09
xiAPI: Enable sensor
xiAPI: ENABLE SENSOR
xiAPI: SetDataRate bandwidth 3180; real band 3180; Freq 62; XSM 0
xiAPI: Time needed to read BPL:83ms
xiAPI: ERROR: pixel -7x323 has no correction pixel!
xiAPI: ERROR: pixel -7x1018 has no correction pixel!
xiAPI: ERROR: 2 pixels in list without any correction!
xiAPI: Successfully parsed BPL file, 447 total corrected pixels
xiAPI: SetGPIO 1 set to 8
xiAPI: SetDataRate bandwidth 3180; real band 3180; Freq 62; XSM 0
xiAPI: ERROR: pixel -7x323 has no correction pixel!
xiAPI: ERROR: pixel -7x1018 has no correction pixel!
xiAPI: ERROR: 2 pixels in list without any correction!
xiAPI: SetGPIO 1 set to 0
xiAPI: AutoSetBandwidth measurement
xiAPI: CalculateResources : Context B2AE4000 ID 14510651 m_maxBytes=1024 m_maxBufferSize=1048576
xiAPI: Failed to change thread scheduler, check user limit for realtime priority.
xiAPI: AutoSetBandwidth measured 3083Mbps. Safe margin 10% will be used.
xiAPI: Current bandwidth limit auto-set to 2774 Mbps (min:408Mbps,max:3083Mbps)
xiAPI: SetDataRate bandwidth 2774; real band 2774; Freq 62; XSM 0
xiAPI: ERROR: pixel -7x323 has no correction pixel!
xiAPI: ERROR: pixel -7x1018 has no correction pixel!
xiAPI: ERROR: 2 pixels in list without any correction!
xiAPI: SetDataRate bandwidth 2774; real band 2774; Freq 62; XSM 0
xiAPI: ERROR: pixel -7x323 has no correction pixel!
xiAPI: ERROR: pixel -7x1018 has no correction pixel!
xiAPI: ERROR: 2 pixels in list without any correction!
xiAPI: DISABLE SENSOR
xiAPI: ENABLE SENSOR
xiAPI: SetDataRate bandwidth 2774; real band 2774; Freq 54; XSM 10
xiAPI: ERROR: pixel -7x323 has no correction pixel!
xiAPI: ERROR: pixel -7x1018 has no correction pixel!
xiAPI: ERROR: 2 pixels in list without any correction!
xiAPI: SetDataRate bandwidth 2774; real band 2774; Freq 54; XSM 10
xiAPI: ERROR: pixel -7x323 has no correction pixel!
xiAPI: ERROR: pixel -7x1018 has no correction pixel!
xiAPI: ERROR: 2 pixels in list without any correction!
xiAPI: CalculateResources : Context B2AE4000 ID 14510651 m_maxBytes=1024 m_maxBufferSize=1048576
xiAPI: StartVideoStream
xiAPI: Failed to change thread scheduler, check user limit for realtime priority.
xiAPI: WorkerThread is up
xiAPI: ERROR: pixel -7x323 has no correction pixel!
xiAPI: ERROR: pixel -7x1018 has no correction pixel!
xiAPI: ERROR: 2 pixels in list without any correction!
Aborted
我也尝试过xiAPI示例,然后根据光强度获得黑屏或白屏。可能是什么问题?谢谢。
更多信息:
根据说明安装了XIMEA Linux Software Package和OpenCV。使用s-link USB 4端口3.0集线器。
lsusb的输出:
Bus 002 Device 006: ID 20f7:3001
Bus 001 Device 006: ID 09da:000a A4 Tech Co., Ltd Optical Mouse Opto 510D
Bus 001 Device 005: ID 046e:52cc Behavior Tech. Computer Corp.
Bus 002 Device 002: ID 05e3:0612 Genesys Logic, Inc.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
usbview中的信息:
www.ximea.com
Manufacturer: XIMEA
Speed: unknown
USB Version: 3.00
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 9
Number of Configurations: 1
Vendor Id: 20f7
Product Id: 3001
Revision Number: 0.00
Config Number: 1
Number of Interfaces: 1
Attributes: 80
MaxPower Needed: 400mA
Interface Number: 0
Name: (none)
Alternate Number: 0
Class: ff(vend.)
Sub Class: 00
Protocol: 00
Number of Endpoints: 4
Endpoint Address: 81
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 1024
Interval: 0ms
Endpoint Address: 02
Direction: out
Attribute: 2
Type: Bulk
Max Packet Size: 1024
Interval: 0ms
Endpoint Address: 82
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 1024
Interval: 0ms
Endpoint Address: 83
Direction: in
Attribute: 2
Type: Bulk
Max Packet Size: 1024
Interval: 0ms
最佳答案
我不知道ximea和opencv如何一起使用。
我只使用ximea api,它可以工作。
您的问题“xiAPI:无法更改线程调度程序,请检查用户限制以获取实时优先级。”表示:您的流程无权设置调度策略/优先级。您可以通过以 super 用户身份运行进程来更改此设置。或者,您可以在文件的属性中进行设置(您需要具有root权限),e。 G。 Why does `sched_setscheduler()` require root priveledges?
setcap cap_sys_nice+ep ./your_program
我认为您还有其他问题,例如“错误:像素-7x323没有校正像素!” BPL文件存储在相机中。它定义了损坏的像素,应对其进行校正(不良像素校正)。在ximea api中,您可以关闭此更正,请参见ximea: Sensor Defects Correction parameters。
关于c++ - xiAPI:无法更改线程调度程序,请检查用户限制以获取实时优先级,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33718565/