Toybrick

mipi 接口的imx258镜头 图像偏绿

cr7jj

中级会员

积分
456
发表于 2019-12-30 16:10:17    查看: 7380|回复: 8 | [复制链接]    打印 | 显示全部楼层
可以打开摄像头,但是图像偏绿,根据教程调用isp库,编译通过,但运行程序会出现以下错误,希望各位大神能帮忙解决以下
错误:

CAMHALInfo:   CAMHALVERSION is: 2.0.8.0

CAMHALError:  ERR(getSensorModeData): RK_VIDIOC_SENSOR_MODE_DATA failed, err: Invalid argument

CAMHALInfo:   CAMIAVERSION is: 2.0.9.0

CAMHALInfo:   init:tuningFile /etc/cam_iq_imx258.xml
CAMHALInfo:   load tunning file success.
AWB: AwbConfigure: AWB_VERSION_10

AWB: AwbPrepareCalibDbAccess: resolution (0x1@-2147045536) not found in database

CAMHALError:  initDynamic:awb config failure!
CAMHALError:  cam_ia10_isp_dpcc_config: resolution (0x0) not found in database

CAMHALError:  runManISP:config DPCC failed !
CAMHALError:  cam_ia10_isp_bls_config: resolution (0x0) not found in database

CAMHALError:  runManISP:config BLS failed !
CAMHALInfo:   (null): resolution (0x-2147048936) not found in database

CAMHALInfo:   fail to get no FilterProfile, ret: 13
CAMHALError:  runManISP:config FLT failed !


代码:
int main(int argc,char *argv[])
{
    cout << "Built with OpenCV " << CV_VERSION << endl;

    void *g_engine = NULL;
    int vidFd = 0;
    vidFd = open("/dev/video0", O_RDWR);
    if(vidFd < 0)
    {
        printf("open video failed!\n");
        return -1;
    }
    const char *ispNode = "/dev/video1";
    const char* tuningFile = "/etc/cam_iq_imx258.xml";
   // int ret = 0;
    rkisp_start(g_engine, vidFd, ispNode,tuningFile);


    VideoCapture capture(0);    // 打开摄像头
    if(!capture.isOpened())    // 判断是否打开成功
    {
        cout << "open camera failed. " << endl;
        return -1;
    }

    while(true)
    {
        Mat frame;
        capture >> frame;    // 读取图像帧至frame
        if(!frame.empty())    // 判断是否为空
        {
            imshow("camera", frame);
        }

        if(waitKey(30) > 0)        // delay 30 ms等待按键
        {
            break;
        }
    }
    close(vidFd);
     rkisp_stop(g_engine);
    return 0;
}

回复

使用道具 举报

troy

版主

积分
2346
发表于 2019-12-30 16:45:49 | 显示全部楼层
vidFd不要用0节点,用2节点,下面opencv也是一样试试
回复

使用道具 举报

cr7jj

中级会员

积分
456
 楼主| 发表于 2019-12-31 09:51:46 | 显示全部楼层
troy 发表于 2019-12-30 16:45
vidFd不要用0节点,用2节点,下面opencv也是一样试试

你好,我都试过了,也是出现同样的问题,我单独调用isp库就出现这样的错误,opencv没问题的,难道是turning file出错吗,我直接sudo dnf install librockchip_isp,自动生成turning file的
回复

使用道具 举报

troy

版主

积分
2346
发表于 2020-1-3 08:44:15 | 显示全部楼层
cr7jj 发表于 2019-12-31 09:51
你好,我都试过了,也是出现同样的问题,我单独调用isp库就出现这样的错误,opencv没问题的,难道是turni ...

我们之前是有测试过的,可以参考下这份代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

cr7jj

中级会员

积分
456
 楼主| 发表于 2020-1-3 14:54:31 | 显示全部楼层
troy 发表于 2020-1-3 08:44
我们之前是有测试过的,可以参考下这份代码

你好,我用了你发的代码,还是会出现这样的错误。是因为isp节点没配置好吗?
针对imx258 配置isp节点怎么配置呢?
回复

使用道具 举报

cr7jj

中级会员

积分
456
 楼主| 发表于 2020-1-3 15:04:20 | 显示全部楼层
cr7jj 发表于 2020-1-3 14:54
你好,我用了你发的代码,还是会出现这样的错误。是因为isp节点没配置好吗?
针对imx258 配置isp节点怎么 ...

[root@toybrick rockchip_isp]# ./example
width = 640, height = 480, rotate = 0, vflip = 0, hflip = 0, crop = [0, 0, 0, 0]
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
CAMHALInfo:   CAMHALVERSION is: 2.0.8.0

CAMHALError:  ERR(getSensorModeData): RK_VIDIOC_SENSOR_MODE_DATA failed, err: Invalid argument

CAMHALInfo:   CAMIAVERSION is: 2.0.9.0

CAMHALInfo:   init:tuningFile /etc/cam_iq_imx258.xml
CAMHALInfo:   load tunning file success.
AWB: AwbConfigure: AWB_VERSION_10

AWB: AwbPrepareCalibDbAccess: resolution (0x1024@-1890082976) not found in database

CAMHALError:  initDynamic:awb config failure!
CAMHALError:  cam_ia10_isp_dpcc_config: resolution (0x0) not found in database

CAMHALError:  runManISP:config DPCC failed !
CAMHALError:  cam_ia10_isp_bls_config: resolution (0x0) not found in database

CAMHALError:  runManISP:config BLS failed !
CAMHALInfo:   (null): resolution (0x-1890086376) not found in database

CAMHALInfo:   fail to get no FilterProfile, ret: 13
CAMHALError:  runManISP:config FLT failed !
Segmentation fault (core dumped)
[root@toybrick rockchip_isp]#
回复

使用道具 举报

cr7jj

中级会员

积分
456
 楼主| 发表于 2020-1-6 10:08:45 | 显示全部楼层
troy 发表于 2020-1-3 08:44
我们之前是有测试过的,可以参考下这份代码

@troy 麻烦解决一下
回复

使用道具 举报

appleUncle

中级会员

积分
440
发表于 2020-5-11 11:20:45 | 显示全部楼层
本帖最后由 appleUncle 于 2020-5-23 16:02 编辑

在debian10上面ISP都有这个问题,请问解决了吗
回复

使用道具 举报

appleUncle

中级会员

积分
440
发表于 2020-5-23 10:12:48 | 显示全部楼层
本帖最后由 appleUncle 于 2020-5-28 10:16 编辑


图像为什么偏绿的原因,左边是没有tuning出来的图片,右边是tuning之后的图片

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表