-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I customize the blue area in the image? #229
Comments
@arcpuree is the question still valid? |
yes, i can not solve the problem. 😂
…On Fri, Oct 1, 2021 at 10:41 PM Dmitry Yunitsky ***@***.***> wrote:
@arcpuree <https://github.com/arcpuree> is the question still valid?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#229 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEBZ4FMURREUPXWR26MRVE3UEXJCNANCNFSM5DAJ6KOA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
ขอแสดงความนับ,
Best regards,
ภูรี พิมพ์ทองงาม
Puree Pimtongngam
089-902-9022
***@***.***
|
@arcpuree we don't expose API to customize lane render, actually. However, you could draw it yourself using simple Canvas rendering. You'll need to receive RoadDescription object, that contains detected lanes array, for each of them there is two LaneEdges. Each LaneEdge contains Bezier that can be drawn on canvas, e.g.
|
thank yout, i'll try it. 😄
…On Tue, Oct 5, 2021 at 11:29 PM Dmitry Yunitsky ***@***.***> wrote:
@arcpuree <https://github.com/arcpuree> we don't expose API to customize
lane render, actually. However, you could draw it yourself using simple
Canvas rendering. You'll need to receive RoadDescription
<https://docs.mapbox.com/android/vision/api/vision/0.13.0/com/mapbox/vision/mobile/core/models/road/RoadDescription.html>
object, that contains detected lanes array
<https://docs.mapbox.com/android/vision/api/vision/0.13.0/com/mapbox/vision/mobile/core/models/road/Lane.html>,
for each of them there is two LaneEdges
<https://docs.mapbox.com/android/vision/api/vision/0.13.0/com/mapbox/vision/mobile/core/models/road/LaneEdge.html>.
Each LaneEdge contains Bezier
<https://docs.mapbox.com/android/vision/api/vision/0.13.0/com/mapbox/vision/mobile/core/models/BezierCubic3D.html>
that can be drawn on canvas, e.g.
...
fun drawLane(lane: Lane?) {
fillPath.reset()
lane?.let {
val leftP1 = VisionManager.worldToPixel(lane.leftEdge.curve.p1)
val leftP2 = VisionManager.worldToPixel(lane.leftEdge.curve.p2)
val leftP3 = VisionManager.worldToPixel(lane.leftEdge.curve.p3)
val leftP4 = VisionManager.worldToPixel(lane.leftEdge.curve.p4)
val rightP1 = VisionManager.worldToPixel(lane.rightEdge.curve.p1)
val rightP2 = VisionManager.worldToPixel(lane.rightEdge.curve.p2)
val rightP3 = VisionManager.worldToPixel(lane.rightEdge.curve.p3)
val rightP4 = VisionManager.worldToPixel(lane.rightEdge.curve.p4)
fillPath.apply {
moveTo(
leftP1.x.toFloat(),
leftP1.y.toFloat()
)
cubicTo(
leftP2.x.toFloat(),
leftP2.y.toFloat(),
leftP3.x.toFloat(),
leftP3.y.toFloat(),
leftP4.x.toFloat(),
leftP4.y.toFloat()
)
lineTo(
rightP4.x.toFloat(),
rightP4.y.toFloat()
)
cubicTo(
rightP3.x.toFloat(),
rightP3.y.toFloat(),
rightP2.x.toFloat(),
rightP2.y.toFloat(),
rightP1.x.toFloat(),
rightP1.y.toFloat()
)
close()
}
}
invalidate()
}
override fun onDraw(canvas: Canvas) {
canvas.drawPath(fillPath, fillPaint)
super.onDraw(canvas)
}
...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#229 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEBZ4FMYCZOGK7K56PD4KFLUFMRWLANCNFSM5DAJ6KOA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
ขอแสดงความนับ,
Best regards,
ภูรี พิมพ์ทองงาม
Puree Pimtongngam
089-902-9022
***@***.***
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to change the blue area from the image to three colors.
The text was updated successfully, but these errors were encountered: