Detection Camera API Documentation - person-in-hangang/HanRiver GitHub Wiki

Detection

public Mat onCameraFrame(CvCameraViewFrame inputFrame)

Real-time Sensing & Frame Flow Creation Function

  • Parameter : camera input Frame
  • Return : frame

private List readLabels(String file, Context context)

Import classification name from label s.txt file

  • Parameter : labels.txt file
  • Return : labels (array)

boolean detect(float x,float y)

Detects crossing the line

  • Parameter : Bounding box center coordinate
  • Return : boolean variable

Networking

void connect()

Send bounding box and image to server

  • Parameter : None
  • Return : None
Thread checkUpdate = new Thread() {
            public void run() {
                // 서버 접속
                String newip = "210.102.181.248";
                int port = 7002;
                try {
                    socket = new Socket(newip, port);
                } catch (IOException e1) {
                    e1.printStackTrace();
                }
while(true) {
                    try {
                        dos.writeUTF(":1:"+"@" +left +"@"+width+"@"+top+"@"+height+"@");
                        dos.flush();
                        dos.write(total, 0, total.length);
                        dos.flush();
                        socket.close();
                        break;
                    }

Firebase

public void postFirebaseDatabase(boolean add)

Send location information of the Bridge and detection time to the database.

  • Parameter : boolean variable
  • Return : None
⚠️ **GitHub.com Fallback** ⚠️