kev946 / aforge

Automatically exported from code.google.com/p/aforge
0 stars 0 forks source link

Perform SimpleQuadrilateralTransformation on entire image. #147

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm not sure if that's a great summary, but the desired effect is that I be 
allowed to specify a quadrilateral that extends beyond the source image, so 
SimpleQuadrilateralTransformation does not lose information near interesting 
image edges.

Granted, this might be a task for BackwardQuadrilateralTransformation, but then 
I'd have to figure out the desired target quadrilateral instead, and I figured 
adjusting SimpleQuadrilateralTransformation would be easier than figuring out 
the target.

My patch is attached; I've tested it on grayscale images both with and without 
interpolation.

Original issue reported on code.google.com by dales...@gmail.com on 20 Aug 2010 at 6:12

Attachments:

GoogleCodeExporter commented 8 years ago
Funny :) You just created an issue for something, which was not yet released :) 
Seems like you don't mind working with trunk.

Original comment by andrew.k...@gmail.com on 20 Aug 2010 at 6:15

GoogleCodeExporter commented 8 years ago
It seem like you have a bit interesting use case. Would be nice if you could 
clarify your idea a bit ...

In most cases Quadrilateral Transformation is used to extract an object, which 
was previously detected using Blob Counter, for example, and its 4 corners were 
found using Find Quadrilateral Corner routine (or Quadrilateral Finder).  So we 
first find object, then extract it and finally do further processing of it. So 
object is always part of the image.

But in your case you get on object with corners outside of the image somehow.  
Understand that you can find on object, which inside of image or right on its 
edge. And then you may want to extend its corners a bit to include some more 
information. Interesting, which logic do you use for extending corners? 
Something simple like X+1 and Y+1 (etc) may easily break quadrilateral ... So 
it really would be interesting to understand better the use case.

Original comment by andrew.k...@gmail.com on 23 Aug 2010 at 6:42

GoogleCodeExporter commented 8 years ago
In my case, I get a quadrilateral by inspecting an image of a known target, 
which is near the center of the image and about half the image's linear size, 
but not parallel to the camera's film plane. The target is known to be 
rectangular, so I can use it to determine the extent of perspective distortion 
present.

I then take more images, de-perspective, and process to identify unknown 
objects. These unknown objects may be larger than the target, so I extend the 
quadrilateral by doubling the distance between the known target corners and the 
center of the image, while preserving direction. The target is not quite 
centered, so the top two corners of the extended quadrilateral end up above the 
top of the image.

(I haven't mathematically proven the correctness of that method of extending 
the quad, but it passes a few quick thought-experiment sanity-checks.)

Original comment by dales...@gmail.com on 24 Aug 2010 at 12:32

GoogleCodeExporter commented 8 years ago
Extending quadrilateral transformation classes, so the allow to specify 
quadrilateral which is partially outside of source/destination image.

Committed in revision 1307. Will be released in version 2.1.4.

Original comment by andrew.k...@gmail.com on 26 Aug 2010 at 1:35

GoogleCodeExporter commented 8 years ago

Original comment by andrew.k...@gmail.com on 1 Sep 2010 at 7:02