Crash when set OpenCV resolution

I create a vs project use OpenCV to call a camera followed this link:A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums ,but when I modify the resize deminsions and run the UE ,It just crashed.I see maybe the problem is run this function: cv::resize(frame, frame, size);
Is there anyone know how to solve this? Thanks a million!