通过ICAMERA怎样获取图片的RGB?

tober 2009-07-08 09:48:05
请问怎样经过ICAMERA接口就能获取图片的RGB呢?
...全文
1711 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
jingoro 2010-04-14
  • 打赏
  • 举报
回复
可以将ICAMERA_GetFrame得到的IBitmap指针转换成 FrameBitmap类型,
typedef struct FrameBitmap
{
IDIB dib;

int32 nRefs;
camera_frame_type rawFrame;
} FrameBitmap;

成员rawFrame类型如下:
typedef struct
{
/* Format of the frame */
camera_format_type format;
/* For pre-V7, Width and height of the picture.
* For V7:
* Snapshot: thumbnail dimension
* Raw Snapshot: not applicable
* Preview: not applicable
*/
uint16 dx;
uint16 dy;
/* For pre_V7: For BAYER format, RAW data before scaling.
* For V7:
* Snapshot: Main image dimension
* Raw snapshot: raw image dimension
* Preview: preview image dimension
*/
uint16 captured_dx;
uint16 captured_dy;
/* it indicates the degree of clockwise rotation that should be
* applied to obtain the exact view of the captured image. */
uint16 rotation;
#ifdef FEATURE_CAMERA_V7
/* Preview: not applicable
* Raw shapshot: not applicable
* Snapshot: thumbnail image buffer
*/
uint8 *thumbnail_image;
#endif /* FEATURE_CAMERA_V7 */
/* For pre-V7:
* Image buffer ptr
* For V7:
* Preview: preview image buffer ptr
* Raw snapshot: Raw image buffer ptr
* Shapshot: Main image buffer ptr
*/
byte * buffer;
#ifdef FEATURE_FTM_CAMCORDER_RECORDING
#error code not present
#endif /*FEATURE_FTM_CAMCORDER_RECORDING*/
} camera_frame_type;

其中的byte* buffer就是驱动传上来的原始数据了,一般是yuv422格式的,可以参考yuv转rgb的方法将其转换成bmp格式的.
tober 2009-07-09
  • 打赏
  • 举报
回复
ICAMERA_GetFrame 得到的数据想用IDIB转换数据,但不能创建IDIB接口。

如果用IDISPLAY_GetDeviceBitmap得到的位图就可以创建IDIB接口。但我不要IDISPLAY_GetDeviceBitmap。请问还有其他方法吗?
tober 2009-07-08
  • 打赏
  • 举报
回复
还有在用ICAMERA时,能不能得到bmp格式?

因为拍下来后就是jpg了。好像只有bmp才能获取RGB之类的吧?
tober 2009-07-08
  • 打赏
  • 举报
回复
我确实用ICAMERA_GetFrame得到图片信息,但用IBITMAP_GEtPixel感觉太简单了。

还有IBITMAP_NativeToRGB 这些。
hhygcy 2009-07-08
  • 打赏
  • 举报
回复
ICAMERA_GetFrame可以拿到bitmap
后面的工作么你自己通过IBITMAP_GEtPixel应该就可以了e
tober 2009-07-08
  • 打赏
  • 举报
回复
ICAMERA_GetFrame可以拿到的bitmap 不是图像数据。怎么办?
hhygcy 2009-07-08
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 tober 的回复:]
引用 1 楼 hhygcy 的回复:
ICAMERA_GetFrame可以拿到bitmap
后面的工作么你自己通过IBITMAP_GEtPixel应该就可以了e


我不能确定拿到的就是bitmap,因为看不到数据格式,我想先保存为bmp,请问怎样保存呢?谢谢了
[/Quote]
拿到的就是IBitmap的对象 你何必管他具体类型是不是bitmap呢? 当然实际也是bitmap
反正有接口 直接拿像素不就得了
tober 2009-07-08
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hhygcy 的回复:]
ICAMERA_GetFrame可以拿到bitmap
后面的工作么你自己通过IBITMAP_GEtPixel应该就可以了e
[/Quote]

我不能确定拿到的就是bitmap,因为看不到数据格式,我想先保存为bmp,请问怎样保存呢?谢谢了
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hhygcy 的回复:]
ICAMERA_GetFrame可以拿到bitmap
后面的工作么你自己通过IBITMAP_GEtPixel应该就可以了e
[/Quote]
可以工作

2,854

社区成员

发帖
与我相关
我的任务
社区描述
本论坛以AI、WoS 、XR、IoT、Auto、生成式AI等核心板块组成,为开发者提供便捷及高效的学习和交流平台。 高通开发者专区主页:https://qualcomm.csdn.net/
人工智能物联网机器学习 技术论坛(原bbs) 北京·东城区
社区管理员
  • csdnsqst0050
  • chipseeker
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧