how can I change Location values in a MSERRegions object?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (3)
Philip Caplan
il 15 Apr 2015
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 Commenti
Dima Lisin
il 16 Apr 2015
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 Commenti
Vedere anche
Categorie
Scopri di più su Computer Vision with Simulink in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!