Thin plate spline transform gives solid color for certain inputs
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- opencv, python
調査の方向性
まず、test.png と報告されている Python 3.13.5 および OpenCV 4.12.0.88 のバージョンを使って、提供されている Python の再現コードを実行します。9点変換と8点変換を比較し、次に失敗がどこにあるかを判断して、9点恒等変換によって単色画像が生成されなくなったことを検証します。
索引モデルが issue の本文から書いたものです。
説明
Certain combinations of points for a thin plate spline transformation cause the transformed image to be one solid color. Removing the offending combination of points will cause the image to transform as expected.
Below is code that reads the attached image and applys a transformation which should do nothing to the image. The first transformation erroneously turns the whole image a single color. The second transformation uses one less point and correctly does nothing to the image. Im not sure what makes combinations of points not compatible with each other. The points in the code are outside of the uploaded image, since the points were originally being used on a much larger image. I can't upload that here due to file size restrictions. However behavior on the smaller image is the same. Versions are Python 3.13.5, opencv-contrib-python 4.12.0.88, opencv-python 4.12.0.88, Windows 10.
import cv2
import numpy
# Variable initilization
img = cv2.imread('test.png')
base_points = numpy.array([[ 121, 5213],
[6197, 5197],
[1627, 3481],
[3146, 3477],
[4668, 3473],
[1616, 1752],
[4655, 1744],
[6179, 1742],
[ 87, 29]])
# In this example a tps transformation is done.
# The input and output points are the same so the image shouldn't change.
# The whole image will be the color of the one of the corner pixels.
points = base_points[:]
points = points.reshape((-1,points.shape[0],2)).astype(numpy.int32)
tps = cv2.createThinPlateSplineShapeTransformer()
matches = [cv2.DMatch(i, i, 0) for i in range(points.shape[1])]
tps.estimateTransformation(points, points, matches)
warped1 = tps.warpImage(img)
cv2.imshow('Whole image is one color', warped1)
# This example uses one less point.
# The output is the input image, which is what would be expected.
points = base_points[1:]
points = points.reshape((-1,points.shape[0],2)).astype(numpy.int32)
tps = cv2.createThinPlateSplineShapeTransformer()
matches = [cv2.DMatch(i, i, 0) for i in range(points.shape[1])]
tps.estimateTransformation(points, points, matches)
warped2 = tps.warpImage(img)
cv2.imshow('Image is as expected', warped2)
cv2.waitKey(0)
Correct image:
Single color image:
- 主要言語
- Python
- スター
- 5.4k
- フォーク
- 1k
- 平均マージ
- 22時間 17分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opencv/opencv-python のほかの issue
-
[DOC] README file オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
opencv/opencv-python#1217 · コメント 3 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opencv/opencv-python#1165 · コメント 2 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
opencv/opencv-python#1273 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
opencv/opencv-python#1272 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
opencv/opencv-python#1268 · コメント 1 件 ·
opencv/opencv-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/Repo2RLEnv#163 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NousResearch/hermes-agent#121143 ·