SurfaceMapperGUI | simple projection mapping interface using Processing | 3D Animation library
kandi X-RAY | SurfaceMapperGUI Summary
kandi X-RAY | SurfaceMapperGUI Summary
Projection mapping interface using Processing's SurfaceMapper library and ControlP5 libraries.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SurfaceMapperGUI
SurfaceMapperGUI Key Features
SurfaceMapperGUI Examples and Code Snippets
Community Discussions
Trending Discussions on SurfaceMapperGUI
QUESTION
I want to warp subsections of an image to project it on a nonuniform surface. Ultimately I want to warp an image as seen HERE, kinda like was is done in HERE from THIS project.
My problem is when I apply the transformations to each subsection of the image, things just do not line up
This is my process by which I achieve the transformations and then stitch (crop and paste them together on the final image.
- Get a list of all the points
- Create a quadrilaterals Region of Interest (ROI) from set of 4 points
Those 4 points are used to Transform the image with the corresponding original 4 points. This is done using my function called perspective_transform()
a. I take the 2 set of 4 points and pass them in to M = cv2.getPerspectiveTransform(corners, newCorners)
b. Then I call: warped = cv2.warpPerspective(roi, M, (width, height))
After getting the new warped image I use mask’s to stich everything together based on the ROI it was associated with:
a. This is done by the function quadr_croped()
Initialization of screen to Get raw pixels from the screen, save it to a Numpy array ...
ANSWER
Answered 2019-Apr-27 at 14:02There may be certainly some bugs in the code, because the output images don't look as they should (or may be not). But you will never get exactly what you want using perspective transforms because of their mathematical nature. Namely, because they are non-linear. You can make the rectangle corners coincide, but between the corners the image is scaled non-uniformly, and you can't make these non-uniformities be the same at the both sides of a dividing line.
But you can employ affine transforms which scale image uniformly. And this guarantees that if two points on a line coincide, all the other points coincide as well. The only problem here that an affine transform is determined using a triangle, so you will need to split your quadrilaterals in triangles. E.g. in the following code every quadrilateral is split in 4 triangles using the center of the quadrilateral as an additional vertex.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SurfaceMapperGUI
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page