find the edge of image with the help of axis(x,y) in opencv in android

asked 2015-06-18 06:23:48 -0500

prabhakar gravatar image

updated 2019-10-09 20:14:49 -0500

supra56 gravatar image

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.

edit retag flag offensive close merge delete

Comments

3

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 gravatar imageStevenPuttemans ( 2015-06-18 09:44:32 -0500 )edit

@StevenPuttemans now i have improve my question

prabhakar gravatar imageprabhakar ( 2015-06-19 02:42:09 -0500 )edit

@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 ?

berak gravatar imageberak ( 2015-06-19 02:53:02 -0500 )edit
1

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 gravatar imageberak ( 2015-06-19 07:17:59 -0500 )edit

@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...

prabhakar gravatar imageprabhakar ( 2015-06-24 23:42:01 -0500 )edit
1

just saying, - asking on SO will not help you here

berak gravatar imageberak ( 2015-06-29 02:51:51 -0500 )edit