Opencv template matching marking wrong spot in the source image in android - android

As i understand template matching finds areas of an image that match (are similar) to a template image (patch) according to
this
So i have two images of different dimension. And when i am trying to match my template image with the source image it usually marks the wrong area in the image.
Source Image
Template image
Output image
It works fine with threshold value if the images are of same dimension. What needs to be done to overcome this problem?? Or can i use template matching in this scenario??

Related

Match template picture on camera screen with actual image which is scanned through camera android

I am trying to develop an android app, that matches template picture on camera screen with actual image which is scanned through camera check image to get clarified
the four green circles on the template image appearing on camera screen should match with the four circles appearing in the background image which I will be scanning through the camera, exactly as shown in fig... once the four circles of template image matches with four circles of background image, a toast will get appeared
How to achieve this? i ve gone through openCV template matching, but couldnt achieve this..
Thanks :)
There are many algorithms in opencv used to match images. I recommend finding features and descriptors of the two images using sift or surf and use brute force matcher or falnn matcher. and check the good matches if there are enough good matches then the object is found and toast the message.
I would just try to find the four circles using HoughCircles and check their positions.
Parameter setting for HoughCircles will be a bit tricky, so try with different values until you see the stable result. The min/max Radius parameters should be as narrow as possible to save computing time and avoid invalid results.

Exception raised during rendering: Numbers of source Raster bands and source color space components do not match

I was trying to incorporate a image as a splash page for my android app. This image was created by one of my friends using photoshop. When I try to use this image as a background for my android application it says : "Exception raised during rendering: Numbers of source Raster bands and source color space components do not match" . Is there a way to fix this image non programatically, i.e. using photoshop or any other tools. If not is there any thing which can be done programatically.
This most probably is due to Bit Depth Field may be or any other image related properties because of which Eclipse IDE/ ADT is not able to render the image into ImageView.
The work around i use to convert same image into other format, In my case image was image.jpg which I converted to image.png using the Online Image Editor - Pixlr Editor
Hope this helps!!

how can i highlight image in android

My Android application have to show an image include 16 parts that download from server (for example the human
body), the user can touch some specific part of this image (for
example the head or the stomach) and this part have to be highlight in
some way (for example by displaying a dark - transparent layer around the image so
the highlight image can see clearly )
So how can I highlight an image when still loading the other images .
And can I support it from 2.1OS .
Thanks in advance !
Sorry for my poor english !
If your big image exists from smaller pics, Java has a class named MosaicDescriptor
The "Mosaic" operation creates a mosaic of two or more source images. This operation could be used for example to assemble a set of overlapping geospatially rectified images into a contiguous image. It could also be used to create a montage of photographs such as a panorama.
All source images are assumed to have been geometrically mapped into a common coordinate space. The origin (minX, minY) of each image is therefore taken to represent the location of the respective image in the common coordinate system of the source images. This coordinate space will also be that of the destination image.
Detail and reference

android background image problem

I am trying to set an image as background. I edit the xml layout file. But when i put the image on the drawable folder, it gives an error on the project name. What is the problem? Is it related to size of image? How much is the biggest size for image that android can run?
Probably your image name is incorrect , resource items cant have numbers , special characters ( _ is fine ) & upper case characters.
Image Size never give Errors, Format of the size will give the error.. Check the valid format..
If you upload the bigsize image , it display only small portion from Display.getWidth to Display.GetHeight position.

How to find the co-ordinates of the transparent area of an .png image

In my application I use an image . I made some portion of the image transparent. Now How can I find the co-ordinates of the transparent portion of the image so that I am able to find the actual area of the non-transparent area.
I don't know the android SDK, but I doubt it has image manipulaiton built in. so using what ever language you are in, you need to open the image as data. Hopefully you can use an image library that will perform things like getting the size of the image. This will let you access the raw pixel data, which you can then check though till you find a pixel whos transparency is not equal to zero.
finding it in the rows is fairly easy, but the columns will take a bit more work. Remember that pixel data will be accessed as an array of length width * height in pixels.

Categories

Resources