using surffeaturedetector, findHomography() to find a match [closed]

asked 2015-03-04 19:28:25 -0500

pingping__ gravatar image

updated 2015-04-01 17:28:42 -0500

i have an image where i want to remove the center only. how can i do so?

i played around with this tutorial. at first i found a match but that was when i used 2.4. I switched over to 3.0 and even if i followed the tutorial and changed some syntax for 3.0, it doesnt find the right match.

the only things ive changed from the tutorial is

// this
SurfFeatureD`enter code here`etector detector( minHessian );
// to this
Ptr<SurfFeatureDetector> detector = SURF::create(minHessian);

//and this
SurfDescriptorExtractor extractor;
// to this
Ptr<SurfDescriptorExtractor> extractor = SURF::create();


int minHessian = 400;

im not sure if im instantiating it right or not. thanks in advance!

EDIT: So say i have an image like this

image description

and I want to get something like this, where the lines come to a point image description

note: opencv 3.0 beta, qt, windows 8.1

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-06 07:40:22.659916


Could you please add samples of your case? It is very unclear now what you are trying to achieve...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-06 02:39:10 -0500 )edit

@StevenPuttemans yes, sorry about that. say i have a irregular shaped center (like a blob) with non straight lines coming out from the side (like sun rays). what i want to do is to remove that blob. since im new to opencv, i thought of maybe finding a match using that tutorial and then somehow remove that blob (range of that center would be given where the lines are drawn). thats what I want to achieve.. not sure if its possible though.

pingping__ gravatar imagepingping__ ( 2015-03-08 22:09:26 -0500 )edit

Again, pictures say more than a thousand words! It is still not clear to me what you are trying to achieve. Make it visual!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-09 04:48:00 -0500 )edit

@StevenPuttemans sorry for the late reply Dx. i added images. is there a way to do something like that? thanks!

pingping__ gravatar imagepingping__ ( 2015-03-31 23:32:48 -0500 )edit

Hmm that doesn't seems easy, let me think about it!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-01 03:23:33 -0500 )edit
pingping__ gravatar imagepingping__ ( 2015-04-01 03:43:19 -0500 )edit

@pingping__ i think you could do something like this. First step should be to segment the blob which is clearly thicker than the lines itself. For this I would suggest

  1. Binarize the image
  2. Perform morphological operations erosion and dilation to ensure that the tailings are removed but the center blob is kept.
  3. Apply findContours on that binary resulting image.
  4. This will return you a blob region that can now be used as a binary mask for further operations.
StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-02 02:28:38 -0500 )edit

Now the difficult part arrives, where you have to combine the original image and the blob to extend the rays. For this I would follow

  1. Start with removing all pixels from the original image that are inside the mask of the blob
  2. Define the center point of the blob
  3. Apply binarization and skeletization to the image which will yield single pixel long rays
  4. Now traverse the different rays and extend them towards the middle point.

This will yield extended rays that are straight lines, but there is no other way or irregularly shaping them. I do acknowledge that some steps are concepts and are not that easy to implement, like the ray tracing and skeletization but it should be possible in OpenCV!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-04-02 02:30:00 -0500 )edit

@StevenPuttemans thanks! ill give it a try!

pingping__ gravatar imagepingping__ ( 2015-04-02 03:53:43 -0500 )edit