-
Notifications
You must be signed in to change notification settings - Fork 9
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
BilateralFilter function #4
Comments
Here is some feedback on each of your three questions from one of our group members:
|
@fbrill3,
The size of the first dimension should be randomly chosen from the range [1,2]. Why is it chosen from the range [1,20]? Out_count is number of all cells in the tensor. But why you have this implementation for input tensors of 2 or 3 dimensions?
In addition to 2nd paragraph, this loop means that the whole tensor is processed identically. Why in calculation of weights instead of values from radiometric space there are always taken values of color space? Example: |
@egorovp , thanks for the follow-up; we'll review and get back. |
@egorovp , on further review, we agree that the sample implementation and CTS do not fully/correctly implement the spec, and they need to be updated. We will reply to the specific issues you point out shortly. |
Here are some responses to your latest questions.
You are correct, the first dimension can only have a value of 1 or 2 as per the spec. CTS and Sample code is incorrect in choosing a range of [1,20]. We will correct it in the next release.
The handling of 3-dimensional tensor is not complete and accurate. First, as you noted the first dimension is limited to size of 1 or 2 only. Second, the bilateral filtering of each plane, that is [1, y, z] or [2, y, z], should be done by processing the relevant pixels/data in the second and third dimension of the tensor. The pixels should not be combined across the planes (Not sure if there could be variations of this in other implementations. E.g. OpenCV for RGB could be combining RGB value into a combination for processing – to be verified). See the explanation to your item 3 below for more on this. This is just clarification. In the diagram you have provided, for a Border mode of ‘undefined’ it does not matter whether the edge pixels are processed or not. The value of these pixels is not relevant for testing the output. In present implementation, the 1-D (1x5) kernel ignores the first few columns (size of radius) of the first row and the last few columns of the last row. It processes the first and last few columns for each row in between. It could have been chosen to ignore these columns as well but for a border mode ‘undefined’ these pixels are irrelevant. We are in process of updating the code to make this ‘kernel’ 2-D (5x5) and process the 2D tensor the same way as currently.
We will check if the processing of 3D tensor is being performed correctly and fix any shortcomings. To clarify the shortcoming here is the explanation: The spec states that the first dimension containing radiometric info can be used for multiple types of info (color, depth or movement). But it does not clarify what the expected behavior is for each of this radiometric space, which theoretically can differ based on implementation or the purpose of the application. The planes along the first dimension could be treated entirely independent and bilateral filter applied on each of them separately. Alternatively, an implementation may use some combination of the values in different planes and use a combination value as radiometric/spatial value. As a reference, for color space (e.g. RGB), OpenCV has an implementation that can be used to model the OpenVX handling of the color image planes for bilateral filtering. Additional formats for which there are no well-defined usage (e.g. depth, movement etc) an optional/no guidance should be provided by spec. It must be confirmed though if OpenCV RGB image/3-channel layout can be seamlessly adopted by OpenVX given its tensor structure has a required dimension order [radiometric, width, height]. For the above the OpenVX group will work on providing a clear implementation and conformance test guideline and make it available in future releases (post 1.3 spec version as the 1.3 version is already frozen for release) |
@fbrill3, thank you for all your responses. Looking forward to new releases. |
Problem
In case of 3 dimensions the size of the first dimension can be 1 or 2.
Why it can be changed from 1 to 20 in CTS?
Weight for every pixel in the window depends on the distance to the center of the window and on the difference in radiometric space between these two pixels.
Why is radiometric space ignored in CTS?
Links
The text was updated successfully, but these errors were encountered: