将垫子转换为pvbuffer(来自pleora ebus sdk lib。)

发布于 2025-01-25 19:23:20 字数 1595 浏览 2 评论 0原文

预先感谢您阅读本文。

为了更好的可读性,我将列出信息。需要点形式。

  • 基于Pleora提供的基于EBUS播放器样本的应用程序。
  • 在50 fps中抓住16位灰色的图像。
  • 我的应用程序正在使用OpENCV处理openCV在DisplayThread中的OpENCV中
  • ,到目前为止,我已经成功处理了适合我需求的图像,并尝试将我的垫子(已经处理过的)数据转换回PVImage或PvBuffer st,图像可以显示在该图像中。 EBUS播放器使用已经存在的显示功能(这样,我仍然可以在播放器应用中使用其他功能,而无需对原始应用进行太多修改)。
  • 困难源于以下事实:显示功能和其他重要功能隐藏在DLL中。我只能对暴露的修改进行修改。
  • 处理过程基本上是:
void Display Thread::OnBufferDisplay(PvBuffer *aBuffer){
   aBuffer->Attach(imageMat.data, 614400);
   //where imageMat is init'd as
   //imageMat = cv::Mat(cv::Size(imgWidth, imgHeight), CV_16U);

   //process.. the data....

   //at this point, I Have my Mat object ready to go.

   //supposed to create or have another PvImage or PvBuffer with the processed datahere for displaying.
   
   //Display
   mDisplay->Display(*aBuffer);
}

  • 到目前为止,我尝试过的是:
memcpy(aBuffer->GetDataPointer(), imageMat.data 614400);

//and 

aBuffer->free();
//and/or
aBuffer->Detach();
//then
aBuffer->Alloc(614400); //since 640 * 480 in 16 bit gray
memcpy( Mat.data to buffer->datapointer);

请帮助我澄清以下内容:

  • 我在使用actact()后发现了,传递的abuffer确实不正确地显示图像。这是否意味着此函数不仅将数据从abuffer复制到imagemat.data。

  • 我去了attach(),因为memcpy(imagemat.data,abuffer-> getDatapinter(),size);不起作用。它没有像附加方式()一样正确复制数据。有人知道为什么吗?

  • pleora提供的附加描述是“将此pvbuffer附加到外部内存缓冲区。要使用内部内存缓冲区,请使用Alloc。”。

总而言之,

如何正确创建一个包含来自我的垫子对象的数据以传递到display()函数的pvimage或pvbuffer对象?

是否有任何绕道行动可以使这项工作无需创建此类对象?

thank you in advance for reading this.

For better readability I'll list pieces of info. necessary in point form.

  • building an app based on eBUS player sample provided by Pleora.
  • Grabbing images in 16 bit gray in 50 fps.
  • my app is processing image data using openCV within the OnBufferDisplay function in DisplayThread
  • so far, I have successfully processed images suiting my needs and am trying to convert my Mat(processed already) data back to PvImage or PvBuffer s.t. the image can be displayed in the eBUS Player using the already existing display function(this way I can still use other features in the Player app without having to make too many modifications to the original app).
  • The difficulty arises from the fact that display functions and other important functions are hidden in dlls. I can only make modifications to what's exposed.
  • The processing procedure is basically:
void Display Thread::OnBufferDisplay(PvBuffer *aBuffer){
   aBuffer->Attach(imageMat.data, 614400);
   //where imageMat is init'd as
   //imageMat = cv::Mat(cv::Size(imgWidth, imgHeight), CV_16U);

   //process.. the data....

   //at this point, I Have my Mat object ready to go.

   //supposed to create or have another PvImage or PvBuffer with the processed datahere for displaying.
   
   //Display
   mDisplay->Display(*aBuffer);
}

  • What I have tried so far is:
memcpy(aBuffer->GetDataPointer(), imageMat.data 614400);

//and 

aBuffer->free();
//and/or
aBuffer->Detach();
//then
aBuffer->Alloc(614400); //since 640 * 480 in 16 bit gray
memcpy( Mat.data to buffer->datapointer);

Please help me clarify the following:

  • I have discovered after using Attach(), the passed aBuffer does no longer properly display image. Does that mean this function not just copies the data from aBuffer to imageMat.data but erases the data in aBuffer and then copies it to imageMat.data?

  • I went for Attach() because memcpy(imageMat.data, aBuffer->GetDataPinter(), size); didn't work. It didn't copy the data properly like the way Attach() does. Anybody know why?

  • The description for Attach() provided by Pleora is "Attach this PvBuffer to an external memory buffer. To use an internal memory buffer, use Alloc.".

In summary,

How do you properly create a PvImage or a PvBuffer object that contains the data from my Mat object in order to pass to the Display() function?

Are there any detours to make this work without having to create such objects?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文