image-rotation

Optimizing OpenGl Rotation of a 2D grayscale image on iphone

会有一股神秘感。 提交于 2019-12-12 02:33:25
问题 I am rotating an image on the iPhone. It is a full size grayscale image (3264 by 2448 on the 4s). OpenGl appears to be roughly twice as fast as core graphics by my measurements, running about 1.22 seconds as opposed to 2.6 seconds. But this is not fast enough for my needs, I need sub-second rotation, if it is possible. (If not, we go to Plan B which involves rotating a subsection of the image, which is more elegant perhaps but has it's own issues.) I should make clear that this only for

Show random images at random places jquery

本秂侑毒 提交于 2019-12-11 23:26:25
问题 I'm trying to display random images at random areas within a div. What I'm looking for is close to this site. They display images and boxes that fades in and out. I've looked for a jQuery plugin for something like this but I can't find any. You guys have any idea about this? 回答1: Give each div a different class name with a numerical notation. Something like 'random1', 'random2' etc. then style, colour and absolutely position the divs using css. Then use jquery to loop over the div's and give

Strange behaviour rotating UIImageView inside UIView

寵の児 提交于 2019-12-11 15:34:52
问题 A lot of related questions, but I can't see any that quite match this. My app has a content view and an ad-banner view. Every time the user rotates the device, - (void) layoutSubviews gets called on the content view. My content view comprises a single image. I want this image to rotate along with the device ( it is a textured background, so I just want to rotate it 90° or 0° depending on whether the physical device is in portrait or landscape. Here is the code: // // ContentView.m //

How to rotate an image by some angle which is set by programmatically?

帅比萌擦擦* 提交于 2019-12-11 09:55:07
问题 Currently I am fetching a random image from the iPad image library and showing it in UIImageView. I want to rotate it by some predefined angle which I can set. I don't want any touch based rotation. How can I do that? 回答1: Why not just rotate the UIImageView? Include QuartzCore framework. #import <QuartzCore/QuartzCore.h> self.imageView.layer.affineTransform = CGAffineTransformMakeRotation(angle) See the documentation on CGAffineTransformMakeRotation 回答2: you can use this one:

How can we rotate an RGB image using nearest neighbor interpolation algorithm about a custom pivot point?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 08:47:20
问题 I am trying to understand image interpolation algorithms in computer vision. I realize that there are a ton of interpolation techniques like linear, bicubic, nearest neighbor, etc. for image rotation. It seems that nearest neighbor technique is the simplest algorithm in this area.. I understand the basic concepts like when we rotate an image with a rotation matrix, the new image rows and columns go to floating point values because of cosine and sine operations. Thus we have to truncate the

How can I flip a sprite of an AI enemy character to face the direction its moving in?

拟墨画扇 提交于 2019-12-11 05:59:40
问题 I'm trying to make a patrolling AI character that will move from point to point. The patrol part works perfectly. However, the problem is that the sprite only faces right. When it turned the sprite stays facing the same direction. I have tried to change the transform rotation using transform.rotate , transform.rotation , transform.Quaternion and making a variable to store the rotation value yet they all kick errors back. The errors are usually made from the rotate/rotation functions not being

How to detect wich part of an image has been touched, when image is rotated?

点点圈 提交于 2019-12-10 18:30:13
问题 I have an image like this one. I can rotate it using this code. Now I would like to know, which color has been touched, independently of the wheel's position. For example, whatever of the following positions the wheel is in, I should be able to detect what color I have touched ...red, yellow, green,blue,pink or grey. Is it possible? How can I do it? Please help me, because I have no idea. Is there any other possibility instead of using a single picture?(solution I would prefer to avoid...) or

help to calculate atan2 properly

旧巷老猫 提交于 2019-12-10 12:49:10
问题 I need to calculate the angle between lines. I need to calculate atan. So I am using such code static inline CGFloat angleBetweenLinesInRadians2(CGPoint line1Start, CGPoint line1End) { CGFloat dx = 0, dy = 0; dx = line1End.x - line1Start.x; dy = line1End.y - line1Start.y; NSLog(@"\ndx = %f\ndy = %f", dx, dy); CGFloat rads = fabs(atan2(dy, dx)); return rads; } But I can't get over 180 degrees(( After 179 deg going 178..160..150 and so on. I need to rotate on 360 degrees. How can I do it? What

PNG transparency issue - faded images with black shadows - border in IE

佐手、 提交于 2019-12-10 10:24:42
问题 I used image rotator for displaying a few images on the homepage. All image are in the PNG format. The problem is in IE (7, 8) - beside the image there is black shadow... I spent couple of hours with fixing this issue, but still don't know, where is the problem & how to remove it... Didn't anyone has a similar issue and a tip, how fix that? 回答1: try with : img.yourimg { background: transparent; -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=

Getting a incorrect picture output when running my self-made rotation algorithm

我怕爱的太早我们不能终老 提交于 2019-12-09 21:52:58
问题 In order to better understand how image manipulation works, I've decided to create my own image rotation algorithm rather than using cv2.rotate() However, I'm encountering a weird picture cropping and pixel misplacement issue. I think it may have something to do with my padding, but there may be other errors import cv2 import math import numpy as np # Load & Show original image img = cv2.imread('Lena.png', 0) cv2.imshow('Original', img) # Variable declarations h = img.shape[0] # Also known as