English 中文(简体)
用于在特索尔流中进行梯度计算的2x2焦耳,与罗伯茨交叉过滤器有何不同?
原标题:What is the 2x2 kernel used for gradient calculation in Tensorflow, and is it different from Roberts cross filter?

我有一个问题,如何在TensorFlow中使用2x2内核获得梯度。

I’m studying KIND[1] and KIND++[2] paper. In this paper, they get gradient by using kernel_x and kernel_y and their shape is 2x2. In code, as follow :

kernel_x = tf.reshape(tf.constant([[0, 0], [-1, 1]], tf.float32), [2, 2, 1, 1])
kernel_y = tf.transpose(kernel_x, [1, 0, 2, 3])
gradient_orig = tf.abs(tf.nn.conv2d(input_tensor, kernel, strides=[1, 1, 1, 1], padding= SAME ))

In my knowledge, usual 2x2 derivative filter is Roberts cross as follow. Roberts cross

I use Pytorch, so I can’t understand the Tensorflow’s kernel shape exactly.
Is it same kernel or not? It seems [0,0],[-1,1] in code but Roberts cross has [1,0],[0,-1].
Please give me some information. Thanks.

[1] Y. Zhang et al. Kindling the Darkness: a Practical Low-light Image Enhancer. ACMMM 2019
[2] Y. Zhang et al. Beyond Brightening Low-light Images. IJCV 2021

我只是在查看Tensorflow文档,但是文档中的内核形状和代码中似乎不同。

问题回答

暂无回答




相关问题
Calculating corresponding pixels

I have a computer vision set up with two cameras. One of this cameras is a time of flight camera. It gives me the depth of the scene at every pixel. The other camera is standard camera giving me a ...

Image comparison algorithm

I m trying to compare images to each other to find out whether they are different. First I tried to make a Pearson correleation of the RGB values, which works also quite good unless the pictures are a ...

How to recognize rectangles in this image?

I have a image with horizontal and vertical lines. In fact, this image is the BBC website converted to horizontal and vertical lines. My problem is that I want to be able to find all the rectangles in ...

Resources for Image Recognition

I am looking for a recommendation for an introduction to image processing algorithms (face and shape recognition, etc.) and wondered if anyone had an good recommendations, either for books, ...

How to programmatically disable the auto-focus of a webcam?

I am trying to do computer vision using a webcam (the model is Hercules Dualpix). I know it is not the ideal camera to use, but I have no choice here. The problem is the auto-focus makes it hard/...

Computing object statistics from the second central moments

I m currently working on writing a version of the MATLAB RegionProps function for GNU Octave. I have most of it implemented, but I m still struggling with the implementation of a few parts. I had ...

Viola-Jones face detection claims 180k features

I ve been implementing an adaptation of Viola-Jones face detection algorithm. The technique relies upon placing a subframe of 24x24 pixels within an image, and subsequently placing rectangular ...

Face detection and comparison

I m running a small research on face detection and comparison for my article. Currently, I m using rapid face detection based on haar like features based on OpenCV cascade (I ll implement learning ...

热门标签