1

# Image Crop

Unsolved
###### Computer Vision

Difficulty: 2 | Problem written by zeyad_omar
##### Problem reported in interviews at

In deep learning and computer vision, the images may contain unwanted details. For example, if we are designing a face recognition model by feeding images to the model and getting the name of the preson in the photo, it would be unnecessary to feed the model with an image of size (4000,4000,3) while the person's face is only of size (100,100,3), so we need to crop the image to save time, money, and effort.

In this problem you are given an image and you are asked to crop the rectangle whose upper left corner is (x1,y1) and whose lower right corner is (x2,y2).

##### Sample Input:
<class 'list'>
image: [[1, 1, 1, 1], [1, 1, 1, 0]]
<class 'int'>
x1: 0
<class 'int'>
y1: 0
<class 'int'>
x2: 1
<class 'int'>
y2: 1

##### Expected Output:
<class 'numpy.ndarray'>
[[1]]

MLPro Premium also allows you to access all our high quality MCQs which are not available on the free tier.

Not able to solve a problem? MLPro premium brings you access to solutions for all problems available on MLPro

Have an issue, the MLPro support team is available 24X7 to Premium users.