How to send command from matlab to my IP camera
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I really need help on this. How to send command from matlab to my ip camera for me to control my camera. Below is the javascript(function) of my camera. im using foscam fi8918w. Thank you.
var PTZ_STOP = 1; var TILT_UP = 0; var TILT_DOWN = 2; var PAN_LEFT = 6; var PAN_RIGHT = 4; var PTZ_LEFT_UP = 91; var PTZ_RIGHT_UP = 90; var PTZ_LEFT_DOWN = 93; var PTZ_RIGHT_DOWN = 92; var PTZ_CENTER = 25; var PTZ_VPATROL = 26; var PTZ_VPATROL_STOP = 27; var PTZ_HPATROL = 28; var PTZ_HPATROL_STOP = 29; var IO_ON = 95; var IO_OFF = 94; var FILE_NO =1;
function up_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
up.src = up_down.src; if (ipcam[current].CameraFlip & 0x01) ipcam[current].DecoderControl(TILT_DOWN); else ipcam[current].DecoderControl(TILT_UP); }
function up_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
up.src = up_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function down_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
down.src = down_down.src; if (ipcam[current].CameraFlip & 0x01) ipcam[current].DecoderControl(TILT_UP); else ipcam[current].DecoderControl(TILT_DOWN); }
function down_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
down.src = down_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function left_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
left.src = left_down.src; if (ipcam[current].CameraFlip & 0x02) ipcam[current].DecoderControl(PAN_RIGHT); else ipcam[current].DecoderControl(PAN_LEFT); }
function left_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
left.src = left_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function right_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
right.src = right_down.src; if (ipcam[current].CameraFlip & 0x02) ipcam[current].DecoderControl(PAN_LEFT); else ipcam[current].DecoderControl(PAN_RIGHT); }
function right_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
right.src = right_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function leftup_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
leftup.src = leftup_down.src; if ((ipcam[current].CameraFlip & 0x03) == 0x03) ipcam[current].DecoderControl(PTZ_RIGHT_DOWN); else if (ipcam[current].CameraFlip & 0x02) ipcam[current].DecoderControl(PTZ_RIGHT_UP); else if (ipcam[current].CameraFlip & 0x01) ipcam[current].DecoderControl(PTZ_LEFT_DOWN); else ipcam[current].DecoderControl(PTZ_LEFT_UP); }
function leftup_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
leftup.src = leftup_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function rightup_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
rightup.src = rightup_down.src; if ((ipcam[current].CameraFlip & 0x03) == 0x03) ipcam[current].DecoderControl(PTZ_LEFT_DOWN); else if (ipcam[current].CameraFlip & 0x02) ipcam[current].DecoderControl(PTZ_LEFT_UP); else if (ipcam[current].CameraFlip & 0x01) ipcam[current].DecoderControl(PTZ_RIGHT_DOWN); else ipcam[current].DecoderControl(PTZ_RIGHT_UP); }
function rightup_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
rightup.src = rightup_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function leftdown_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
leftdown.src = leftdown_down.src; if ((ipcam[current].CameraFlip & 0x03) == 0x03) ipcam[current].DecoderControl(PTZ_RIGHT_UP); else if (ipcam[current].CameraFlip & 0x02) ipcam[current].DecoderControl(PTZ_RIGHT_DOWN); else if (ipcam[current].CameraFlip & 0x01) ipcam[current].DecoderControl(PTZ_LEFT_UP); else ipcam[current].DecoderControl(PTZ_LEFT_DOWN); }
function leftdown_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
leftdown.src = leftdown_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function rightdown_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
rightdown.src = rightdown_down.src; if ((ipcam[current].CameraFlip & 0x03) == 0x03) ipcam[current].DecoderControl(PTZ_LEFT_UP); else if (ipcam[current].CameraFlip & 0x02) ipcam[current].DecoderControl(PTZ_LEFT_DOWN); else if (ipcam[current].CameraFlip & 0x01) ipcam[current].DecoderControl(PTZ_RIGHT_UP); else ipcam[current].DecoderControl(PTZ_RIGHT_DOWN); }
function rightdown_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
rightdown.src = rightdown_up.src; ipcam[current].DecoderControl(PTZ_STOP); }
function center_onmousedown() { if (ipcam[current].MonitorStatus != 2) return;
gocenter.src = center_down.src; ipcam[current].DecoderControl(PTZ_CENTER); }
function center_onmouseup() { if (ipcam[current].MonitorStatus != 2) return;
gocenter.src = center_up.src; }
function vpatrol_onmousedown()
댓글 수: 0
답변 (2개)
Kaustubha Govind
2012년 3월 27일
I don't know much about image acquisition with MATLAB, you might find this previous discussion useful: http://www.mathworks.com/matlabcentral/answers/11011-how-to-access-video-from-a-remote-camera
댓글 수: 0
Mohamad Faiz
2012년 3월 27일
댓글 수: 1
Kaustubha Govind
2012년 3월 27일
Not sure, but if you know how to call your Javascript function using a COM object, you can use MATLAB as a COM client: http://www.mathworks.com/help/techdoc/matlab_external/f27178.html
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Support Package for IP Cameras에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!