distortion

Android Camera2 API preview sometimes distorted

强颜欢笑 提交于 2019-12-01 11:38:50
问题 I am building a custom camera with the Camera2 API. So far the camera works very well except for the preview which is distorted sometimes. Let's say I open the camera 7 times in a row. All of the attempts are succesful and the 8th time the camera preview is distorted. It looks like it uses the width as the height and vice versa. I have based my code on the Google sample implementation of the camera2 which can be found here. the interesting thing is that even the Google sample implementation

Mapping an image onto a set of coordinates

泄露秘密 提交于 2019-12-01 11:13:29
I have a typical source image with a 3:4 aspect ratio. I also have a set of coordinates that I need to map the image onto in a separate image. The coordinates are not perfectly rectangular; if anything they define an irregular mesh. So for example, (0,0) might map to (12,33), (120,0) => (127,36), (240,0)=>(226,13), etc. My goal is to get my source image to fit onto the new shape by mapping the source coordinates to the destination and applying distortion. What are some ways to accomplish this? I'm using .NET but am fine calling out to e.g. ImageMagick. EDIT: As requested, here's a picture. The

Mapping an image onto a set of coordinates

穿精又带淫゛_ 提交于 2019-12-01 09:08:45
问题 I have a typical source image with a 3:4 aspect ratio. I also have a set of coordinates that I need to map the image onto in a separate image. The coordinates are not perfectly rectangular; if anything they define an irregular mesh. So for example, (0,0) might map to (12,33), (120,0) => (127,36), (240,0)=>(226,13), etc. My goal is to get my source image to fit onto the new shape by mapping the source coordinates to the destination and applying distortion. What are some ways to accomplish this

How to implement image distortion effects in Android

孤者浪人 提交于 2019-12-01 03:27:01
I want to implement distortion effects on image in Android. I did the same in iOS(iPhone and iPad) by using GPUImage framework. Is there any framework or library available in Android to do the same. I want to implement following distortion effects in Android. pinch distortion swirl distortion bulge distortion stretch distortion Please provide any solution for this. Thanks in advance. OcuS There is a very basic example in your SDK folder into the APIDemos project. See SDK_DIR/samples/android-*/ApiDemos/src/com/example/android/apis/graphics/BitmapMesh.java . Also answers for Resources for image

How to implement image distortion effects in Android

纵饮孤独 提交于 2019-11-30 23:55:06
问题 I want to implement distortion effects on image in Android. I did the same in iOS(iPhone and iPad) by using GPUImage framework. Is there any framework or library available in Android to do the same. I want to implement following distortion effects in Android. pinch distortion swirl distortion bulge distortion stretch distortion Please provide any solution for this. Thanks in advance. 回答1: There is a very basic example in your SDK folder into the APIDemos project. See SDK_DIR/samples/android-*

Canvas distorts drawing. How do I get the scale factor between the set size and the styled size?

北慕城南 提交于 2019-11-30 20:43:48
I have this canvas: <canvas id="game" width="280" height="280"></canvas> The css styles the canvas via: canvas { width: inherit; height: 280px; } As the width can change, the canvas distorts the drawing. I need to know how to compensate for this. Anyone who can help me? This is the same problem that the Mozilla Bespin team ran into. (back when they were using Canvas, before it merged with Ace) Don't give the Canvas any CSS width/height rules. Doing so usually ends up as a pain. Put the Canvas in a Div that only has a single thing in it (the canvas itself) As the canvas-parent div changes size,

Distorted UI onReceive of Admob Ads

拜拜、爱过 提交于 2019-11-30 20:00:14
问题 The android UI gets distorted whenever the admob ads show up. And this happens on screens, which have some animations playing. On this screen I have a button animating with android:repeatCount="infinite". I have observed this behavior since I have changed the admob Ad Id to the new Admob ID (after migrating to new Admob). Please help!! 回答1: This is an open issue reported to android issue tracker check Rendering glitch on View since Android 4.4.3. https://code.google.com/p/android/issues

CSS image scaling to fit within area not distort

青春壹個敷衍的年華 提交于 2019-11-30 08:01:25
Is there a way with CSS or otherwise of making an image fit within an area. Lets say I have multiple images of different sizes and I want them all to fit within a div of 150px by 100px. I don't want to scale the images though as some may be tall and others narrow I simply want them to fit within this area with the rest hidden. I thought about using overflow:hidden but it appears to not be hidden in IE6. Any ideas? You should try using this: img{ width: auto; max-width: 150px; height: auto; max-height: 100px; } Edit: Looks like IE6 doesn't support max-width and max-height properties. However,

Canvas distorts drawing. How do I get the scale factor between the set size and the styled size?

旧街凉风 提交于 2019-11-30 05:00:21
问题 I have this canvas: <canvas id="game" width="280" height="280"></canvas> The css styles the canvas via: canvas { width: inherit; height: 280px; } As the width can change, the canvas distorts the drawing. I need to know how to compensate for this. Anyone who can help me? 回答1: This is the same problem that the Mozilla Bespin team ran into. (back when they were using Canvas, before it merged with Ace) Don't give the Canvas any CSS width/height rules. Doing so usually ends up as a pain. Put the

Barrel distortion correction algorithm to correct FishEye lens - failing to implement with Java

三世轮回 提交于 2019-11-29 10:54:59
I have a large bulk of photographs taken with a fisheye lens. As I want to do some image-processing (e.g. edge detection) on the photos I want to remove the barrel distortion which effects my results heavily. After some research and lots of read articles I found this page : They describe an algorithm (and some formulas) to solve this problem. M = a *rcorr^3 + b * rcorr^2 + c * rcorr + d rsrc = (a * rcorr^3 + b * rcorr^2 + c * rcorr + d) * rcorr rsrc = distance of a pixel from the center of the source image rcorr = distance of a pixel from the center in the corrected image a,b,c = distortion of