Last answered:

03 May 2024

Posted on:

21 Nov 2021

0

Image getting cropped when OpenCV is loading image with imread

Hi, I'm using the cv2.imread to load the image.when I use the cv2.imshow(), i'm seeing a cropped image. Both the original image and the image we are using to find circles thorugh Hough transformation are getting loaded as cropped (and the crop is same in both images). Thus, my radii are smaller than the program (of course I adjusted the radii to reflect smaller numbers to identify the coins) and the brightness is different (don't know why).

The end result after adjusting the values was same. And I can understand the brightness numbers vary because the radii vary and the square which we are using to calculate brightness varies and thus different brightness values.

But why is my image getting loaded as cropped. I'm running a Core i5 computer with 16GB RAM (A bit old computer though), anaconda individual edition with spyder 5.1.5. But would OpenCV execution and results vary across platforms/machines/execution environments?

Thanks
Sree

4 answers ( 0 marked as helpful)
Instructor
Posted on:

22 Nov 2021

0

Hey Sreekanth,

Thank you for reaching out!

Unfortunately, I am not quite sure why the figure appears cropped for you. What I can suggest is that you try running the code on VS Code rather than on Spyder and see whether there is a difference.

Hope this resolves the problem!

Kind regards,
365 Hristina

Posted on:

22 Nov 2021

1

Hi Hristina,

Thanks for your reply. I tried on VS Code and Spyder both. But unfortunately the image shows cropped in both tools.

Are there any limitations in the newer versions of OpenCV on the size of the images that can be loaded/edited/processed?

Thanks once again for your reply. I'll continue to search on this topic online. If I find a resolution to this, I'l post my observation here for the benefit of others if someone faces similar issue.

Thanks
Sree

Posted on:

04 Jan 2024

0

i have a similar problem. 

by the way,  i am using vscode

Posted on:

03 May 2024

0

I am facing the same issue. Using vs code. Any solution?


Submit an answer