find the edge of image with the help of axis(x,y) in opencv in android [closed]
I have to color the object when it touched. For that follow the some basic concepts: I am getting coordinates of that portion where object is touched. After that I have to find the edges of touched object. Then fill color of that object. here I get the coordinates of touched portion.
int cols = mRgba.cols();
int rows = mRgba.rows();
int xOffset = (mOpenCvCameraView.getWidth() - cols) / 2;
int yOffset = (mOpenCvCameraView.getHeight() - rows) / 2;
int x = (int)event.getX() - xOffset;
int y = (int)event.getY() - yOffset;
x,y shows the coordinates of the touched portion but problem is to find the corners of object. For corners i use canny() method of opencv But no idea how to implement it by coding in opencv in android.
I am probably not the only one who doesn't grasp what you are trying to do and I should definetly suggest you to improve your question and add more information. A good starting point can be to take a look at the FAQ.
@StevenPuttemans now i have improve my question
@prabhkar , i still don't get it either.
you calculation is the transformation from screen-coords to imge coords, so far so good.
what do you mean by 'axis' ? how is it related to canny ? what are you trying to achieve in the end ?
Canny will only highlight the edges in your image. you need findContours() to get the outlines as lists of contour points. then use floodFill() or similar to draw colors.
have a look at the clolor blob android example
@berak, it may be, I use wrong concept. Actually i want to implement, when i touch the object in image i want to get the edges of the object. for full description http://stackoverflow.com/questions/30...
just saying, - asking on SO will not help you here