課程
/移動開發(fā)
/Android
/How-old 刷臉神器
這個問題我不太懂,求解答???
2015-11-18
源自:How-old 刷臉神器 2-7
正在回答
private?void?prepareRsBitmap(JSONObject?rs)?{ //?TODO?Auto-generated?method?stub try?{ JSONArray?faces?=?rs.getJSONArray("face"); /** ?*?找到多少張臉,并在mTip中顯示出來 ?*/ int?faceCount?=?faces.length(); mTipTextView.setText("find"?+?faceCount?+"faces"); /** ?*?循環(huán)得到每一張臉, ?*/ for(int?i?=?0?;i?<?faceCount;?i++){ /** ?*?getJSONObject()只能傳入String類型的參數(shù)?,無法傳入int類型的參數(shù) ?*/ JSONObject?face?=?faces.getJSONObject(i); /** ?*?拿到position屬性 ?*/ JSONObject?posObject?=?face.getJSONObject("position"); double?x?=?posObject.getJSONObject("center").getDouble("x"); double?y?=?posObject.getJSONObject("center").getDouble("y"); } }?catch?(JSONException?e)?{ //?TODO?Auto-generated?catch?block e.printStackTrace(); } }
我錯了 回頭百度了JSAON才發(fā)現(xiàn)得到臉的數(shù)目需要用到JSONArray()..而解析臉的內(nèi)部屬性的時候需要用到JSONObject()...................
舉報
通過第三方本課程教大家實現(xiàn)人臉識別,通過案例講解原理
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2015-11-18
我錯了 回頭百度了JSAON才發(fā)現(xiàn)得到臉的數(shù)目需要用到JSONArray()..而解析臉的內(nèi)部屬性的時候需要用到JSONObject()...................