Skip to content

Segfault on morphologyEx for images with width 1 #22893

@marcoffee

Description

@marcoffee

System Information

OpenCV python version: 4.6.0.66
Operating System / Platform: Ubuntu 20.04
Python version: 3.10.8
CPU Arch: aarch64
CPU Model: Neoverse-N1

Detailed description

When I try to run cv2.morphologyEx on a image with width 1 and kernel with width > 1, I get a segmentation fault error.
This happens specifically on aarch64 machines (I tried on a x86_64 and it worked fine)

Steps to reproduce

import cv2
import numpy as np

img = np.zeros(( 4, 1 ), np.uint8)
kernel = cv2.getStructuringElement(cv2.MORPH_RECT, ( 4, 4 ))
cv2.morphologyEx(img, cv2.MORPH_DILATE, kernel)

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Labels

bugcategory: imgprocconfirmedThere is stable reproducer / investigation completeplatform: armARM boards related issues: RPi, NVIDIA TK/TX, etc

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions