Comments (13)
I'm doing a simple test:
from vidgear.gears import ScreenGear
capture_options = {"top": 100, "left": 100, "width": 700, "height": 700}
screen = ScreenGear(**capture_options).start()
image = screen.read()
print(image.shape)
The result is (600, 600, 3)
instead of (700, 700, 3)
. The same with mss
backend.
from vidgear.
Thanks for opening this issue, a maintainer will get back to you shortly!
In the meantime:
- Read our Issue Guidelines, and update your issue accordingly. Please note that your issue will be fixed much faster if you spend about half an hour preparing it, including the exact reproduction steps and a demo.
- Go comprehensively through our dedicated FAQ & Troubleshooting section.
- For any quick questions and typos, please refrain from opening an issue, as you can reach us on Gitter community channel.
from vidgear.
@xiety This is not a bug. VidGear follows pillow's Coordinate System which states as follows:
The Python Imaging Library uses a Cartesian pixel coordinate system, with (0,0) in the upper left corner. Note that the coordinates refer to the implied pixel corners; the centre of a pixel addressed as (0, 0) actually lies at (0.5, 0.5).
Coordinates are usually passed to the library as 2-tuples (x, y). Rectangles are represented as 4-tuples, (x1, y1, x2, y2), with the upper left corner given first.
That would look like this:
Pillow's XY coordinate system, which is different from what you're targeting for. Kindly make changes according to it.
from vidgear.
@abhiTronix, I'm sorry, but I can't understand why I need to put x
coordinate into the top
property and not into the left
from vidgear.
from vidgear.
I never said it should x
or y
, it is distance from top.
from vidgear.
But the fact of the matter is that now in the top
property you need to put the distance from the left edge of the screen.
from vidgear.
This is how it is working now, which is kinda strange
from vidgear.
@xiety let me check.
from vidgear.
@xiety Yes "top"
and "left"
were swapped for dxcam
backend. But your diagram is incorrect, height and is not from the initial(0,0) but from the top+height
and left+width
respectively, you can confirm this by setting top and left zero and then increasing both the values simultaneously and you could see region moving diagonally, but the dimensions(area) of region not changing.
from vidgear.
@xiety Apologies, visually this is really hard to see. Yeah you're correct, since all those backend libraries are following PIL.ImageGrab.grab bbox left,upper,right,lower
conventions as explained in depth here: http://chayanvinayak.blogspot.com/2013/03/bounding-box-in-pilpython-image-library.html
from vidgear.
@xiety I'll add this to ScreenGear documentation.
from vidgear.
Successfully resolved and merged in commit 3c0dd5d
from vidgear.
Related Issues (20)
- [Question]: How to set hwaccel to StreamGear for utilizing GPU, Using the option ? HOT 2
- ValueError: [CamGear:ERROR] :: Stream Mode is enabled but Input URL is invalid! [Bug]: HOT 3
- [Question]: Failed to start the camera with CamGear (source=self. source). start () in celery's task HOT 3
- [Docs]: Update the chunk size parameter in docs HOT 3
- [Bug]: frame_size_reduction does not allow value of 0 HOT 4
- [Bug]: NetGear graceful close doesn't work for pattern=2 HOT 5
- [Question]: Change default video path in WebGear HOT 3
- [Question]: Transforms size keep growing. HOT 3
- [Question]: I edit individual frames, but the original unearthly video still ends up on YouTube. Why? HOT 15
- [Question]: Fetch Multiple Video from Youtube HOT 3
- [Proposal]: Dropped support for Python 3.7.x legacy HOT 2
- [Question]: How to get original video fps with VideoGear. HOT 8
- [Bug]: CamGear - Error when loading first segment , while taking picture from youtube streaming HOT 2
- [Bug]: In NetGear client.recv() stucking in a some non returnable loop HOT 4
- [Proposal]: Add type annotations to the code or add stub files HOT 2
- [Proposal]: Add ffmpeg creationflag in Writegear API HOT 1
- [Bug]: frame desynchronization HOT 6
- [Question]: Does VidGear support downloading arbitrary frames and getting video sizes? HOT 4
- Putting a client IP into the Server code? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vidgear.