EmguCv, Detect and Crop the black rectangle surrounded by white lines

Viewed 23

enter image description here

I have this threshholded image and the part i want to crop is the black rectangle surrounded by the white lines.

Of course the first thing i got in mind is to use Rectangle with fixed x and y, Rectangle rect = new Rectangle(525, 255, 1450, 1470); but this is a static way of doing things and it will not work if the second image is 1cm higher as an example.

So im looking for a way to dynamically extract that part of the image.

0 Answers
Related