1.飞思卡尔的IMX6Q芯片好用吗?有核心板+底板的吗?
2.UVC Camera使ç¨ç®åè®°å½
飞思卡尔的IMX6Q芯片好用吗?有核心板+底板的吗?
飞思卡尔的IMX6Q不错,4核运算,最高主频可达1.2Hz,dw爱心代码源码而且支持高清视频(有高清端口,LCD、论文源码开源LVDS、付费浏览源码VGA、HDMI)。虽然说国外的一些开发板都是单板结构,但是国内也有一些不错的厂商开发的核心板+底板的开发平台。这里,推荐天嵌科技的TQIMX6Q_BASEC开发板,比较高的种草商城源码性价比。
UVC Camera使ç¨ç®åè®°å½
ç¨åºæ¯æ ¹æ® UVCCamera å»ä¿®æ¹çã
使ç¨è¿ç¨ä¸éå°çå ç¹å ³é®é®é¢ï¼
1.YUV æ ¼å¼ï¼NVçæ ¼å¼ã
2.YUV转RGBæçé®é¢ã
3.Bitmapå åæ³æ¼é®é¢ã
4.Handlerå åæ³æ¼çé®é¢
é¦å onFrame(è¿æ¯cameraåå¾çcallBackå½æ°ï¼byte[] dataå°±æ¯cameraçæ°æ®)ä¸ä¸è½åèæ¶æä½ï¼ä¾å¦å°data转bitmapçæä½ï¼ï¼ä¸ç¶ä¼é»å¡ï¼ä¹åæè¿ä¸ªæä½æ¾å°è¿éç¶åç´æ¥å°bitmapä¼ åºï¼å¯¼è´å¡é¡¿ã
å¨ä¼ è¾byte[]æ°æ®ä¹åï¼éè¦å°byte[]转bitmapã
å¨byte[] 转bitmapçè¿ç¨ä¸ï¼ç±äºå建äºè¿å¤çBitmapï¼ä¼å¯¼è´å åæ³æ¼ï¼ç¨åºå´©æºã
å æ¤1.å°Bitmap设置为éæåéï¼é¿å éå¤å建çé®é¢ã2.ä¿®æ¹byte[] 转bitmapçå½æ°ï¼åæ¥å½æ°æ¯è¿åBitmapï¼ç°å¨æ¯å°Bitmapä½ä¸ºåæ°ä¼ å ¥å½æ°ä¸ï¼ç´æ¥å°Bitmapæ°æ®ä¼ éåºå»ãåå°äºä¸ä¸ªè¿åçæ¥éª¤ã
ä¹åæ¯è¿æ ·çï¼
ç°å¨æ¯è¿æ ·çï¼
åé¢å°±æ¯éè¿handleImageå°Bitmapæ¾ç¤ºå¨ImageViewä¸ã
NV转bitmapçé®é¢ã
æçç¨åºåºæ¬æ¯æ ¹æ® UVCCamera å»ä¿®æ¹çï¼UVCCameraä¸æ²¡æåæ¯ä¸å¸§ï¼ä½æ¯çææ¥å£ï¼æè¿é设å®æ¯ä¸å¸§çæ°æ®ä¸ºNVæ ¼å¼ã
并ä¸å¨onFrameä¸ååºçdataæ ¼å¼æ¯NVï¼NVæ¯YUVä¸çä¸ä¸ªï¼YUVæå¾å¤æ ¼å¼ï¼ï¼å æ¤å¨è½¬æbitmapçæ¶åï¼éè¦æ ¹æ®å ¬å¼å»è½¬åãç¨ç³»ç»èªå¸¦çRenderScriptå»è½¬æ¢ï¼åç°å¾çè½ç¶æ¸ æ°ä½æ¯é¢è²ä¸å¯¹ã
æ¥æ¾yuv转bitmapå½æ°ï¼æ¾å°çæ¯è¿ä¸ªãä¾æ§æ¯è½¬åºæ¥çå¾çï¼é常ææ¾ï¼æåå¾æ¸ æ°ï¼ä½æ¯å°±æ¯é¢è²ä¸å¯¹ã
å æ¤å¯¹å½æ°è¿è¡äºä¿®æ¹ãä¿®æ¹åå¦ä¸æ示ã
ç±äºå¯¹YUVä¸RGBè¿ä¸ªæ¦å¿µæ¨¡ç³ä¸æ¸ ï¼èæç´¢å¾å°çYUV转bitmapå½æ°æ¯è½ç¶çç¡®æ¯NV转bitmapï¼ä½è½¬æ¢åæè²å·®ãåä¿®æ¹rgba[]çèµå¼é¡ºåºåï¼é¢è²ææ£å¸¸ãå ¶å®å°±æ¯å¨ç±YUVç¼ç 转RGBç¼ç çè¿ç¨ä¸ï¼æ°æ®ä¼ éåºç°é®é¢æ导è´è²å½©å¼å¸¸ï¼è¿ç§æ åµå°±éè¦ä¸æ¥æ¥åæYUVå°RGBçæ°æ®è½¬æ¢ä¸åªéåºç°äºé®é¢ãä¹åæ¯åå¨ä¸ºABGRï¼åé¢ææ¯åå¨ä¸ºARGBã
å ·ä½åæå¯ä»¥çè¿ç¯ï¼
RGBåYUVç®åå¦ä¹ è®°å½
ä½æ¯ä¸é¢è¿ç§æ¹å¼å®é 使ç¨ä¸åç°æçè¿ä½ãå æ¤éè¦ä½¿ç¨soçæ¹å¼å»è½¬æ¢ã
å ·ä½åèé¾æ¥ï¼
libyuvâlibyuvæµè¯ä½¿ç¨ARGBToIåConvertToARGBæ¥å£
_example_libyuv_Test_convertToArgbå½æ°ä¸çFOURCC_IYUVæ¹ä¸ºFOURCC_NVã
Handleå åæ³æ¼çé®é¢ã
ä¹åå 为æ³å·ææ以没æå¤çAndroid studioå ³äºHandleå åæ³æ¼çæ示ãç¶å让ç¨åºè·äºä¸å¤©æç¶å´©äºã
ä¹åæ¯å¦ä¸æ示ï¼è¿ç§åæ³Android Studioä¼æç¤ºä½ è¿æ¯æé£é©çã
ç°å¨æ¹æå¦ä¸æ示
å ¶å®è¿å¯éè¿å¨activityçdestroyä¸è°ç¨ handler.removeCallbacksAndMessages(null) ï¼æ¥è¾¾å°é¿å å åæ³æ¼çç®ç,android ç³»ç»æºç ä¸ä¹åºæ¬æ¯ä½¿ç¨è¿ä¸ªæ¹æ³ã
åè®°ï¼è¿ç¯æç« å§äºå¹´ï¼å½æ¶æ¯ç¨äºåç®USBæå头ä¸ï¼æè¿å¨æ´çä¸è¥¿æ以å®åäºä¸ä¸ã
åèé¾æ¥ï¼
Android yuv转æ¢æbitmap
å¾æ详解YUVæ°æ®æ ¼å¼
Androidä¸çYUVæ ¼å¼è§£æ
Nv转Bitmapï¼é«æç转åï¼
Android ä¹ Bitmap
Android解æä¹Handler为ä»ä¹éè¦æ¯staticç
2024-11-29 19:45
2024-11-29 19:44
2024-11-29 18:03
2024-11-29 17:40
2024-11-29 17:04
2024-11-29 17:03