AR.JS: Desktop-based static target image - three.js

I don't need or want "live placement" using a camera. I will already have an image with a target in it, and a second image for which I know its real-world dimensions. I want to place this second image on top of the image with a target in it, but in the correct position/perspective, etc. Then save the result as a third combined image.
I can't find any information on how I would implement this with AR.js, or if it is even possible.

Related

Check if an image contains another image

Im trying to check if a screenshot contains an image that is saved in the project resources, I need to find a 100% match only and would like to not use any extra libraries, now with that being said, I have no idea how to do so.
heres a few questions:,
do I compare the two buffered images together? do I change them into something else?
Il have to compare it atleast once a second or so. (just as general information)
I have a resource folder under my project in eclipse and the .png files are shown as text, is there a way to change that? I tried tinkering with the settings, no luck yet.
public static BufferedImage screenshot(){
BufferedImage capture = robot.createScreenCapture(screenSize);
return capture;
}
this is my screenshot, another bufferedimage is for example "compare", where the size of the compared image is smaller than the screenshot. how will I be able to check if the image contain the second image?
*For those who wondering, im trying to make a simple program that clicks a certain image once it pops up.

Get dimensions of objects within an image

i'm planning to build a web app where following feature is used:
Imagine uploading an image,
and the dimensions within the image need to be retrieved
e.g. I would like to know the height and width of the input field.
given the fact I can provide the base image sizes and aspect ratio's.
How would one go about getting the marked dimensions out of the given image?
is there an open API that could do this?
Is this even a possiblity?

Image Overlay With Coordinates

I recently have a project which invovles attempting to automatically "mock-up" images with a standard logo. For example, I have 1000 images of products, and I have one logo image that needs to be placed (over-layed) on top of each image. I know I can do this with ColdFusion's imageOverLay() function. However, I assume this always puts the overlayed image right in the middle of the underlying image (assuming they have the same width and height parameters). I was wondering if there was any way possible to specify and X/Y coordinate of the top-left corner of the overlaying image, and have the overlayed image placed in that location?
An example of a site:
http://www.internalsearch.expandedproductsearch.com/catalog/48/
You'll notice that all of the products have an image properly placed on the products. And I can assure you this wasn't done by hand. They must have a way to specifying where the overlaying image should go for each product, and then it just automatically puts the overlaying image (logo) in that spot. Can anyone think of any other way to do this? Is there some sort of advanced image library I could use with ColdFusion?
Any information would be greatly appreciated! Thank you.
I believe this got answered over on the Adobe forums and you are correct #Leigh; imagePaste was the solution.
I still can't comment on a question so posting this as an answer.

Very large images in web browser

We would like to display very large (50mb plus) images in Internet Explorer. We would like to avoid compression as compression algorithms are not what CSI would have us believe that they are and the resulting files are too lossy.
As a result, we have come up with two options: Silverlight Deep Zoom or a Flash based solution (such as Zoomify). The issue is that both of these require conversion to a tiled output and/or conversion to a specific file type (Zoomify supports a single proprietary file type, PFF).
What we are wondering is if a solution exists which will allow us to view the image without a conversion before hand.
PS: I know that you can write an application to tile the images (as needed or after the load process) and output them; however, we would like to do this without chopping up the file.
The tiled approach really is the right way to do it.
Your users don't want to download a 50mb file before they can start viewing the image. You don't want to spend the bandwidth to serve 50 megs to every user who might only view a fraction of your image.
If you serve the whole file, users will eventually be able to load and view it, but it won't run smoothly for most of them.
There is no simple non-tiled way to serve just a portion of an image unless you want to use a server-side library like imagemagik or PIL to extract a specific subset of the image for each user. You probably don't want to do that because it will place a significant load on your server.
Alternatively, you might use something like google's map tool to provide zooming and scaling. Some comments on doing that are available here:
http://webtide.wordpress.com/2008/08/27/custom-google-maps/
Take a look at OpenSeadragon. To make a image can work with OpenSeadragon, you should generate a zoomable image format which mentioned here. Then follow starting guide here
The browser isn't going to smoothly load a 50 meg file; if you don't chop it up, there's no reasonable way to make it not lag.
If you dont want to tile, you could have the server open the file and render a screen sized view of the image for display in the browser at the particular zoom resolution requested. This way you arent sending 50 meg files across the line when someone only wants to get an overview of the image. That is, the browser requests a set of coordinates and an output size in pixels, the server opens the larger image and creates a smaller image that fits the desired view, and sends that back to the web browser.
As far as compression, you say its too lossy, but if thats what you are seeing you are probably using the wrong compression algorithm or setting for the type of image you have. The jpg format has quality settings to control lossiness, and PNG compression is lossless (the pixels you get after decompressing are the exact values you had prior to compression). So consider changing what you are using as compression, and dont just rely on the default settings in an image editor.

Using opencv in Win32 application for image show

Is it possible to output images so that they all will be inside a single window?
Before, I used to output data using only opencv functions:
cvNamedWindow("Image 1");
cvShowImage("Image 1", img);
So I change image, then call: cvShowImage function and so on.
But If I want to look at more than one image, then every new image needs its own window to be shown there And what I want is to put every such an output opencv's window inside one big main window.
Is it possible to do it? And how?
You will have to construct a new image and place each img into it. I don't think there's a builtin function like MATLAB's subplot. I recommend using the ROI functions to quickly copy an image into a region-of-interest (ROI) of the big image (which holds the others).
You can show as many images as you want on a single window using hconcat function.
Let us suppose your original image was
Mat frame;
Now clone or make a copy of this image using
Mat frame1 = frame.clone();//or
Mat frame2;
frame.copyTo(frame1);
Now let us suppose your output images are
Mat img1,img2,img3,img4;
Now if you want to show images horizontally, use
hconcat(img1,img2,frame1)//hconcat(input_image1,input_image2,destination_image);
And if you want to show images vertically, use
frame2.push_back(img1);//main_image.push_back(image_to_be_shown_below);
This process processess images one at a time, so if you want to show 4 images side by side, you have to call this function 4 times as in
hconcat(img1,img2,frame1);
hconcat(frame1,img3,frame1);
hconcat(frame1,img4,frame1);
imshow("Final Image",frame1);
NOTE:
Clone process is done because the images have to be of same size.
Enjoy...

Resources