ios - Losing data when converting from UIImage to Mat -
i trying utilize hsv threshold find reddish cup in image. 1 of implementations uses cvvideocamera delegate , gets mat straight camera. other implementation lets user record video extract frames using avfoundation processing.
when threshold image avfoundation nil besides black image.
here code:
inrange(gray, scalar(114, 135, 135), scalar(142, 255, 255), dst);
the first image illustration of image works , sec image avfoundation not threshold how expect, produces black image.
does have thought why sec image produces different results when color of cup looks quite similar?
an image pulled video reconstructed in manner depends on video's encoding , compression codec. short version unless happen pick out keyframe (which won't have api do, trying isn't viable), you're getting image reconstructed video.
so image taken video same time took straight-up image photographic camera (assuming both @ same time) different. after sort processing you'll, of course, different result.
before applying threshold, raw image before approaches. @ them (or delta of them) , you'll see aren't same image. sec approach have introduced artifacts beingness encoded video multiple frames, reconstructed single frame image.
ios objective-c opencv uiimage computer-vision
No comments:
Post a Comment