Error in cvimgwarp.cpp (Bug #245)


Added by Clark Taylor almost 15 years ago. Updated almost 15 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:imgproc, video
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

This bug manifests itself when attempting to create mosaics. The
first image being warped to a mosaic will be just fine, but the second image will
replicate itself beyond its borders. This is an error in the way that
BORDER_TRANSPARENT is handled. The error is in lines 2054 to 2058. It
currently reads:

else if( borderType == BORDER_TRANSPARENT &&
(unsigned)sx >= (unsigned)(ssize.width-1) &&
(unsigned)sy >= (unsigned)(ssize.height-1))
continue;

while it should read:

else if( borderType == BORDER_TRANSPARENT &&
((unsigned)sx >= (unsigned)(ssize.width-1) ||
(unsigned)sy >= (unsigned)(ssize.height-1)))
continue;

As you can see, it is just a simple boolean logic error, but it has some pretty
profound effects when trying to warp to a pre-existing image. Please feel free
to contact me if there are any questions (or if there is another way to fix this
bug.)

Clark Taylor


Associated revisions

Revision dbe8dc22
Added by Vadim Pisarevsky almost 10 years ago

Merge pull request #245 from Ashod:jp2

History

Updated by Clark Taylor almost 15 years ago

Replying to cntaylor:
Sorry, I should have put the code in the proper format for posting on a wiki. Let me try the code snippets again.

It currently reads:

                            else if( borderType == BORDER_TRANSPARENT &&
                                (unsigned)sx >= (unsigned)(ssize.width-1) &&
                                (unsigned)sy >= (unsigned)(ssize.height-1))
                                continue;

while it should read:
                            else if( borderType == BORDER_TRANSPARENT &&
                                ((unsigned)sx >= (unsigned)(ssize.width-1) ||
                                (unsigned)sy >= (unsigned)(ssize.height-1)))
                                continue;

Clark Taylor

Updated by Clark Taylor almost 15 years ago

Looking through the tickets, I believe this is the same error as discussed in ticket #195: "WarpPerspective: add some mirrors of the input image"

Hope this is helpful.

Clark

Replying to [comment:1 cntaylor]:

Replying to cntaylor:
Sorry, I should have put the code in the proper format for posting on a wiki. Let me try the code snippets again.

It currently reads:

>                             else if( borderType == BORDER_TRANSPARENT &&
>                                 (unsigned)sx >= (unsigned)(ssize.width-1) &&
>                                 (unsigned)sy >= (unsigned)(ssize.height-1))
>                                 continue;

while it should read:

>                             else if( borderType == BORDER_TRANSPARENT &&
>                                 ((unsigned)sx >= (unsigned)(ssize.width-1) ||
>                                 (unsigned)sy >= (unsigned)(ssize.height-1)))
>                                 continue;
> 

Clark Taylor

Updated by anonymous - almost 15 years ago

thanks! your patch is put to SVN, r2975

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF