I have a question regarding screen regions or possibly mouse/cursor coordinates in x11vnc.
I am trying to create all possible mouse positions using an image within an image.
The primary image will always be 765 by 503 pixels. The secondary image is unknown until I figure out how to extract the secondary region in a easily-reproducible manner. Meaning, I will need some way of somewhat some-what accurately grab the secondary image that I want, and then be able to extract the x,y of the secondary image in respect of the primary image. Meaning that the bottom-left corner of the secondary image coordinates of x,y will not be 0,0 but rather the x,y values as if it were the main image. This is only meant to help create accurate coordinates, actual results may differ.
I know the image will be there because I am using vncdotool to expect the image, and then perform an operation once the image is found.
Note: I am not sure what what rexpect within the vncdotool does
Using x11vnc I have shared a single application, so all coordinates are needed, I just need to figure out a way to map image(s) to coordinates upon the vncdotool expect finding the secondary image
This github repo solves this question
You can create an XML file using a simple gui on the image to draw the rectangle you wish to create the bounding box on and get the x_min, y_min, x_max, y_max pixel coordinates which can translate into mouse/cursor coordinates.
https://github.com/tzutalin/labelImg
Related
I would need a way to detect the size and position of the color blob representing the central object in a photo.
i have prepared a image that should explain what i am after. this is done in photoshop, so its just a handmade explanation. I need to simplify the object, in oder to remove reflections and small details. Then I need to find the outer box coordinates to be able to locate it in the image.
The object can have any color, and will always differentiate from the background. I am interested in the object that covers the central pixel of the image.
How can this be done in python using opencv?
thank you
Original image:
simplyfied color-blob image
needed box:
I want to make a ct labeling software,for target detection,But I don't know how to realize the function of drawing rectangle.
The read image has three perspectives. After labeling, each perspective will display a rectangle box corresponding to the perspective, and the length of one perspective rectangle box will change accordingly for the other two perspectives.
like mimics
enter image description here
I have try vtkBorderWidget and vtkBoxWidget but not use
I'm using the google maps static api to get top view satellite images of objects of which I have the surface coordinates (LoD1 / LoD2).
the points are always slightly off, I think this is due to a small tilt in the satellite image itself (is it a correct assumption?).
For example in this image I have the building shape, but the points are slightly off. Is there a way to correct this for all objects?
The red markers are the standard google-maps api pointers, the center of the original image (here it is cropped) is the center of the building, and the white line is a cv2.polyline implementation of the object shape.
Just shifting by n pixels will not help since the offset depends on the angle between the satellite and object and the shape of that object.
I am using the pyproj library to transform the coordinates, and then convert the coordinates to pixel values (by setting the center point as the center pixel value, and having the difference in the coordinate space, one can calculate the edge-points pixel values too).
So - the good news is that there is no need to "correct" this for all objects, because there is no way to do that without using 3d models & textures.
Google (or most map platforms for that matter) don't actually use satellite images, they use aeroplane images. The planes don't fly directly over the top of every building (imagine how tight/redundant their flight path would be if they did!).
Instead, the plane will take an image from some kind of angle, and then, through the wonders of photogrammetric processing, the images are all corrected and ortho-rectified so the ground surface is in the right place everywhere.
What can't (and shouldn't) be corrected in a 2d image is the location of objects above ground height. Like the roof in your image. For a more extreme example, just look at a skyscraper, and you'll realise you can't ever get the pixels correct above the ground:
https://goo.gl/maps/4tLSrd7yXQYWZPTy7
I am using Folium on Python to extract maps. Given a coordinate, I want to extract an image of the mxm meters square around that coordinate. So, using pyproj, I project UTM to regular meters, create the mxm square and project back to UTM to get the coordinates of the bounding boxs corners.
Then, I've used fit_bounds with those corners to get my nxn picture. However, the output is still a rectangle. Sure, I can use Pillow to crop the image after the fact, but I need more control over how many meters that image is... And, right now I am not sure what I am actually getting.
What is the best way to extract a square image using Folium? Lets say I want to extract a map that gets the 100x100 meters area with coordinates (48.8584,2.2945) in the center.
What is the best approach to get this map?
I figured out how to control
OpenStreetMap has this wiki link with information regarding the different zoom levels.
To figure out how much of the real world is covered by a single pixel, formulas are provided. It is a function of the zoom level and the latitude at which the map is extracted.
s_pixel = C*cos(latitude)/(2**(zoomlevel + 8))
I'm trying to get coordinates of billiards table's side point.
This is origin image
in this image to
This black point's coordinates
This black point's coordinates
because i need to get edge's coordinates even when something hide some part of the image, like that way if i can get two arbitrary points in one side of table i can calculate the edge points.
but i have no idea how can i get that point...
please help. thanks for reading