Relative Critical Sets and Image Processing