how can I change Location values in a MSERRegions object?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
how can I change Location values in a MSERRegions object?
When I try following: matchedPoints1.Location = bsxfun(@plus, matchedPoints1.Location, newOrigin1); (where: matchedPoints1 1819x1 9757252 MSERRegions) ... I get following error: Read-only properties of an MSERRegions object cannot be modified.
kind regards Gerard
댓글 수: 0
답변 (3개)
Philip Caplan
2015년 4월 15일
Unfortunately, the 'Location' property of "MSERRegions" objects is read-only. Can you explain why you need to change this property? The only reason I can think of is to subsequently plot the regions after detecting features. If this is the case, I would suggest looking at the source code for the "plot" function for "MSERREgions":
>> edit MSERRegions
and scroll down to the plot function. You can then copy this code and create your own "shiftedMSERPlot" function which can account for the shifted origin. If this is not your intention, please describe why you would like to change the 'Location' property.
댓글 수: 0
Dima Lisin
2015년 4월 16일
Hi Gerard,
For the purposes of that example all you need are the x,y locations of points. So instead of
matchedPoints1.Location = bsxfun(@plus, matchedPoints1.Location, newOrigin1);
you can simply use
newLocation = bsxfun(@plus, matchedPoints1.Location, newOrigin1);
newLocation will be an M-by-2 matrix of (x,y) coordinates.
Also, if you set the 'OutputView' parameters of undistortImage to 'same', then you will not need to adjust the coordinates at all. The undistorted image will be same size as the original image, so newOrigin will be 0. 'Full' output view is useful to avoid losing too many pixels in cases of severe distortion. If your image is not too distorted, then 'same' may be ok, and it will simplify your code.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!