I have a jpg image that I want to do lat on.
The command I ran is following: convert img.jpg +compress -colorspace Gray -lat 17 img_lat.tif
The output image is grayscale, instead of binary. Please see the images at the links.
https://drive.google.com/file/d/0B1YGJ1 ... sp=sharing
https://drive.google.com/file/d/0B1YGJ1 ... sp=sharing
Please advice!
-lat doesn't give binary image
-
- Posts: 8
- Joined: 2015-03-13T14:35:09-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -lat doesn't give binary image
try
-lat 17x17+X%
where X is larger than zero.
If you use 0, then it will not seem to do the lat. If X is too small, you will get a lot of noise.
This seems OK to me, but you can vary the X.
What version of IM and what platform are you using?
-lat 17x17+X%
where X is larger than zero.
If you use 0, then it will not seem to do the lat. If X is too small, you will get a lot of noise.
This seems OK to me, but you can vary the X.
Code: Select all
convert Image_01.jpg +compress -colorspace Gray -lat 17x17+5% img_lat.tif
What version of IM and what platform are you using?
-
- Posts: 8
- Joined: 2015-03-13T14:35:09-07:00
- Authentication code: 6789
Re: -lat doesn't give binary image
-lat 17x17+1% gives binary output. Thanks a lot! Any suggestions why the difference?
I am using IM-6.7.8 on linux.
I am using IM-6.7.8 on linux.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -lat doesn't give binary image
If you use 0, then it will not seem to do the lat. If X is too small, you will get a lot of noise.
This seems OK to me, but you can vary the X.
This seems OK to me, but you can vary the X.
Code: Select all
convert Image_01.jpg +compress -colorspace Gray -lat 17x17+5% img_lat.tif
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -lat doesn't give binary image
If you want to see more solid regions, then make your window size (17) larger. Try 25x25 and see the difference. If the window is larger than the largest region, then all of them should be more solid.
-
- Posts: 8
- Joined: 2015-03-13T14:35:09-07:00
- Authentication code: 6789
Re: -lat doesn't give binary image
Yes, I increased the window size to 35. Looks good. Out of curiosity: why is lat not appropriately performed when input X is omitted?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -lat doesn't give binary image
I do not know for sure, but I assume the default is 0. I can only assume that is a bug. But using 0 will produce too much noise anyway and so not terribly useful. You can report that on the Bugs forum if you wish.