how can I change Location values in a MSERRegions object?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (3)
Philip Caplan
el 15 de Abr. de 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 comentarios
Dima Lisin
el 16 de Abr. de 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 comentarios
Ver también
Categorías
Más información sobre Computer Vision with Simulink en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!