Using multiple convolutions at once

조회 수: 1 (최근 30일)
Peter Zaki
Peter Zaki 2022년 5월 12일
답변: Milan Bansal 2023년 9월 21일
Hello,
I'm working on a computer vision project, and I am using conv2 function as follows
Fx = conv2(input_image, Mx, 'same');
Fy = conv2(input_image, My, 'same');
Can I have Fx and Fy just by using one line of code?
Thanks in advance

답변 (1개)

Milan Bansal
Milan Bansal 2023년 9월 21일
Hi,
As per my understanding, you want to perform two convolutions at once and store the respective outputs in "Fx" and "Fy" variables in a single line of code.
It is possible to do so by using the "deal" function in MATLAB as shown below.
[Fx, Fy] = deal(conv2(input_image, Mx, 'same'), conv2(input_image, My, 'same'));
Refer to documentation link to learn more about "deal" function.
Hope it helps!

카테고리

Help CenterFile Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by