Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix upConv usage #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dskkato
Copy link

@dskkato dskkato commented Jun 19, 2022

This patch will solve the problem reported in #4.

As the help of upConv says:

>> help upConv
  RES = upConv(IM, FILT, EDGES, STEP, START, STOP, RES)

  ...
  RES is an optional result matrix.  The convolution result will be
  destructively added into this matrix.  If this argument is passed, the
  result matrix will not be returned. DO NOT USE THIS ARGUMENT IF
  YOU DO NOT UNDERSTAND WHAT THIS MEANS!!
  ...

So, what you can do here is to modify the code:

  1. Not to pass the RES input argument
  2. Not to receive the RES output argument

The problem with the following code is that res exists both on the left side and right side.

res = upConv( subMtx(pyr, pind(1,:)), hi0filt, edges, [1 1], [1 1], size(res), res);

According to the upConv usage in reconSpyr.m, and reconSpyrLevs.m, the res variable is created in proper size and type, so you should omit the left side res output argument.

As the help of `upConv` says:
```
>> help upConv
  RES = upConv(IM, FILT, EDGES, STEP, START, STOP, RES)

  ...
  RES is an optional result matrix.  The convolution result will be
  destructively added into this matrix.  If this argument is passed, the
  result matrix will not be returned. DO NOT USE THIS ARGUMENT IF
  YOU DO NOT UNDERSTAND WHAT THIS MEANS!!
  ...
```

So, what you can do here is to modify the code:

1. Not to pass the `RES` input argument
2. Not to receive the `RES` output argument

The problem with the following code is that `res` exists both on the left side and right side.

https://github.com/LabForComputationalVision/matlabPyrTools/blob/42e4602dd06a36282b16123e7f587c08f397b272/reconSpyr.m#L94

According to the `upConv` usage in reconSpyr.m, and reconSpyrLevs.m, the `res` variable is created in proper size and type, so you should omit the left side `res` output argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant