get upper and lower limit from imcontrast

I’m using imcontrast to adjust the histogram of one image, once I’m satisfied with the result, I would like to apply the same transformation to a set of images. I’m using multiple callbacks so the Idea is to get the limits pass it on to the next callback and use imadjust to do the operation. here is my code so far

if true
function adjust_contrast_Callback(hObject, eventdata, handles)
axes(handles.axes1);
h = imshow(handles.I);
dbh = imcontrast(handles.figure1);
set(dbh, 'CloseRequestFcn', @(s,e)getValues(s))
waitfor(dbh);
I = get(h,'CData');
handles.I = I;
imshow(handles.I);
end
%the callback function for when the user closes the imcontrast window
function getValues(dbh)
window_min = str2double(get(findobj(dbh, 'tag', 'window min edit'), 'String'));
window_max = str2double(get(findobj(dbh, 'tag', 'window max edit'), 'String'));
contrast = [window_min window_max];
handles.contrast = contrast;
I'm able to get the values but I can't close the imcontrast window anymore, I tried close() didn't work... anyreason why would this happen?
thank you!

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

To close all open figures, use the command

close all

Figures with the ‘HandleVisibility’ property set to ‘off’ will not be closed with “close all”. To close these figures, use the command

delete(findall(0));

To close all open Simulink models, use the command

bdclose all

If you have a GUI that opens plot windows and you would like to close all plots without closing the GUI at the same time, then you can use the following code:

SEE COMPLETE ANSWER CLICK THE LINK

--

--

--

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

HOW TO PREPARE FOR THE MICROSOFT SUMMER INTERNSHIP INTERVIEWS.

Crafting the MishiPay experience

Shell Script Loop and Functions

Example of For loop

EOS DAppTutorial

Why doesn’t the Hardware Setup detect my PARROT Rolling Spider on Windows?

VirtualBox — Export VM as OVF template

Why Coding Is Crucial To The Future Of Business

The Best Way to Setup Your M1 Mac for Python Development

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Technical Source

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

More from Medium

Run Klipper/OctoPrint In Void Linux

How to apply a Color Thresholder function in Image Batch Processor

Deep Deformable Image Registration

Setting up Python Interpreter and running Python Code on Docker Container