尝试使用Nvidia Jetson TK1(#R21(发布),REVISION: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
答案 0 :(得分:1)
我不知道,ximea和opencv如何一起去。
我只使用ximea api并且有效。
您的问题&#34; xiAPI:无法更改线程调度程序,请检查实时优先级的用户限制。&#34;表示:您的进程无权设置调度策略/优先级。您可以通过以root身份运行该过程来更改此设置。或者您可以在文件的属性中设置它(您需要root权限),例如: G。 Why does `sched_setscheduler()` require root priveledges?
setcap cap_sys_nice+ep ./your_program
我认为你的其他问题如&#34;错误:像素-7x323没有校正像素!&#34;将BPL文件存储在相机中。它定义了应该校正的损坏像素(坏像素校正)。在ximea api中,您可以关闭此修正,请参阅ximea: Sensor Defects Correction parameters。