hello i have some binary image i found the orientation and rotated the image
stats1 = regionprops(bw,'Orientation','Area');
bwRot=imrotate(bw,-stats1.Orientation);
after finding some interesting pixels i want to find their locations in the original image i create the matrix and try to rotate back but recive negative coordinates any help ,,
You need to call imrotate with the 'crop' option to preserve the size of the input image.
As for the negative xy, it is possible for a rotation to bring points in/out of the image field of view. That's the whole reason why imrotate has the 'crop' option to begin with.
Be mindful as well that imrotate's origin of rotation is at the center of the image. However, the BoundingBox coordinates are relative to an origin at the upper left corner of the image.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.