gdkpixbuff问题

时间:2017-09-08 11:27:57

标签: embedded-linux yocto gdk gdkpixbuf

我正在使用Yocto处理iMX6,我正在尝试使用Gstreamer插件:gdkpixbufoverlay在我的主板上,但我收到以下错误:

JNIEXPORT void JNICALL Java_com_idesign_opencvmaketest_MainActivity_train
        (JNIEnv *env, jobject thisObj, jlong images, jlong labels) {

Mat& matImage  = *(Mat*)images; //to create one Mat image, you need an array of Mat
Mat& matLabels = *(Mat*)labels; // create a Mat from labels

/*
To pass correct parameters, you would do:

std::vector<cv::Mat> vecImages;
vecImages.push_back(matImage);

std::vector<int> vecLabels;
//put your labels to vecLabels here

model->train(vecImages,vecLabels);
*/

Ptr<LBPHFaceRecognizer> model = LBPHFaceRecognizer::create();

/** make a call to 
*   CV_WRAP virtual void train(InputArrayOfArrays src, InputArray labels) = 0;
**/
model->train(matImages, matLabels); // function requires ArrayofMats and ArrayofInts
}

所以我试着运行建议的命令,但我也没有工作。我看了一下输出:

gst-launch-1.0 autovideosrc ! gdkpixbufoverlay location=image.png ! autovideosink

(gst-launch-1.0:441): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file '/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstGdkPixbufOverlay:gdkpixbufoverlay0: Could not load overlay image.
Additional debug info:
../../../gst-plugins-good-1.6.3/ext/gdk_pixbuf/gstgdkpixbufoverlay.c(508): gst_gdk_pixbuf_overlay_start (): /GstPipeline:pipeline0/GstGdkPixbufOverlay:gdkpixbufoverlay0:
Couldn't recognize the image file format for file 'image.png'
Setting pipeline to NULL ...
Freeing pipeline ...

输出中充满了评论。我认为我的电路板上有问题,但我找不到。

我是否需要一些其他软件包来使gdkpixbuf工作? 我在Poky分布上测试了krogoth和pyro分支,结果是一样的。

1 个答案:

答案 0 :(得分:1)

将必要的包和子包名称添加到您的食谱( image-YOUR_RECIPE_NAME.bb 文件)作为行。 在我的情况下,包被拆分,所以为了使用PNG和JPEG图像叠加,我的配方如下所示:

...
gdk-pixbuf \
gdk-pixbuf-loader-png \
gdk-pixbuf-loader-jpeg \
...

保存更改后,不要忘记咬它:

bitbake image-YOUR_RECIPE_NAME