通过ICAMERA怎样获取图片的RGB?
请问怎样经过ICAMERA接口就能获取图片的RGB呢?
[解决办法]
ICAMERA_GetFrame可以拿到bitmap
后面的工作么你自己通过IBITMAP_GEtPixel应该就可以了e
[解决办法]
我确实用ICAMERA_GetFrame得到图片信息,但用IBITMAP_GEtPixel感觉太简单了。
还有IBITMAP_NativeToRGB 这些。
[解决办法]
还有在用ICAMERA时,能不能得到bmp格式?
因为拍下来后就是jpg了。好像只有bmp才能获取RGB之类的吧?
[解决办法]
可以工作
[解决办法]
我不能确定拿到的就是bitmap,因为看不到数据格式,我想先保存为bmp,请问怎样保存呢?谢谢了
[解决办法]
拿到的就是IBitmap的对象 你何必管他具体类型是不是bitmap呢? 当然实际也是bitmap
反正有接口 直接拿像素不就得了
[解决办法]
ICAMERA_GetFrame可以拿到的bitmap 不是图像数据。怎么办?
[解决办法]
ICAMERA_GetFrame 得到的数据想用IDIB转换数据,但不能创建IDIB接口。
如果用IDISPLAY_GetDeviceBitmap得到的位图就可以创建IDIB接口。但我不要IDISPLAY_GetDeviceBitmap。请问还有其他方法吗?
[解决办法]
可以将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格式的.