I have a set of images which need to be filtered by different filters. So I have made an interface in which the user can choose his or her filter. However I now want to manipulate the degree of the filter. Meanfilter[imagedata, {1,2,3 etc.)]. I now have a working manipulate:
Manipulate[ArrayPlot[MedianFilter[imageDataOr, i]], {i, 0, 10, 1}]
but the image does not refresh when I use it in a graphical user interface. The code is:
outM = DialogInput[{
TextCell["Adjust filter you want to use"],
Row[{Manipulate[
ArrayPlot[MedianFilter[imageDataOr, i]], {i, 0, 10, 1}]}],
Button["Continue", DialogReturn[1]]}];
image=Import["https://i.sstatic.net/Ekhbd.jpg"];
imageDataOr=ImageData[image]
]
EDIT: You have to grayscale the image.
To be specific. When I use the slider everything works fine, but when I click on a specific point it does not refresh
The solution is now:
butOut = DialogInput[{
TextCell["Choose the filter you want to use"],
Button["Median Filter", DialogReturn[1]]}];
If[butOut == 1, outM = DialogInput[{
TextCell["Adjust filter you want to use"],
Row[{Manipulate[
ArrayPlot[
ImageData@MedianFilter[Image[imageDataOr], ManipulateI],
PreserveImageOptions -> False], {{ManipulateI, 1, "t1"}, 0,
10, 1}, SynchronousUpdating -> True,
LocalizeVariables -> False],
Manipulate[
ArrayPlot[
ImageData@MedianFilter[Image[imageDataOr], ManipulateJ],
PreserveImageOptions -> False], {{ManipulateJ, 1, "t2"}, 0,
10, 1},
SynchronousUpdating -> True, LocalizeVariables -> False]}],
Button["Continue", DialogReturn[1]]}];
originalCorrected = MedianFilter[imageDataOr, ManipulateI];
movedCorrected = MedianFilter[imageDataMo, ManipulateJ];
];
Kind regards,
Glenn