Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have 4 cameras placed in the corners of a room and would like to estimate the rotation and translation of the cameras to one of those 4 cameras with the help of opencv. I was going to estimate R and t based on the essential matrix between camera 1 and 2, camera 1 and 3, and camera 1 and 4. Since the essential matrix only depends on 2 views I was wondering if there is a smarter way of taking advantage of having 4 views to determine R and t? Are there any good guides or tutorials for such a multi-view calibration available? A quick google search didnt lead to success.
Thank you in advance!
I assume the cameras are already calibrated and that there is a portion of the field of view of the reference camera (the one you refer to as "one of those cameras") that is also visible in all the other cameras.
If this is the case, you only need to match some static points in the scene between each pair of (reference, other) camera, then use solvePnP to get the rotations and translations. You can use a calibration chart (checkerboard or dots) to provide the set of static points.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm confused on how the PyOpenGL camera works or how to implement it. Am I meant to rotate and move the whole world around the camera or is there a different way?
I couldn't find anything that can help me and I don't know how to translate C to python.
I just need a way to transform the camera that can help me understand how it works.
To say it bluntly: There is no such thing as a "camera" in OpenGL (neither there is in DirectX, or Vulkan, or in any of the legacy 3D graphics APIs). The effects of a camera is understood as some parameter that contributes to the ultimate placement of geometry inside the viewport volume.
The sooner you understand that all that current GPUs do is offering massively accelerated computational resources to set the values of pixels in a 2D grid, where the region of the pixels changed are mere points, lines or triangles on a 2D plane onto which they are projected from an arbitrarily dimensioned, abstract space, the better.
You're not even moving around the world around the camera. Setting up transformations is actually errecting the stage in which "the world" will appear in the first place. Any notion of a "camera" is an abstraction created by a higher level framework, like a third party 3D engine or your own creation.
So instead of thinking in terms of a camera, which constrains your thinking, you should think about it this way:
What kind of transformations do I have to chain up, to give a tuple of numbers that are called "position" an actual meaning, by letting this position turn up at a certain place on the visible screen?
You really ought to think that way, because that is what's actually happening.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Well currently I'm working on a personal project which is the identification of products in a scanned image taken from a store catalog.
As you may see in the image there's no lines separation between products, so using Hough lines to locate the products won't really solve the problem!
Using Tesseract is really amazing to extract the image content, the only problem that I'm facing is finding the image products automatically, I mean not cropping the image manually but I want to detect the products, cropping them with their text description and price and then extract content using OCR.
I have tried many image processing techniques but still nothing (I'm using Python and OpenCV).
Thanks in advance :)
The problem you have is usually called background removal, or alternatively foreground extraction. In this example, it might actually be relatively easy, as the background is mostly in shades of the same color - my recommendation would be to look at the GrabCut algorithm which is described here: https://docs.opencv.org/3.4.3/d8/d83/tutorial_py_grabcut.html
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Which is the best way to compare two images from same domain, different features in python. Histogram or Image quality functions ?
I have two images for different scenes, the contents inside the images are different, but both of the images are taken during morning.
I want to compare how much these two images are related to each other ?, like my important metric, is to say that these two images were taken during morning for example, even if different contents.
Any idea or way how to do this ?
There is no easy answer to your question. It depends on how do you consider images similar or different. And this is a subjective measure that is totally dependable on what do you want to do with this information.
Anyway, for this kind of problems, opencv is your friend. Here I list some ideas:
use histograms: cv2.histogram https://docs.opencv.org/3.1.0/d1/db7/tutorial_py_histogram_begins.html
with histograms you can know how blueish, greenish or redish an image is. You can compare if 2 images are in the same range (bin) of a specific color. This is something very common when you want to detect skin color.
if you have an specific object that appears in different images, use SIFT or SURF.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a set of images. I have to use them for training a network. I want to simulate a lens flare effect and chromatic aberration on the images. I have tried to find some function in OpenCV, scikit and other python image library but no help from there. How can i simulate these effect on my image? Rough idea or code will be useful. Images are in jpg format.
Depends on what kind of lens flare you are trying to achieve. Create e.g. hexagon mask and overlay multiple instances of it partially transparently between start and end point of the flare axis? Hexagons should be at least slightly bigger "in sun's direction" and spaced more or less in equal distance compared to each others. User should be able to click start and end points of said axis from the pic and use e.g. mouse to rotate, zoom in/out the axis and define number of flare elements to be added.
For chromatic aberration, I would split the RGB components, apply slightly different scaling factors, and merge back. Depending on whether you want to simulate a flint or crown effect, the factors will be increasing or decreasing.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm looking for a algorithm (pseudocode is ok, or any readable sourcecode, implementation is prob. in Python) to recognise a partial beam/perspective rectangle on a low res image, and give the angle from horizontal. The algoritm should be realtime 30hz fast so pref analytic or convex optimization. And most importantly robust. The beam can be in any orientation and the width can vary, but the angle should be able to be estmated sub degree. Robustness is the priority.
For now lets assume there is at least some beam visible. But in application the beam could be partially occluded.
Here is a sample of some example data with true angle 78.8253 degree (its binary data with noise)
I've tried a gaussian blur, than a treshold, and than OLS in u-v image coordinates. This is a beginning, but not the way to go. The cut-off corners and edges biasses the angle.
Does anyone know of a good robust and fast way to do this? Thanks
edit 1. Hough Transform
Applying a Hough Transform after gausian blur+treshold and averaging the top 5 peaks in the transform. This is a big improvement! but still it seems biassed by the assymetry in the cutoff. Are there any candidates that take this cut-away into account?