how to flip a segmented image along the major axis

12 Ansichten (letzte 30 Tage)
narayana reddy
narayana reddy am 7 Feb. 2016
Kommentiert: Image Analyst am 21 Mär. 2018
I and my friends are doing project on skin cancer detection using image processing, We completed upto segmentation, now we have to find area of non overlapped region of the segmented image.For this we have to flip the image along its major axis andminor axis. so please help us in this matter.
Advance thanks.
  2 Kommentare
James Morris
James Morris am 19 Mär. 2018
Bearbeitet: James Morris am 19 Mär. 2018
Hi, I have used (and slightly edited) your code to rotate and center my own skin lesions, but I am now struggling on being able to fold it along the X axis, and calculate the difference between the 2 overlapping areas. I need to show the overlapping regions in an image, furthermore I need to also be able sum the differences of the overlapping area, as this data needs to go into a classifier. I have linked my image of what I have so far, and also my code. Any guidance on how to solve my issue will be greatly appreciated. Thanks.
Image Analyst
Image Analyst am 19 Mär. 2018
See my answer below Just sum the images if you need a pixel count:
sum1 = sum(overlapped(:));
sum2 = sum(nonOverlapped(:));

Melden Sie sich an, um zu kommentieren.

Antworten (4)

Image Analyst
Image Analyst am 26 Feb. 2017
I gave you the initial part of the code already but it appears you need more help so here's some more. See attached m-file below the image. I don't know how you got a very high value for the orientation - I get 14 degrees. The only remaining part you asked for is " we have to flip the image along its major axis" and for that you can use flipud(rotatedImage) - very simple.
  29 Kommentare
Hannah Gabrielle Alagon
Hannah Gabrielle Alagon am 23 Okt. 2017
Hello. can someone help on how to do this image below.
Image Analyst
Image Analyst am 23 Okt. 2017
I don't know what help you need beyond the code that I attached. Be more specific.

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 7 Feb. 2016
Bearbeitet: Image Analyst am 7 Feb. 2016
First align the image so that the major axis is horizontal (or vertical) with imrotate(). Then use imtranslate() to put the center line at the center of the image. Then use flipud (or fliplr) and AND or XOR them together
rotatedBinary = imrotate(binaryImage, angle);
rotatedBinary = imtranslate(rotatedBinary,.....
flipped = flipud(rotatedBinary);
overlapped = flipped & rotatedBinary;
nonOverlapped = xor(flipped, rotatedBinary);
I'm hoping you can find the angle yourself (it comes from Orientation in regionprops), and can find the amount of lines to translate it (it also comes from Centroid in regionprops)
  4 Kommentare
narayana reddy
narayana reddy am 26 Feb. 2016
Orientation which is obtained by regionprops is very high, with this value the image is not looking straight. please help me
anastasia
anastasia am 26 Feb. 2017
how to find the major axis initially and then align it using imtranslate()? Please help with the initial part of the code.

Melden Sie sich an, um zu kommentieren.


sandeep kumar
sandeep kumar am 25 Nov. 2017
Bearbeitet: sandeep kumar am 25 Nov. 2017
Image Analyst I implemented your code testGrayimage.m but iam not able to get a proper segmented image iam attaching below the images, in fig.(1) the inner blob is suppose to be the lesion area but it is selecting the outerleft arc please help ..
  4 Kommentare
sandeep kumar
sandeep kumar am 26 Nov. 2017
Bearbeitet: sandeep kumar am 26 Nov. 2017
sir images vary in sizes some are bigger some are smaller some has intense blob while in some images their is a very less difference between lesion and skin intensity. sir is there any way that out of all the regions in the binaryImage it could only select a region which is may be say circular or elliptical in shape like in above fig can we select only the inner blob and also in the fig attached
Image Analyst
Image Analyst am 26 Nov. 2017
Yes, you can do background division with the / symbol, but you'd need a snapshot of a totally uniform image, like I said. Divide the background image by the max value to get a "percentage image", then divide your sample image by the percentage image and rescale. I'm attaching a demo of a different background correction method.
Why don't you just call imclearborder to get rid of blobs touching the border? It just treats the symptom, not the cause, but I don't think you're skilled enough yet to do a proper background correction.

Melden Sie sich an, um zu kommentieren.


James Morris
James Morris am 21 Mär. 2018
Hi image analyst, from the matlab file you posted, you rotated and calculated the area difference along the x axis. I was just wondering if you could show and explain how to do it along the Y axis too?

Community Treasure Hunt

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

Start Hunting!

Translated by