-1

I'm trying to crop the image from the binary image which is already processed from the original, suppose I have the original image

Original Image

and I got the binary image from the original

Binary image

and I want to crop the image only the white area using blob analysis

How can I do that?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Alpha9
  • 101
  • 7

2 Answers2

1

In c++ you can use,

cv::Mat output_Mat = cv::Mat::zeros(RGB_Mat.size(), RGB_Mat.type());
RGB_Mat.copyTo(output_Mat, Binary_Mat);

Hope you can find corresponding python methods.

tinkerbell
  • 421
  • 4
  • 12
0
points = cv2.findNonZero(binary_image);
min_rect = cv2.boundingRect(points);
Ankur Jain
  • 507
  • 3
  • 9