How to extract rectangular patches from a rotated rectangle?

조회 수: 1 (최근 30일)
martaR
martaR 2016년 4월 5일
편집: martaR 2017년 2월 10일
Hi everyone,
I have to extract LBP features from a rotated rectangle section of an image. Since the extractLBPFeatures function takes as an input a NxM matrix, I thought about rotating my image to get an axis aligned rectangle. In the case of the image below I still get slanted edges because parts of the rectangle are out of the image.
So I though about creating small axis aligned rectangular patches to cover the maximum possible area of the rotate rectangle. I wasn't able to find such an alghoritm. Do you know any implementations?
Do you have any other idea how to extract the LBP features from the rotated rectangle?
Thank you in advance!
M

답변 (2개)

Kuifeng
Kuifeng 2016년 4월 5일
% top figure
% 1. edge finding, find the two parallel long lines
% 2. use polyfit to fit the slope of the longer line
% 3. draw the lines passing the top corner perpendicular to long line
% note Slope_longEdge * Slope_shortEdge = -1;
  댓글 수: 1
martaR
martaR 2016년 4월 5일
편집: martaR 2016년 4월 5일
Thank you for your answer.
My problem is that the extractLBPFeatures function accept as an input the grayscale values of pixels in a matrix form (axis aligned MxN).
If I keep the rectangle slanted as you're suggesting I would have to input something like pixels:
(1,1)
(2,1) (2,2)
(3,1) (3,2) (3,3)
if my edge is rotated by 45 degrees. This is not possible.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 4월 5일
Attached is my demo of local binary pattern of an image. Adapt as needed.

카테고리

Help CenterFile Exchange에서 Code Generation, GPU, and Third-Party Support에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by