Đang chuẩn bị liên kết để tải về tài liệu:
McGraw-Hill- PDA Robotics - Using Your PDA to Control Your Robot 1 Part 12

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Tham khảo tài liệu 'mcgraw-hill- pda robotics - using your pda to control your robot 1 part 12', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | PDA Robotics Activate the motion detection CAPTUREPARMS cap_params long struct_size sizeof CAPTUREPARMS capCaptureGetSetup h_capwin cap_params struct_size cap_params.fLimitEnabled FALSE cap_params.fAbortLeftMouse FALSE cap_params.fAbortRightMouse FALSE cap_params.wTimeLimit 3600 reset after 60 second test cap_params.fYield TRUE Throw away the audio for now . will use same algorithm for sound detection cap_params.fCaptureAudio FALSE cap_params.wNumVideoRequested 1 capCaptureSetSetup h_capwin cap_params struct_size Set the callback to which the vidoe will be stramed BOOL ret capSetCallbackOnVideoStream h_capwin LPVOID stream_callback capCaptureSequenceNoFile h_capwin else Unchecked the motion detection m_radar_stat.SetWindowText Motion Sense OFF capCaptureAbort h_capwin m_stretch_video.EnableWindow TRUE The video frames will be sent to this callback function where we will compare the last video frame sent to the current LRESULT stream_callback HWND hWnd LPVIDEOHDR lpVHdr static initialized static DWORD frame_same_total static last_frame_bytes 198 Chapter 10 The PDA Robotics Command Center static DWORD trigger_threshold static BYTE last_frame_data BYTE frame_data BYTE malloc size_t lpVHdr- dwBytesUsed We will run into a problem if the frame buffer size has increased user switched the video format settings while detecting motion .so realloc to the correct size. if initialized last_frame_data BYTE malloc size_t lpVHdr- dwBytesUsed last_frame_bytes size_t lpVHdr- dwBytesUsed else Ensure that the bytes used hasn t changed. User may change video settings along the way. Resize our frame buffer if last_frame_bytes size_t lpVHdr- dwBytesUsed AfxMessageBox Reallocating the frame buffer sise last_frame_data BYTE realloc last_frame_data size_t lpVHdr- dwBytesUsed last_frame_bytes size_t lpVHdr- dwBytesUsed if frame_data NULL last_frame_data NULL Frame data couldn t be allocated return FALSE memcpy frame_data lpVHdr- lpData lpVHdr- dwBytesUsed if initialized memcpy .

TÀI LIỆU LIÊN QUAN