How to blend a smaller texture at certain coordinate of the source picture (a still image) using GPUImage - objective-c

i'm using GPUImage library and i wish to put a small logo or text at certain coordinate of a still image.
i tried using GPUImageSourceOverBlendFilter, it blends the 2nd picture into source picture but default at the center of the source picture.
Can anyone share some idea how i can achieve this?

Related

Making only a small section of a vector drawable visible

I have a large image, based on a vector drawable xml file, and I would like to visualize only part of it in an ImageView, like this (the darker regions would be off screen):
Under user control, the image would move around (or rather, the visible part of it), very much like a Google maps app.
I can manage to dig into Android Studio but I would like to get some hint on what would be a proper approach to handle this. Is using a large xml file and clipping it appropriate or is it better drawing it on a canvas in runtime?
I played with both vector drawables and drawing on a canvas, but not enough to be sure which way to go for this or to post any code.

How to detect an image between shapes from camera

I've been searching around the web about how to do this and I know that it needs to be done with OpenCV. The problem is that all the tutorials and examples that I find are for separated shapes detection or template matching.
What I need is a way to detect the contents between 3 circles (which can be a photo or something else). From what I searched, its not to difficult to find the circles with the camera using contours but, how do I extract what is between them? The circles work like a pattern on the image to grab what is "inside the pattern".
Do I need to use the contours of each circle and measure the distance between them to grab my contents? If so, what if the image is a bit rotated/distorted on the camera?
I'm using Xamarin.iOS for this but from what I already saw, I believe I need to go native for this and any Objective C example is welcome too.
EDIT
Imagining that the image captured by the camera is this:
What I want is to match the 3 circles and get the following part of the image as result:
Since the images come from the camera, they can be rotated or scaled up/down.
The warpAffine function will let you map the desired area of the source image to a destination image, performing cropping, rotation and scaling in a single go.
Talking about rotation and scaling seem to indicate that you want to extract a rectangle of a given aspect ratio, hence perform a similarity transform. To define such a transform, three points are too much, two suffice. The construction of the affine matrix is a little tricky.

Photoshop CS6 Size of Objects

I'm using PS CS6 and have almost no experiences with Photoshop. I just need to get some sizes in pixels to create HTML.
Maybe a trivial question, but couldn't find any answer on Google and stackoverflow.
Problem:
The main image consists of different layers. Those layers contain an image. How do I get the size of those images in pixels? I could use the ruler but there has to be a much more simple way. Any idea?
Please assist me.
Try this
For Single image (sub-Image)
Select or click on Image than look under menu of cs6 you can show [Show Transform Control] check it and you can re-size your image in any size.
For Whole Image
PS>Image > Image Size > Give Wight and Height in Pixel so u can use that image as HTML file.
Hope It will be work
Regards
Dhruvil
for images or other objects on a layer show the info palette (F8) and select the object as if you wanted to resize it (eg click upper right corner). The dimensions of the image are then displayed in the info palette.
In PS CS6 simply make a rectangle and you have shown its size next to the cursor. Before this make sure that you have pixels as your main unit in preferences.
Good Luck.

iOS cropping and resizing ensuring rect stays visible

My app downloads images from a website. These images are all manner of sizes, from 800x600 up to 1800x1600. I analyze the image using facial recognition, and then want to resize and crop the image. However, it's important that the detected CGRect be visible on the cropped image.
I was using the excellent UIImage+Resize code and using UIViewContentModeScaleAspectFill, but it doesn't seem to have a programatic way of specifying an arbitrary location that needs to be visible in the final image. So if a face is located at the 1600px range of an 1800x1600 image, it'll get cut off.
Is there an easy solution to this, or do I need to dig around in the depths of UIImage+Resize? Any guidance would be appreciated!

Camera image size

I am writing a Cocoa application for mac osx. I'm trying to figure out how to determine the size of an image that will be captured by a camera? I would like to know the size of the image that will be captured so I can setup a view with an aspect ratio that won't distort the image. For example, if my view is defined to be 640x360 and my camera captures images that are 640x480, the displayed image looks short and fat. I'm also displaying some other layers over the image and I need the image size to be able to scale and position the layers properly.
I won't know the type of camera that is attached until run-time so I'd like to be able to interrogate the device and get attributes like image size. Thanks for the help...
You are altering the aspect ratio of the image when you capture in 640x360 instead of 640x480 or 320x240. You are doing something similar as a resize, using the whole image and making it a different size.
If you don't want to distort the image, but use only a portion of it you need to do a crop. Some hardware support cropping, others don't and you have to do it in software. Cropping is using only portions of the original image. In your case, you would discard the bottom 120 lines.
Example (from here):
The blue rectangle is the natural, or original image and the red is a crop of it.