[问题一]
使用dvsdk_2_00_00_22中dvsdk_demos_2_00_00_07/dm6446/encodedecode的code做修改,下列是打算用inPtr取frame
但得到结果
根据公式
由某一组得到的(U,Y1,V,Y2)=(-128,1,127,1)算出对应的
pixel1的RGB为(145.7584,-22.221,-259.11)
pixel2的RGB为(145.7584,-22.221,-259.11)
很明显的我是取错值了

但关于color space的问题,我已经得知系统color space为UYVY,并于DMAI文件中有其更详细的色彩空间说明,我去查了一下得知以下讯息:
而又在网络上search有关 V4L2_PIX_FMT_UYVY in v4l2的信息 如下(来源: v4l2spec.bytesex.org/.../r4484.htm)
V4L2_PIX_FMT_UYVY ('UYVY')
Name
V4L2_PIX_FMT_UYVY -- Variation of V4L2_PIX_FMT_YUYV with different order of samples in memory
Description
In this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component.
Example 2-1. V4L2_PIX_FMT_UYVY 4 × 4 pixel image
Byte Order.
Each cell is one byte.
start + 0: Cb00 Y'00 Cr00 Y'01 Cb01 Y'02 Cr01 Y'03
start + 8: Cb10 Y'10 Cr10 Y'11 Cb11 Y'12 Cr11 Y'13
start + 16: Cb20 Y'20 Cr20 Y'21 Cb21 Y'22 Cr21 Y'23
start + 24: Cb30 Y'30 Cr30 Y'31 Cb31 Y'32 Cr31 Y'33
Color Sample Location.
0 1 2 3
0 Y C Y Y C Y
1 Y C Y Y C Y
2 Y C Y Y C Y
3 Y C Y Y C Y
在以上 Byte Order中其YUV值的排列是和YUV422类似,但我不懂其下标的意义,还烦请前辈们给予协助,谢谢!
至于Color Sample Location,我推测其应该是表示每两个pixel拥有共同的Cb Cr值,
根据资料得知,若Cb和Cr的值皆为0,只剩下Y的值,则display出应该为灰阶的图像,故我修改取frame的code为
然而显示出来的结果,并非如此
在正常(未改code)状况下 ./encodedecode
在改code的状况下却失败,出现全绿的状况(波是因为相机和monitor波的问题)
,但由红色圈出部分,仍可以看出是和上图中照同样的物体
故我仍不知道code是哪里写错!若有观念问题错误还烦请指教。
[问题二]
在正常状况下(未改code),摄影机拍摄过程中,monitor有时会显示出彩色,有时会显示灰阶,我认为是摄影端的问题,但想不透是为什么?(附加影片P2030183.avi档为实际状况--->http://youtu.be/KcxBOcrCOFs)
感谢前辈们给予建议与解答!!再次有劳您们了!!