Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
avmIntergration
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马乐
avmIntergration
Commits
bde90caf
Commit
bde90caf
authored
Oct 19, 2023
by
马乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整图片大小
parent
41e46616
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
36 deletions
+35
-36
MainActivity.kt
app/src/main/java/com/intergration/avm/MainActivity.kt
+0
-0
avm.kt
app/src/main/java/com/intergration/avm/avm.kt
+27
-25
MyGLRenderer.kt
.../main/java/com/intergration/avm/glsurface/MyGLRenderer.kt
+1
-2
MyGLSurfaceView.kt
...in/java/com/intergration/avm/glsurface/MyGLSurfaceView.kt
+1
-1
AuxiliaryScreenPresentation.kt
...ergration/avm/presentation/AuxiliaryScreenPresentation.kt
+2
-4
Utils.kt
app/src/main/java/com/intergration/avm/utils/Utils.kt
+3
-3
layout_presentation.xml
app/src/main/res/layout/layout_presentation.xml
+1
-1
No files found.
app/src/main/java/com/intergration/avm/MainActivity.kt
View file @
bde90caf
This diff is collapsed.
Click to expand it.
app/src/main/java/com/intergration/avm/avm.kt
View file @
bde90caf
...
...
@@ -99,19 +99,19 @@ fun ArcVisDriveAVMEngine.initializeAvmParams(calibResultPath:File,lookupPath:Fil
avmInitInfo
.
avmIntrinsicParamArray
=
intrinsicArray
val
calibInfo
=
ArcAVMCalibInfo
()
calibInfo
.
avm2DImageWidth
=
IMAGE_
WIDTH
calibInfo
.
avm2DImageHeight
=
IMAGE_
HEIGHT
calibInfo
.
singleImageWidth
=
480
calibInfo
.
singleImageHeight
=
456
calibInfo
.
avm2DImageWidth
=
IMAGE_
HEIGHT
calibInfo
.
avm2DImageHeight
=
IMAGE_
WIDTH
calibInfo
.
singleImageWidth
=
IMAGE_WIDTH
calibInfo
.
singleImageHeight
=
IMAGE_HEIGHT
val
carInfo
=
ArcAVMCarInfo
()
carInfo
.
width
=
250
0
carInfo
.
length
=
60
00
carInfo
.
width
=
59
0
carInfo
.
length
=
18
00
carInfo
.
blinkAreaFront
=
0
carInfo
.
blinkAreaRight
=
0
carInfo
.
blinkAreaBack
=
0
carInfo
.
blinkAreaLeft
=
0
calibInfo
.
avmCarInfo
=
carInfo
calibInfo
.
viewPortType
=
ArcAVMViewPortType
.
LARGE
.
value
calibInfo
.
viewPortType
=
ArcAVMViewPortType
.
SMALL
.
value
avmInitInfo
.
avmCalibInfo
=
calibInfo
if
(
spUtils
.
getBoolean
(
CALIB_RESULT
))
{
val
avmCalibResult
=
ArcAVMCalibResult
()
...
...
@@ -130,13 +130,13 @@ fun ArcVisDriveAVMEngine.initializeAvmParams(calibResultPath:File,lookupPath:Fil
return
init
(
avmInitInfo
)
}
fun
ArcVisDriveAVMEngine
.
autoCalib
(
calibResultPath
:
File
,
lookupPath
:
File
){
fun
ArcVisDriveAVMEngine
.
autoCalib
(
calibResultPath
:
File
,
lookupPath
:
File
)
:
Int
{
val
clothInfo
=
ArcAVMClothInfo
()
clothInfo
.
d1
=
60
0
clothInfo
.
d3
=
500
0
clothInfo
.
d4
=
490
0
clothInfo
.
d5
=
500
0
clothInfo
.
d6
=
400
0
clothInfo
.
d1
=
12
0
clothInfo
.
d3
=
69
0
clothInfo
.
d4
=
69
0
clothInfo
.
d5
=
69
0
clothInfo
.
d6
=
69
0
val
chessInfoFront
=
ArcAVMChessInfo
(
ArcAVMCameraPosType
.
TYPE_FRONT
)
val
chessInfoRight
=
ArcAVMChessInfo
(
ArcAVMCameraPosType
.
TYPE_RIGHT
)
val
chessInfoBack
=
ArcAVMChessInfo
(
ArcAVMCameraPosType
.
TYPE_BACK
)
...
...
@@ -144,36 +144,38 @@ fun ArcVisDriveAVMEngine.autoCalib(calibResultPath:File,lookupPath:File){
val
chessInfoList
=
arrayListOf
(
chessInfoFront
,
chessInfoRight
,
chessInfoBack
,
chessInfoLeft
)
val
calibResult
=
ArcAVMCalibResult
()
val
lookupTable
=
ArcAVMLookupTable
()
var
result
=
autoCalibrate
(
avmInputImages
,
clothInfo
,
chessInfoList
,
calibResult
,
lookupTable
)
LogUtils
.
i
(
"autoCalibrate:${result}
"
)
return
autoCalibrate
(
avmInputImages
,
clothInfo
,
chessInfoList
,
calibResult
,
lookupTable
).
also
{
result
->
LogUtils
.
i
(
"auto calibrate result = $result
"
)
if
(
result
==
ArcErrorInfo
.
ARC_ERROR_OK
)
{
LogUtils
.
i
(
"autoCalibrate calibResult:${calibResult.data.size}"
)
LogUtils
.
i
(
"autoCalibrate lookupTable:${lookupTable.data.size}"
)
spUtils
.
put
(
CALIB_RESULT
,
FileIOUtils
.
writeFileFromBytesByChannel
(
calibResultPath
,
calibResult
.
data
,
true
))
spUtils
.
put
(
LOOKUP_TABLE
,
FileIOUtils
.
writeFileFromBytesByChannel
(
lookupPath
,
lookupTable
.
data
,
true
))
}
else
{
spUtils
.
put
(
CALIB_RESULT
,
false
)
spUtils
.
put
(
LOOKUP_TABLE
,
false
)
LogUtils
.
e
(
"autoCalibrate failed, chessPoints1:${chessInfoList[0].leftChessPoints[0].x}_${chessInfoList[0].leftChessPoints[0].y},"
+
"chessPoints2:${chessInfoList[1].leftChessPoints[1].x}_${chessInfoList[1].leftChessPoints[1].y},"
+
"chessPoints3:${chessInfoList[2].leftChessPoints[2].x}_${chessInfoList[2].leftChessPoints[2].y},"
+
"chessPoints4:${chessInfoList[3].leftChessPoints[3].x}_${chessInfoList[3].leftChessPoints[3].y},"
)
}
val
getCalibInfo
=
ArcAVMCalibInfo
()
val
getCalibResult
=
ArcAVMCalibResult
()
val
getLookupTable
=
ArcAVMLookupTable
()
result
=
getCalibrateResults
(
getCalibInfo
,
getCalibResult
,
getLookupTable
)
if
(
result
==
ArcErrorInfo
.
ARC_ERROR_OK
)
{
val
getCalibrateResults
=
getCalibrateResults
(
getCalibInfo
,
getCalibResult
,
getLookupTable
)
if
(
getCalibrateResults
==
ArcErrorInfo
.
ARC_ERROR_OK
)
{
LogUtils
.
i
(
"getCalibrateResults, calibInfo:${getCalibInfo}, result:${getCalibResult.data.size}, lookup:${getLookupTable.data.size}"
)
}
}
}
fun
ArcVisDriveAVMEngine
.
manualCalib
(
calibResultPath
:
File
,
lookupPath
:
File
){
val
clothInfo
=
ArcAVMClothInfo
()
clothInfo
.
d1
=
60
0
clothInfo
.
d3
=
500
0
clothInfo
.
d4
=
490
0
clothInfo
.
d5
=
500
0
clothInfo
.
d6
=
400
0
clothInfo
.
d1
=
12
0
clothInfo
.
d3
=
68
0
clothInfo
.
d4
=
68
0
clothInfo
.
d5
=
81
0
clothInfo
.
d6
=
81
0
val
chessInfoFront
=
ArcAVMChessInfo
()
chessInfoFront
.
imagePosType
=
ArcAVMCameraPosType
.
TYPE_FRONT
if
(
chessInfoFront
.
leftChessPoints
!=
null
)
{
...
...
@@ -339,8 +341,8 @@ fun configCameraSequence(path:String,callback: ImageReaderEx.ImageCallback): Pic
return
PictureConfiguration
.
get
(
PictureSequenceSource
.
GENERAL_CAMERA
).
apply
{
mPath
=
path
mImageFormat
=
SpmCameraDevice
.
ImageDataCallback
.
IMAGE_FORMAT_NV21
mPicWidth
=
1280
mPicHeight
=
720
mPicWidth
=
IMAGE_WIDTH
mPicHeight
=
IMAGE_HEIGHT
mImageCallback
=
callback
}
}
app/src/main/java/com/intergration/avm/glsurface/MyGLRenderer.kt
View file @
bde90caf
package
com.
waytous.avmdetect
package
com.
intergration.avm.glsurface
import
android.opengl.GLES20
import
android.opengl.GLSurfaceView
import
android.opengl.Matrix
import
com.blankj.utilcode.util.LogUtils
import
com.intergration.avm.glsurface.MyGLProgram
import
java.nio.ByteBuffer
import
javax.microedition.khronos.opengles.GL10
...
...
app/src/main/java/com/intergration/avm/glsurface/MyGLSurfaceView.kt
View file @
bde90caf
package
com.
waytous.avmdetect
package
com.
intergration.avm.glsurface
import
android.content.Context
import
android.opengl.GLSurfaceView
...
...
app/src/main/java/com/intergration/avm/presentation/AuxiliaryScreenPresentation.kt
View file @
bde90caf
...
...
@@ -9,8 +9,7 @@ import com.intergration.avm.R
import
com.intergration.avm.utils.IMAGE_HEIGHT
import
com.intergration.avm.utils.IMAGE_WIDTH
import
com.mediatek.smartplatform.PictureConfiguration
import
com.waytous.avmdetect.MyGLSurfaceView
import
org.greenrobot.eventbus.EventBus
import
com.intergration.avm.glsurface.MyGLSurfaceView
class
AuxiliaryScreenPresentation
(
outerContext
:
Context
,
display
:
Display
)
:
Presentation
(
outerContext
,
display
)
{
...
...
@@ -26,8 +25,7 @@ class AuxiliaryScreenPresentation(outerContext: Context, display: Display) :
frameLayout
=
layoutInflater
.
inflate
(
R
.
layout
.
layout_presentation
,
null
)
as
FrameLayout
setContentView
(
frameLayout
)
rendererView
=
frameLayout
.
findViewById
<
MyGLSurfaceView
?>(
R
.
id
.
rendererView
).
also
{
it
.
setDisplayOrientation
(
90
)
it
.
setYuvDataSize
(
IMAGE_WIDTH
,
IMAGE_HEIGHT
)
it
.
setYuvDataSize
(
IMAGE_HEIGHT
,
IMAGE_WIDTH
)
}
}
...
...
app/src/main/java/com/intergration/avm/utils/Utils.kt
View file @
bde90caf
...
...
@@ -40,6 +40,8 @@ private val serviceConnection: ServiceConnection = object : ServiceConnection {
}
override
fun
onServiceDisconnected
(
name
:
ComponentName
?)
{
LogUtils
.
d
(
"停止副屏服务..."
)
multiScreenService
?.
dismissSecondPresentation
()
//恢复置空
multiScreenService
=
null
}
...
...
@@ -51,10 +53,8 @@ fun Context.openAuxiliaryPresentation(){
}
fun
Context
.
closeAuxiliaryPresentation
(){
if
(
multiScreenService
!=
null
)
{
multiScreenService
?.
dismissSecondPresentation
()
LogUtils
.
i
(
"解绑副屏服务"
)
unbindService
(
serviceConnection
)
}
}
fun
feedData
(
data
:
ByteArray
){
...
...
app/src/main/res/layout/layout_presentation.xml
View file @
bde90caf
...
...
@@ -9,7 +9,7 @@
android:textSize=
"24sp"
android:textColor=
"@android:color/holo_blue_light"
android:layout_gravity=
"center_horizontal|top"
/>
<com.
waytous.avmdetect
.MyGLSurfaceView
<com.
intergration.avm.glsurface
.MyGLSurfaceView
android:id=
"@+id/rendererView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment