public class AIDetectView
extends android.widget.RelativeLayout
限定符和类型 | 类和说明 |
---|---|
static interface |
AIDetectView.DetectListener
AI识别结果监听类,用于监听摄像头图片分析后的返回结果
|
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
ABOVE, ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_END, ALIGN_LEFT, ALIGN_PARENT_BOTTOM, ALIGN_PARENT_END, ALIGN_PARENT_LEFT, ALIGN_PARENT_RIGHT, ALIGN_PARENT_START, ALIGN_PARENT_TOP, ALIGN_RIGHT, ALIGN_START, ALIGN_TOP, BELOW, CENTER_HORIZONTAL, CENTER_IN_PARENT, CENTER_VERTICAL, END_OF, LEFT_OF, RIGHT_OF, START_OF, TRUE
FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, VISIBLE, X, Y
构造器和说明 |
---|
AIDetectView(android.content.Context context)
构造方法
|
AIDetectView(android.content.Context context,
android.util.AttributeSet attrs)
构造方法
|
AIDetectView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
构造方法
|
限定符和类型 | 方法和说明 |
---|---|
void |
changeModelFile(AIDetectViewInfo info)
切换模型文件
|
void |
clearDetectObjects()
清除识别对象
|
void |
dispose()
停止识别,关闭相机,回收资源
|
java.util.Vector<java.lang.String> |
getAllDetectArrayProvide()
设置识别模型后,获取所有可用的识别分类数组
|
java.util.Vector<java.lang.String> |
getDetectArrayToUse()
获取识别分类数组。
|
int |
getDetectInterval()
获取识别时间间隔阈值
|
android.hardware.Camera.Size |
getPolySize()
获取聚合模式网格宽高
|
android.graphics.Bitmap |
getPreviewBitmap()
获取当前预览图片
|
android.graphics.Bitmap |
getScreenCapture()
AI截屏接口,保存当前预览图片及识别绘制框
|
int |
getTrackedCount()
获取当前跟踪计数结果
|
void |
init()
初始化,必须调用该接口完成ai初始化
|
boolean |
isDetect()
当前识别模式状态
|
boolean |
isPolymerize()
返回是否聚合模式
|
boolean |
isPolyWithRect()
返回聚合模式下是否绘制检测框
|
void |
pauseDetect()
暂停识别
|
void |
resetTrackedCount()
重置跟踪结果为0
|
void |
resumeDetect()
开始识别。
|
void |
setAIDetectStyle(AIDetectStyle aiDetectStyle)
设置AI绘制风格
|
void |
setDetectArrayToUse(java.util.Vector<java.lang.String> detectArray)
设置选择分类数组。
|
void |
setDetectedListener(AIDetectView.DetectListener listener)
注册AI识别监听器。
|
void |
setDetectInfo(AIDetectViewInfo info)
才启动识别之前,需要设置相关模型参数,设置参数
|
void |
setDetectInterval(int interval)
设置识别时间间隔
|
void |
setGpsData(Point2D gpsData)
设置GPS坐标。
|
void |
setPolyColorAlpha(int alpha)
设置聚合模式热力颜色透明度。
|
boolean |
setPolyColorArray(java.util.Vector<java.lang.Integer> colorArray)
设置聚合模式热力色带
|
void |
setPolymerize(boolean value)
设置是否聚合模式。
|
void |
setPolymerizeThreshold(int x,
int y)
设置聚合模式阈值
|
void |
setPolySize(android.hardware.Camera.Size size)
设置聚合模式网格宽高
|
void |
setPolyWithRect(boolean value)
设置聚合模式下是否绘制检测框
|
void |
startCameraPreview()
打开相机预览。
|
void |
startCountTrackedObjs()
开始跟踪计数
|
void |
startPushAIStream(java.lang.String ip,
java.lang.String port,
java.lang.String id,
int framerate,
int width,
int height,
InitCallback callback)
开始推送带AI检测结果视频流
|
void |
startPushCustomStream(java.lang.String ip,
java.lang.String port,
java.lang.String id,
android.graphics.Bitmap bitmap,
int width,
int height,
InitCallback callback)
开始推送自定义内容视频流
|
void |
stopCameraPreview()
关闭相机预览
|
void |
stopCountTrackedObjs()
停止跟踪计数
|
void |
stopPushAIStream()
停止推流
|
dispatchPopulateAccessibilityEvent, generateLayoutParams, getBaseline, getGravity, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, requestLayout, setGravity, setHorizontalGravity, setIgnoreGravity, setVerticalGravity, shouldDelayChildPressedState
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchSetActivated, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getClipChildren, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isMotionEventSplittingEnabled, jumpDrawablesToCurrentState, layout, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onInterceptHoverEvent, onInterceptTouchEvent, onRequestSendAccessibilityEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeScroll, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, draw, findViewById, findViewWithTag, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBottom, getCameraDistance, getClipBounds, getContentDescription, getContext, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isOpaque, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onCreateInputConnection, onDragEvent, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPopulateAccessibilityEvent, onRtlPropertiesChanged, onScreenStateChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setClipBounds, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows
public AIDetectView(android.content.Context context)
context
- 上下文public AIDetectView(android.content.Context context, android.util.AttributeSet attrs)
context
- 上下文attrs
- 定义控件属性的attrs.xml。public AIDetectView(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
context
- 上下文attrs
- 定义控件属性的attrs.xml。defStyle
- 控件public void setDetectInfo(AIDetectViewInfo info)
info
- 初始化参数public void init()
public void setDetectInterval(int interval)
interval
- 时间间隔阈值,单位:mspublic int getDetectInterval()
public void setDetectedListener(AIDetectView.DetectListener listener)
listener
- 监听器。public void setDetectArrayToUse(java.util.Vector<java.lang.String> detectArray)
detectArray
- 分类数组模型。public void setGpsData(Point2D gpsData)
gpsData
- 定位坐标。public java.util.Vector<java.lang.String> getDetectArrayToUse()
public void resumeDetect()
public void pauseDetect()
public void dispose()
public void clearDetectObjects()
public void setPolymerize(boolean value)
value
- 是否聚合模式boolean值public boolean isPolymerize()
public void setPolymerizeThreshold(int x, int y)
x
- 网格聚合横坐标阈值y
- 网格聚合纵坐标阈值public android.hardware.Camera.Size getPolySize()
public void setPolySize(android.hardware.Camera.Size size)
size
- 聚合模式网格宽高public boolean isDetect()
public android.graphics.Bitmap getPreviewBitmap()
public int getTrackedCount()
public void resetTrackedCount()
public void startCountTrackedObjs()
public void stopCountTrackedObjs()
public java.util.Vector<java.lang.String> getAllDetectArrayProvide()
public android.graphics.Bitmap getScreenCapture()
public void setAIDetectStyle(AIDetectStyle aiDetectStyle)
aiDetectStyle
- AI绘制风格参数public void startCameraPreview()
public void stopCameraPreview()
public void startPushAIStream(java.lang.String ip, java.lang.String port, java.lang.String id, int framerate, int width, int height, InitCallback callback)
ip
- rtsp服务器ip地址port
- rtsp服务器端口号id
- 推流id名称framerate
- 推流帧率width
- 推流分辨率宽度height
- 推流分辨率高度callback
- 推流状态回调监听public void startPushCustomStream(java.lang.String ip, java.lang.String port, java.lang.String id, android.graphics.Bitmap bitmap, int width, int height, InitCallback callback)
ip
- rtsp服务器ip地址port
- rtsp服务器端口号id
- 推流id名称bitmap
- 推流图片width
- 推流分辨率宽度height
- 推流分辨率高度callback
- 推流状态回调监听public void stopPushAIStream()
public void changeModelFile(AIDetectViewInfo info)
info
- 模型文件属性信息public void setPolyWithRect(boolean value)
value
- 是否绘制检测框boolean值public boolean isPolyWithRect()
public boolean setPolyColorArray(java.util.Vector<java.lang.Integer> colorArray)
colorArray
- 要求4种颜色,对应目标数量1-3,4-6,7-9,大于等于10public void setPolyColorAlpha(int alpha)
alpha
- 颜色透明度